From ff089d0a64dbf280c73e2ad6b11f82d015e229bd Mon Sep 17 00:00:00 2001 From: "Joshua I. Haase H. (xihh)" Date: Mon, 4 Jun 2012 19:45:21 -0500 Subject: fix https://labs.parabola.nu/issues/30 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fullpkg-find: - «copy_files» function added - removed «circular deps» unused code --- fullpkg-find | 51 +++++++++++++++++++++++++++++++++++---------------- 1 file 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 : use this ABSROOT." # Is it needed anymore? + echo " -A : use this ABSROOT." echo " -c : clean before working." echo " -m : 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 -- cgit v1.2.3