summaryrefslogtreecommitdiff
path: root/db-move
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-01-08 20:53:38 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-01-08 21:00:14 -0500
commit39fbf0d8d3cdc666912c597d41d5b6a70fc0c725 (patch)
tree75431027d99758dbe1f13896c8ff0ef97e14e766 /db-move
parente7d2dcac7cf857fdccd82bec2bfc2a7d8e6b85c6 (diff)
Fix some array quoting.
Diffstat (limited to 'db-move')
-rwxr-xr-xdb-move27
1 files changed, 13 insertions, 14 deletions
diff --git a/db-move b/db-move
index 1b34404..c66b088 100755
--- a/db-move
+++ b/db-move
@@ -8,7 +8,7 @@ if [ $# -lt 3 ]; then
exit 1
fi
-args=(${@})
+args=("${@}")
repo_from="${args[0]}"
repo_to="${args[1]}"
ftppath_from="${FTP_BASE}/${repo_from}/os/"
@@ -19,14 +19,14 @@ if ! check_repo_permission $repo_to || ! check_repo_permission $repo_from; then
fi
# TODO: this might lock too much (architectures)
-for pkgarch in ${ARCHES[@]}; do
+for pkgarch in "${ARCHES[@]}"; do
repo_lock ${repo_to} ${pkgarch} || exit 1
repo_lock ${repo_from} ${pkgarch} || exit 1
done
# check if packages to be moved exist in xbs and ftp dir
-for pkgbase in ${args[@]:2}; do
- for pkgarch in ${ARCHES[@]} 'any'; do
+for pkgbase in "${args[@]:2}"; do
+ for pkgarch in "${ARCHES[@]}" 'any'; do
xbsrepo_from="$(xbs releasepath ${pkgbase} ${repo_from} ${pkgarch})"
if [ -r "${xbsrepo_from}/PKGBUILD" ]; then
pkgnames=($(. "${xbsrepo_from}/PKGBUILD"; echo ${pkgname[@]}))
@@ -34,19 +34,18 @@ for pkgbase in ${args[@]:2}; do
die "Could not read pkgname"
fi
-
if [ "${pkgarch}" == 'any' ]; then
- tarches=(${ARCHES[@]})
+ tarches=("${ARCHES[@]}")
else
tarches=("${pkgarch}")
fi
- for pkgname in ${pkgnames[@]}; do
+ for pkgname in "${pkgnames[@]}"; do
pkgver=$(. "${xbsrepo_from}/PKGBUILD"; get_full_version ${pkgname})
if [ -z "${pkgver}" ]; then
die "Could not read pkgver"
fi
- for tarch in ${tarches[@]}; do
+ for tarch in "${tarches[@]}"; do
getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT} >/dev/null
done
done
@@ -60,11 +59,11 @@ msg "Moving packages from [${repo_from}] to [${repo_to}]..."
declare -A add_pkgs
declare -A remove_pkgs
-for pkgbase in ${args[@]:2}; do
+for pkgbase in "${args[@]:2}"; do
# move the package in xbs
arches=($(xbs move ${repo_from} ${repo_to} ${pkgbase}))
# move the package in ftp
- for pkgarch in ${arches[@]}; do
+ for pkgarch in "${arches[@]}"; do
dir_to="$(xbs releasepath $pkgbase $repo_to $pkgarch)"
if true; then # to add in indent level to make merging easier
if [ "${pkgarch}" == 'any' ]; then
@@ -74,9 +73,9 @@ for pkgbase in ${args[@]:2}; do
fi
pkgnames=($(. "${dir_to}/PKGBUILD"; echo ${pkgname[@]}))
- for pkgname in ${pkgnames[@]}; do
+ for pkgname in "${pkgnames[@]}"; do
pkgver=$(. "${dir_to}/PKGBUILD"; get_full_version ${pkgname})
- for tarch in ${tarches[@]}; do
+ for tarch in "${tarches[@]}"; do
pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT})
pkgfile="${pkgpath##*/}"
@@ -92,14 +91,14 @@ for pkgbase in ${args[@]:2}; do
done
done
-for tarch in ${ARCHES[@]}; do
+for tarch in "${ARCHES[@]}"; do
if [ -n "${add_pkgs[${tarch}]}" ]; then
arch_repo_add "${repo_to}" "${tarch}" ${add_pkgs[${tarch}]}
arch_repo_remove "${repo_from}" "${tarch}" ${remove_pkgs[${tarch}]}
fi
done
-for pkgarch in ${ARCHES[@]}; do
+for pkgarch in "${ARCHES[@]}"; do
repo_unlock ${repo_from} ${pkgarch}
repo_unlock ${repo_to} ${pkgarch}
done