diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 13:05:12 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 13:05:12 -0400 |
commit | 46510e1fc48f37ce76c2bf5f19f885bba8d5d098 (patch) | |
tree | 4041b571637ee0641f4ec202190fcf92c0c3b3a2 /cron-jobs/check_archlinux | |
parent | df49c9b89e56b6c8d2d20cdcc9e03dc80996fcdd (diff) |
Clean up quoting.
Diffstat (limited to 'cron-jobs/check_archlinux')
-rwxr-xr-x | cron-jobs/check_archlinux/parse_pkgbuilds.sh | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cron-jobs/check_archlinux/parse_pkgbuilds.sh b/cron-jobs/check_archlinux/parse_pkgbuilds.sh index 9b26f1e..b857ac8 100755 --- a/cron-jobs/check_archlinux/parse_pkgbuilds.sh +++ b/cron-jobs/check_archlinux/parse_pkgbuilds.sh @@ -12,7 +12,7 @@ readonly -a variables splitpkg_overrides backup_package_variables() { for var in "${splitpkg_overrides[@]}"; do indirect="${var}_backup" - eval "${indirect}=(\${$var[@]})" + eval "${indirect}=(\"\${$var[@]}\")" done } @@ -20,9 +20,9 @@ restore_package_variables() { for var in "${splitpkg_overrides[@]}"; do indirect="${var}_backup" if [ -n "${!indirect}" ]; then - eval "${var}=(\${$indirect[@]})" + eval "${var}=(\"\${$indirect[@]}\")" else - unset ${var} + unset "${var}" fi done } @@ -42,31 +42,31 @@ print_info() { if [ -n "$arch" ]; then echo "%ARCH%" - for i in "${arch[@]}"; do echo $i; done + for i in "${arch[@]}"; do echo "$i"; done echo "" fi if [ -n "$depends" ]; then echo "%DEPENDS%" for i in "${depends[@]}"; do - echo $i + echo "$i" done echo "" fi if [ -n "$makedepends" ]; then echo "%MAKEDEPENDS%" for i in "${makedepends[@]}"; do - echo $i + echo "$i" done echo "" fi if [ -n "$conflicts" ]; then echo "%CONFLICTS%" - for i in "${conflicts[@]}"; do echo $i; done + for i in "${conflicts[@]}"; do echo "$i"; done echo "" fi if [ -n "$provides" ]; then echo "%PROVIDES%" - for i in "${provides[@]}"; do echo $i; done + for i in "${provides[@]}"; do echo "$i"; done echo "" fi } @@ -76,9 +76,9 @@ source_pkgbuild() { dir=$1 pkgbuild=$dir/PKGBUILD for var in "${variables[@]}"; do - unset ${var} + unset "${var}" done - source $pkgbuild &>/dev/null || ret=$? + source "$pkgbuild" &>/dev/null || ret=$? # ensure $pkgname and $pkgver variables were found if [ $ret -ne 0 -o -z "$pkgname" -o -z "$pkgver" ]; then @@ -89,7 +89,7 @@ source_pkgbuild() { if [ "${#pkgname[@]}" -gt "1" ]; then pkgbase=${pkgbase:-${pkgname[0]}} for pkg in "${pkgname[@]}"; do - if [ "$(type -t package_${pkg})" != "function" ]; then + if [ "$(type -t "package_${pkg}")" != "function" ]; then echo -e "%INVALID%\n$pkgbuild\n" return 1 else @@ -104,7 +104,7 @@ source_pkgbuild() { break fi done - done < <(type package_${pkg}) + done < <(type "package_${pkg}") print_info restore_package_variables fi @@ -124,14 +124,14 @@ find_pkgbuilds() { return fi - if [ -f $1/PKGBUILD ]; then - source_pkgbuild $1 + if [ -f "$1/PKGBUILD" ]; then + source_pkgbuild "$1" return fi empty=1 - for dir in $1/*; do - if [ -d $dir ]; then - find_pkgbuilds $dir + for dir in "$1"/*; do + if [ -d "$dir" ]; then + find_pkgbuilds "$dir" unset empty fi done @@ -147,7 +147,7 @@ fi CARCH=$1 shift for dir in "$@"; do - find_pkgbuilds $dir + find_pkgbuilds "$dir" done exit 0 |