summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-06-05 00:49:37 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-05 00:51:11 -0600
commitf338cb024ffad54b051000bba3d42fd343e363ae (patch)
treefa80c7919392f853fa12bfe9bd23e4da58357eaf /db-functions
parentd0834f7e6bd53ea729374eab138bb38a36c73996 (diff)
db-functions: do better printing of whitespace-separated filenames
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions10
1 files changed, 6 insertions, 4 deletions
diff --git a/db-functions b/db-functions
index a0b20cd..deaa008 100644
--- a/db-functions
+++ b/db-functions
@@ -509,12 +509,13 @@ arch_repo_add() {
local arch=$2
local pkgs=("${@:3}")
+ printf -v pkgs_str -- '%q ' "${pkgs[@]}"
# 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 '%s' "repo-add ${repo}${DBEXT} ${pkgs[*]}"
+ || error 'repo-add %q %s' "${repo}${DBEXT}" "${pkgs_str% }"
/usr/bin/repo-add -f -q "${repo}${FILESEXT}" "${pkgs[@]}" \
- || error '%s' "repo-add -f ${repo}${FILESEXT} ${pkgs[*]}"
+ || error 'repo-add -f %q %s' "${repo}${FILESEXT}" "${pkgs_str% }"
popd >/dev/null
set_repo_permission "${repo}" "${arch}"
@@ -532,10 +533,11 @@ arch_repo_remove() {
error "No database found at '%s'" "${dbfile}"
return 1
fi
+ printf -v pkgs_str -- '%q ' "${pkgs[@]}"
/usr/bin/repo-remove -q "${dbfile}" "${pkgs[@]}" >/dev/null \
- || error '%s' "repo-remove ${dbfile} ${pkgs[*]}"
+ || error 'repo-remove %q %s' "${dbfile}" "${pkgs_str% }"
/usr/bin/repo-remove -q "${filesfile}" "${pkgs[@]}" \
- || error '%s' "repo-remove ${filesfile} ${pkgs[*]}"
+ || error 'repo-remove %q %s' "${filesfile}" "${pkgs_str% }"
set_repo_permission "${repo}" "${arch}"
REPO_MODIFIED=1