diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-05 11:28:04 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-05 11:28:04 -0500 |
commit | cb9e36694cb02b7190d806fc41e7e3927aabedbd (patch) | |
tree | bdde0bf1ccc75ca628512455ff8fe675faaf75a9 /src/dagpkg | |
parent | 19896860cab0ecee691bf336c98c2c2b18ea5e20 (diff) |
dagpkg: be more careful with variables
Diffstat (limited to 'src/dagpkg')
-rwxr-xr-x | src/dagpkg | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -31,6 +31,18 @@ check_vars libretools FULLBUILDCMD || exit 1 load_files makepkg check_vars makepkg CARCH || exit 1 +# Globals: +# - temp_dir +# - log +# - name (sort of, it's also local to visit_pkgbuild() ) +# - prev +# - I +# - marks +# - various PKGBUILD variables: +# - pkgbase/pkgname +# - epoch/pkgver/pkgrel +# - arch +# - {,make,check}depends # End inmediately but print an useful message trap_exit() { @@ -61,8 +73,9 @@ source_pkgbuild() { unset build package &>/dev/null - for _pkg in ${pkgname[@]}; do - unset package_${_pkg} &>/dev/null || true + local _pkg + for _pkg in "${pkgname[@]}"; do + unset "package_${_pkg}" &>/dev/null || true done # This is the name of the package @@ -117,12 +130,13 @@ visit_pkgbuild() { marks[$name]=1 # Recurse into dependencies - for d in ${depends[@]} ${makedepends[@]}; do + local d + for d in "${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}"; do # Cleanup dependency versions d=$(echo $d | sed "s/[<>=].*//") # Where's the pkgbuild? - w=$(toru-where $d) + local w=$(toru-where $d) # Skip if not available test -z "$w" && continue @@ -160,7 +174,7 @@ nl ${log} | while read order pkg; do fi # where's this package? - w="$(toru-where "$pkg")" + local w="$(toru-where "$pkg")" test -z "$w" && continue # copy to work dir if not already |