From f338cb024ffad54b051000bba3d42fd343e363ae Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 5 Jun 2015 00:49:37 -0600 Subject: db-functions: do better printing of whitespace-separated filenames --- db-functions | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'db-functions') 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 -- cgit v1.2.3-2-g168b