summaryrefslogtreecommitdiff
path: root/db-move
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-18 00:32:24 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-18 00:32:24 -0400
commit43f8af33f08924092826e2094d15be704e842f3a (patch)
tree73b982bf9356c397085b3a0d0f1360708a799288 /db-move
parent426c14d9a8364193dec631a389470fb4465ef9ce (diff)
more quoting and printf fixes
Diffstat (limited to 'db-move')
-rwxr-xr-xdb-move34
1 files changed, 17 insertions, 17 deletions
diff --git a/db-move b/db-move
index fe94883..f6588c3 100755
--- a/db-move
+++ b/db-move
@@ -4,7 +4,7 @@
. "$(dirname "$(readlink -e "$0")")/db-functions"
if [ $# -lt 3 ]; then
- msg "usage: ${0##*/} <repo-from> <repo-to> <pkgname|pkgbase> ..."
+ msg "usage: %s <repo-from> <repo-to> <pkgname|pkgbase> ..." "${0##*/}"
exit 1
fi
@@ -14,14 +14,14 @@ repo_to="${args[1]}"
ftppath_from="${FTP_BASE}/${repo_from}/os/"
ftppath_to="${FTP_BASE}/${repo_to}/os/"
-if ! check_repo_permission $repo_to || ! check_repo_permission $repo_from; then
+if ! check_repo_permission "$repo_to" || ! check_repo_permission "$repo_from"; then
die "You don't have permission to move packages from ${repo_from} to ${repo_to}"
fi
# TODO: this might lock too much (architectures)
for pkgarch in "${ARCHES[@]}"; do
- repo_lock ${repo_to} ${pkgarch} || exit 1
- repo_lock ${repo_from} ${pkgarch} || exit 1
+ repo_lock "${repo_to}" "${pkgarch}" || exit 1
+ repo_lock "${repo_from}" "${pkgarch}" || exit 1
done
# First loop is to check that all necessary files exist
@@ -41,30 +41,30 @@ for pkgbase in "${args[@]:2}"; do
fi
for pkgname in "${pkgnames[@]}"; do
- pkgver=$(. "${xbsrepo_from}/PKGBUILD"; get_full_version ${pkgname})
+ pkgver=$(. "${xbsrepo_from}/PKGBUILD"; get_full_version "${pkgname}")
if [ -z "${pkgver}" ]; then
die "Could not read pkgver"
fi
for tarch in "${tarches[@]}"; do
- getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT} >/dev/null
+ getpkgfile "${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} >/dev/null
done
done
continue 2
fi
done
- die "${pkgbase} not found in ${repo_from}"
+ die "%s not found in %s" "${pkgbase}" "${repo_from}"
done
-msg "Moving packages from [${repo_from}] to [${repo_to}]..."
+msg "Moving packages from [%s] to [%s]..." "${repo_from}" "${repo_to}"
declare -A add_pkgs
declare -A remove_pkgs
for pkgbase in "${args[@]:2}"; do
# move the package in xbs
- arches=($(xbs move ${repo_from} ${repo_to} ${pkgbase}))
+ arches=($(xbs move "${repo_from}" "${repo_to}" "${pkgbase}"))
# move the package in ftp
for pkgarch in "${arches[@]}"; do
- dir_to="$(xbs releasepath $pkgbase $repo_to $pkgarch)"
+ dir_to="$(xbs releasepath "$pkgbase" "$repo_to" "$pkgarch")"
if true; then # to add in indent level to make merging easier
if [ "${pkgarch}" == 'any' ]; then
tarches=("${ARCHES[@]}")
@@ -74,14 +74,14 @@ for pkgbase in "${args[@]:2}"; do
eval "pkgnames=($(. "${dir_to}/PKGBUILD"; printf '%q ' "${pkgname[@]}"))"
for pkgname in "${pkgnames[@]}"; do
- pkgver=$(. "${dir_to}/PKGBUILD"; get_full_version ${pkgname})
+ pkgver=$(. "${dir_to}/PKGBUILD"; get_full_version "${pkgname}")
for tarch in "${tarches[@]}"; do
- pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT})
+ pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT})
pkgfile="${pkgpath##*/}"
- ln -s "../../../${PKGPOOL}/${pkgfile}" ${ftppath_to}/${tarch}/
- if [ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig ]; then
- ln -s "../../../${PKGPOOL}/${pkgfile}.sig" ${ftppath_to}/${tarch}/
+ ln -s "../../../${PKGPOOL}/${pkgfile}" "${ftppath_to}/${tarch}/"
+ if [ -f "${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig" ]; then
+ ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "${ftppath_to}/${tarch}/"
fi
add_pkgs[${tarch}]+="${FTP_BASE}/${PKGPOOL}/${pkgfile} "
remove_pkgs[${tarch}]+="${pkgname} "
@@ -99,6 +99,6 @@ for tarch in "${ARCHES[@]}"; do
done
for pkgarch in "${ARCHES[@]}"; do
- repo_unlock ${repo_from} ${pkgarch}
- repo_unlock ${repo_to} ${pkgarch}
+ repo_unlock "${repo_from}" "${pkgarch}"
+ repo_unlock "${repo_to}" "${pkgarch}"
done