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 /db-update | |
parent | e7d2dcac7cf857fdccd82bec2bfc2a7d8e6b85c6 (diff) |
Fix some array quoting.
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -16,26 +16,26 @@ fi repos=() for staging_repo in ${staging_repos[@]##*/}; do - if in_array ${staging_repo} ${PKGREPOS[@]}; then - repos+=(${staging_repo}) + if in_array "${staging_repo}" "${PKGREPOS[@]}"; then + repos+=("${staging_repo}") fi done # TODO: this might lock too much (architectures) -for repo in ${repos[@]}; do - for pkgarch in ${ARCHES[@]}; do +for repo in "${repos[@]}"; do + for pkgarch in "${ARCHES[@]}"; do repo_lock ${repo} ${pkgarch} || exit 1 done done # check if packages are valid -for repo in ${repos[@]}; do +for repo in "${repos[@]}"; do pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT})) if [ $? -eq 0 ]; then if [ ${#pkgs[@]} -gt 0 ] && ! check_repo_permission "${repo}"; then die "You don't have permission to update packages in ${repo}" fi - for pkg in ${pkgs[@]}; do + for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then die "Package ${repo}/${pkg##*/} is a symbolic link" fi @@ -60,13 +60,13 @@ for repo in ${repos[@]}; do fi done -for repo in ${repos[@]}; do +for repo in "${repos[@]}"; do msg "Updating [${repo}]..." any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) - for pkgarch in ${ARCHES[@]}; do + for pkgarch in "${ARCHES[@]}"; do add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null)) - for pkg in ${arch_pkgs[@]} ${any_pkgs[@]}; do + for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do pkgfile="${pkg##*/}" msg2 "${pkgfile} (${pkgarch})" # any packages might have been moved by the previous run @@ -81,16 +81,16 @@ for repo in ${repos[@]}; do if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" fi - add_pkgs[${#add_pkgs[*]}]=${pkgfile} + add_pkgs+=("${pkgfile}") done if [ ${#add_pkgs[@]} -ge 1 ]; then - arch_repo_add "${repo}" "${pkgarch}" ${add_pkgs[@]} + arch_repo_add "${repo}" "${pkgarch}" "${add_pkgs[@]}" fi done done -for repo in ${repos[@]}; do - for pkgarch in ${ARCHES[@]}; do +for repo in "${repos[@]}"; do + for pkgarch in "${ARCHES[@]}"; do repo_unlock ${repo} ${pkgarch} done done |