summaryrefslogtreecommitdiff
path: root/fullpkg-find
diff options
context:
space:
mode:
Diffstat (limited to 'fullpkg-find')
-rwxr-xr-xfullpkg-find51
1 files changed, 35 insertions, 16 deletions
diff --git a/fullpkg-find b/fullpkg-find
index 64c1790..2f3aaaa 100755
--- a/fullpkg-find
+++ b/fullpkg-find
@@ -31,6 +31,36 @@ get_fullver() {
}
+copy_files() {
+
+ local copydir="$build_dir/${pkgbase:-${pkgname[0]}}"
+ mkdir -p "$copydir"
+
+ # Copy PKGBUILD and sources
+ cp PKGBUILD "$copydir"
+ (
+ source PKGBUILD
+ for file in "${source[@]}"; do
+ file="${file%%::*}"
+ file="${file##*://*/}"
+ if [[ -f $file ]]; then
+ cp "$file" "$copydir/"
+ elif [[ -f $SRCDEST/$file ]]; then
+ cp "$SRCDEST/$file" "$copydir/"
+ fi
+ done
+
+ # Find all changelog and install files, even inside functions
+ for i in 'changelog' 'install'; do
+ while read -r file; do
+ # evaluate any bash variables used
+ eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
+ [[ -f $file ]] && cp "$file" "$copydir"
+ done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
+ done
+ )
+}
+
# Checks ABSROOT and look for target pkg deps. Adds them if not built or outdated.
find_deps() {
# Check this level
@@ -63,7 +93,7 @@ find_deps() {
exit 0
# Copy dir to build_dir
else
- cp -r ../${pkgbase}/ ${build_dir}/
+ copy_files
# to identify repo later
echo "repo=$repo" > "${build_dir}/${pkgbase}/.INFO"
@@ -87,7 +117,7 @@ find_deps() {
# TODO change for where_is or toru-path
# May fail, e.g. since abslibre-mips64el doesn't include
# arch=any packages.
- local pkgdir=$(toru -p ${_dep}) || true
+ local pkgdir=$(where_is ${_dep}) || true
if [ -n "$pkgdir" -a -d "${pkgdir}" ]; then
found=true
@@ -133,7 +163,7 @@ usage() {
echo ""
echo "OPTIONS:"
echo " -h : this message."
-# echo " -A <absroot> : use this ABSROOT." # Is it needed anymore?
+ echo " -A <absroot> : use this ABSROOT."
echo " -c : clean <build_dir> before working."
echo " -m <max_level> : check deps until this level"
echo " -n : don't update pacman db."
@@ -145,7 +175,7 @@ usage() {
while getopts 'hA:l:cmn' arg; do
case "$arg" in
h) usage ;;
-# A) ABSROOT="$OPTARG" ;;
+ A) ABSROOT="$OPTARG" ;;
l) LEVEL="$OPTARG" ;; # hidden option to know dep level.
c) CLEANFIRST='true' ;;
m) MAXLEVEL="$OPTARG" ;;
@@ -185,18 +215,7 @@ if [ "$LEVEL" -eq 0 ]; then
msg "Checking dependencies"
fi
-# Probable circular deps
-[ "$LEVEL" -gt "$MAXLEVEL" ] && exit 20
-
# Find the dependencies on the ABS itself
-find_deps || {
-
-# Probable circular deps
- if [ "$?" -eq 20 -a "$LEVEL" -eq 0 ]; then
- error "Check for circular deps on $build_dir/BUILDORDER";
- fi
-# Pass message 20
- exit 20
-}
+find_deps
exit 0