summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-05 11:28:04 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-05 11:28:04 -0500
commitcb9e36694cb02b7190d806fc41e7e3927aabedbd (patch)
treebdde0bf1ccc75ca628512455ff8fe675faaf75a9 /src
parent19896860cab0ecee691bf336c98c2c2b18ea5e20 (diff)
dagpkg: be more careful with variables
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dagpkg24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/dagpkg b/src/dagpkg
index 1e13114..5c38495 100755
--- a/src/dagpkg
+++ b/src/dagpkg
@@ -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