diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-08 17:40:26 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-08 21:19:01 -0500 |
commit | 0811dea8b9c695ed9e67b22d389142956bd1cdd8 (patch) | |
tree | 8d300e5cf517ea53f72f22cbf6a3101c1667f2e7 | |
parent | 1bcc49058febc7e2723c455879da6ff3b9ca6576 (diff) |
Fix quoting on arrays.
-rw-r--r-- | config | 2 | ||||
-rwxr-xr-x | createrepos | 2 | ||||
-rw-r--r-- | db-functions | 22 | ||||
-rwxr-xr-x | db-move | 2 | ||||
-rwxr-xr-x | db-remove | 14 | ||||
-rwxr-xr-x | db-update | 16 |
6 files changed, 29 insertions, 29 deletions
@@ -12,7 +12,7 @@ USERREPOS=('~smv' '~xihh' '~brendan' '~lukeshu' '~emulatorman' '~aurelien' '~jor # Community project repos PROJREPOS=('pcr' 'kernels' 'cross' 'java' 'java-ugly' 'nonprism') # Remote repos -PKGREPOS=(${ARCHREPOS[@]} ${OURREPOS[@]} ${USERREPOS[@]} ${PROJREPOS[@]}) +PKGREPOS=("${ARCHREPOS[@]}" "${OURREPOS[@]}" "${USERREPOS[@]}" "${PROJREPOS[@]}") PKGPOOL='pool/packages' SRCPOOL='sources/packages' diff --git a/createrepos b/createrepos index 926c158..1840c83 100755 --- a/createrepos +++ b/createrepos @@ -5,4 +5,4 @@ source $(dirname $0)/config mkdir -p -- "${FTP_BASE}"/{"${PKGPOOL}","${SRCPOOL}"} "${ARCH_BASE}" "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" -$(dirname $0)/create-repo ${PKGREPOS[@]} +$(dirname $0)/create-repo "${PKGREPOS[@]}" diff --git a/db-functions b/db-functions index f56ca19..59e9c29 100644 --- a/db-functions +++ b/db-functions @@ -445,8 +445,8 @@ check_pkgrepos() { #usage: chk_license ${license[@]}" chk_license() { local l - for l in ${@}; do - in_array ${l} ${ALLOWED_LICENSES[@]} && return 0 + for l in "${@}"; do + in_array "${l}" "${ALLOWED_LICENSES[@]}" && return 0 done return 1 @@ -458,7 +458,7 @@ check_repo_permission() { [ ${#PKGREPOS[@]} -eq 0 ] && return 1 [ -z "${PKGPOOL}" ] && return 1 - in_array "${repo}" ${PKGREPOS[@]} || return 1 + in_array "${repo}" "${PKGREPOS[@]}" || return 1 [ -w "$FTP_BASE/${PKGPOOL}" ] || return 1 @@ -497,10 +497,10 @@ arch_repo_add() { # package files might be relative to repo dir pushd "${FTP_BASE}/${repo}/os/${arch}" >/dev/null - /usr/bin/repo-add -q "${repo}${DBEXT}" ${pkgs[@]} >/dev/null \ - || error "repo-add ${repo}${DBEXT} ${pkgs[@]}" - /usr/bin/repo-add -f -q "${repo}${FILESEXT}" ${pkgs[@]} \ - || error "repo-add -f ${repo}${FILESEXT} ${pkgs[@]}" + /usr/bin/repo-add -q "${repo}${DBEXT}" "${pkgs[@]}" >/dev/null \ + || error "repo-add ${repo}${DBEXT} ${pkgs[*]}" + /usr/bin/repo-add -f -q "${repo}${FILESEXT}" "${pkgs[@]}" \ + || error "repo-add -f ${repo}${FILESEXT} ${pkgs[*]}" popd >/dev/null set_repo_permission "${repo}" "${arch}" } @@ -516,9 +516,9 @@ arch_repo_remove() { error "No database found at '${dbfile}'" return 1 fi - /usr/bin/repo-remove -q "${dbfile}" ${pkgs[@]} >/dev/null \ - || error "repo-remove ${dbfile} ${pkgs[@]}" - /usr/bin/repo-remove -q "${filesfile}" ${pkgs[@]} \ - || error "repo-remove ${filesfile} ${pkgs[@]}" + /usr/bin/repo-remove -q "${dbfile}" "${pkgs[@]}" >/dev/null \ + || error "repo-remove ${dbfile} ${pkgs[*]}" + /usr/bin/repo-remove -q "${filesfile}" "${pkgs[@]}" \ + || error "repo-remove ${filesfile} ${pkgs[*]}" set_repo_permission "${repo}" "${arch}" } @@ -66,7 +66,7 @@ for pkgbase in ${args[@]:2}; do if [ -f "${svnrepo_from}/PKGBUILD" ]; then if [ "${pkgarch}" == 'any' ]; then - tarches=(${ARCHES[@]}) + tarches=("${ARCHES[@]}") else tarches=("${pkgarch}") fi @@ -10,24 +10,24 @@ fi repo="$1" arch="$2" -pkgbases=(${@:3}) +pkgbases=("${@:3}") if ! check_repo_permission $repo; then die "You don't have permission to remove packages from ${repo}" fi if [ "$arch" == "any" ]; then - tarches=(${ARCHES[@]}) + tarches=("${ARCHES[@]}") else tarches=("$arch") fi -for tarch in ${tarches[@]}; do +for tarch in "${tarches[@]}"; do repo_lock $repo $tarch || exit 1 done remove_pkgs=() -for pkgbase in ${pkgbases[@]}; do +for pkgbase in "${pkgbases[@]}"; do msg "Removing $pkgbase from [$repo]..." if [ -d "${SVNREPO}/$repo/$pkgbase" ]; then @@ -36,11 +36,11 @@ for pkgbase in ${pkgbases[@]}; do warning "$pkgbase not found in ABS(libre)" warning "Removing only $pkgbase from the repo" warning "If it was a split package you have to remove the others yourself!" - remove_pkgs[${#remove_pkgs[*]}]=$pkgbase + remove_pkgs+=("$pkgbase") fi done -for tarch in ${tarches[@]}; do - arch_repo_remove "${repo}" "${tarch}" ${remove_pkgs[@]} +for tarch in "${tarches[@]}"; do + arch_repo_remove "${repo}" "${tarch}" "${remove_pkgs[@]}" repo_unlock $repo $tarch done @@ -15,14 +15,14 @@ if [ $? -ge 1 ]; then fi # 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 @@ -48,7 +48,7 @@ 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 @@ -69,16 +69,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 |