diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-08 20:53:38 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-08 21:00:14 -0500 |
commit | 39fbf0d8d3cdc666912c597d41d5b6a70fc0c725 (patch) | |
tree | 75431027d99758dbe1f13896c8ff0ef97e14e766 /cron-jobs | |
parent | e7d2dcac7cf857fdccd82bec2bfc2a7d8e6b85c6 (diff) |
Fix some array quoting.
Diffstat (limited to 'cron-jobs')
-rwxr-xr-x | cron-jobs/check_archlinux/parse_pkgbuilds.sh | 22 | ||||
-rwxr-xr-x | cron-jobs/ftpdir-cleanup | 12 | ||||
-rwxr-xr-x | cron-jobs/repo-sanity-check | 4 | ||||
-rwxr-xr-x | cron-jobs/sourceballs | 26 | ||||
-rwxr-xr-x | cron-jobs/sourceballs2 | 4 |
5 files changed, 34 insertions, 34 deletions
diff --git a/cron-jobs/check_archlinux/parse_pkgbuilds.sh b/cron-jobs/check_archlinux/parse_pkgbuilds.sh index 3f92169..c8d8618 100755 --- a/cron-jobs/check_archlinux/parse_pkgbuilds.sh +++ b/cron-jobs/check_archlinux/parse_pkgbuilds.sh @@ -6,18 +6,18 @@ exit() { return; } splitpkg_overrides=('depends' 'optdepends' 'provides' 'conflicts') -variables=('pkgname' 'pkgbase' 'epoch' 'pkgver' 'pkgrel' 'makedepends' 'arch' ${splitpkg_overrides[@]}) +variables=('pkgname' 'pkgbase' 'epoch' 'pkgver' 'pkgrel' 'makedepends' 'arch' "${splitpkg_overrides[@]}") readonly -a variables splitpkg_overrides backup_package_variables() { - for var in ${splitpkg_overrides[@]}; do + for var in "${splitpkg_overrides[@]}"; do indirect="${var}_backup" eval "${indirect}=(\${$var[@]})" done } restore_package_variables() { - for var in ${splitpkg_overrides[@]}; do + for var in "${splitpkg_overrides[@]}"; do indirect="${var}_backup" if [ -n "${!indirect}" ]; then eval "${var}=(\${$indirect[@]})" @@ -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 + for i in "${depends[@]}"; do echo $i done echo "" fi if [ -n "$makedepends" ]; then echo "%MAKEDEPENDS%" - for i in ${makedepends[@]}; do + for i in "${makedepends[@]}"; do 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 } @@ -75,7 +75,7 @@ source_pkgbuild() { ret=0 dir=$1 pkgbuild=$dir/PKGBUILD - for var in ${variables[@]}; do + for var in "${variables[@]}"; do unset ${var} done source $pkgbuild &>/dev/null || ret=$? @@ -88,7 +88,7 @@ source_pkgbuild() { if [ "${#pkgname[@]}" -gt "1" ]; then pkgbase=${pkgbase:-${pkgname[0]}} - for pkg in ${pkgname[@]}; do + for pkg in "${pkgname[@]}"; do if [ "$(type -t package_${pkg})" != "function" ]; then echo -e "%INVALID%\n$pkgbuild\n" return 1 @@ -98,7 +98,7 @@ source_pkgbuild() { while IFS= read -r line; do var=${line%%=*} var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters - for realvar in ${variables[@]}; do + for realvar in "${variables[@]}"; do if [ "$var" == "$realvar" ]; then eval $line break diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index e42a1a8..ad2e7f9 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -24,16 +24,16 @@ clean_pkg() { script_lock -for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]}; do +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do repo_lock ${repo} ${arch} || exit 1 done done ${CLEANUP_DRYRUN} && warning 'dry run mode is active' -for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]}; do +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then continue fi @@ -87,8 +87,8 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi -for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]}; do +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do repo_unlock ${repo} ${arch} done done diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check index ee4c061..9d351df 100755 --- a/cron-jobs/repo-sanity-check +++ b/cron-jobs/repo-sanity-check @@ -5,7 +5,7 @@ . "$(dirname "$(readlink -e "$0")")/../db-functions" # Traverse all repos -for _repo in ${PKGREPOS[@]}; do +for _repo in "${PKGREPOS[@]}"; do msg "Cleaning up [${_repo}]" # Find all pkgnames on this repo's abs @@ -19,7 +19,7 @@ for _repo in ${PKGREPOS[@]}; do >/dev/null 2>&1 # also cleanup package functions - for _pkg in ${pkgname[@]}; do + for _pkg in "${pkgname[@]}"; do unset package_${pkg} >/dev/null 2>&1 done diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 1542499..329e135 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -7,8 +7,8 @@ pushd "${WORKDIR}" >/dev/null script_lock -for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]}; do +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do repo_lock ${repo} ${arch} || exit 1 done done @@ -18,8 +18,8 @@ renice +10 -p $$ > /dev/null # Create a readable file for each repo with the following format # <pkgbase|pkgname> <pkgver>-<pkgrel> <arch> <license>[ <license>] -for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]}; do +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do # Repo does not exist; skip it if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then continue @@ -39,8 +39,8 @@ for repo in ${PKGREPOS[@]}; do done | sort -u > "${WORKDIR}/db-${repo}" done -for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]}; do +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do repo_unlock ${repo} ${arch} done done @@ -49,15 +49,15 @@ done find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" # Check for all packages if we need to build a source package -for repo in ${PKGREPOS[@]}; do +for repo in "${PKGREPOS[@]}"; do newpkgs=() failedpkgs=() while read line; do - pkginfo=(${line}) + pkginfo=("${line}") pkgbase=${pkginfo[0]} pkgver=${pkginfo[1]} pkgarch=${pkginfo[2]} - pkglicense=(${pkginfo[@]:3}) + pkglicense=("${pkginfo[@]:3}") # Should this package be skipped? if grep -Fqx "${pkgbase}" "${dirname}/sourceballs.skip"; then @@ -105,13 +105,13 @@ for repo in ${PKGREPOS[@]}; do if [ ${#newpkgs[@]} -ge 1 ]; then msg "Adding source packages for [${repo}]..." - for new_pkg in ${newpkgs[@]}; do + for new_pkg in "${newpkgs[@]}"; do msg2 "${new_pkg}" done fi if [ ${#failedpkgs[@]} -ge 1 ]; then msg "Failed to create source packages for [${repo}]..." - for failed_pkg in ${failedpkgs[@]}; do + for failed_pkg in "${failedpkgs[@]}"; do msg2 "${failed_pkg}" done fi @@ -125,7 +125,7 @@ old_pkgs=($(comm -23 "${WORKDIR}/available-src-pkgs.sort" "${WORKDIR}/expected-s if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old source packages..." ${SOURCE_CLEANUP_DRYRUN} && warning 'dry run mode is active' - for old_pkg in ${old_pkgs[@]}; do + for old_pkg in "${old_pkgs[@]}"; do msg2 "${old_pkg}" if ! ${SOURCE_CLEANUP_DRYRUN}; then mv_acl "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" @@ -137,7 +137,7 @@ fi old_pkgs=($(find ${SOURCE_CLEANUP_DESTDIR} -type f -name "*${SRCEXT}" -mtime +${SOURCE_CLEANUP_KEEP} -printf '%f\n')) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old source packages from the cleanup directory..." - for old_pkg in ${old_pkgs[@]}; do + for old_pkg in "${old_pkgs[@]}"; do msg2 "${old_pkg}" ${SOURCE_CLEANUP_DRYRUN} || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" done diff --git a/cron-jobs/sourceballs2 b/cron-jobs/sourceballs2 index 1432bdf..2a26e6a 100755 --- a/cron-jobs/sourceballs2 +++ b/cron-jobs/sourceballs2 @@ -21,7 +21,7 @@ find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort pushd "${SVNREPO}" >/dev/null -for repo in ${PKGREPOS[@]}; do +for repo in "${PKGREPOS[@]}"; do msg "Sourceballing [${repo}]" pushd $repo >/dev/null @@ -40,7 +40,7 @@ for repo in ${PKGREPOS[@]}; do unset build package url pkgdesc source md5sums depends makedepends \ optdepends license arch options check mksource - for _pkg in ${pkgname[@]}; do + for _pkg in "${pkgname[@]}"; do unset package_${_pkg} >/dev/null 2>&1 done |