summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-18 11:58:49 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-18 11:58:49 -0400
commit7d061a7e0faa365ae2448154c010eed26409713d (patch)
tree87f3405cbd87834ea9c65cc6df54a33a6e5a9a21 /db-functions
parente8f411803648f64b386dd2970b024b9ba15ba682 (diff)
more quoting an printf fixes
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions15
1 files changed, 7 insertions, 8 deletions
diff --git a/db-functions b/db-functions
index f703386..a1e86d9 100644
--- a/db-functions
+++ b/db-functions
@@ -1,7 +1,7 @@
#!/bin/bash
# Some PKGBUILDs need CARCH to be set
-CARCH=$(. $(librelib conf.sh); load_files makepkg; echo $CARCH)
+CARCH=$(. "$(librelib conf.sh)"; load_files makepkg; echo "$CARCH")
# Useful functions
UMASK=""
@@ -251,7 +251,7 @@ getpkgfile() {
getpkgfiles() {
local f
- if [ ! -z "$(echo ${@%\.*} | sed "s/ /\n/g" | sort | uniq -D)" ]; then
+ if [ ! -z "$(printf '%s\n' "${@%\.*}" | sort | uniq -D)" ]; then
error 'Duplicate packages found!'
exit 1
fi
@@ -302,7 +302,7 @@ check_pkgxbs() {
in_array "${repo}" "${PKGREPOS[@]}" || return 1
- local xbsver="$(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; get_full_version "${_pkgname}")"
+ local xbsver="$(. "$(xbs releasepath "${_pkgbase}" "${repo}" "${_pkgarch}")/PKGBUILD"; get_full_version "${_pkgname}")"
[ "${xbsver}" == "${_pkgver}" ] || return 1
local xbsnames=($(. "$(xbs releasepath "${_pkgbase}" "${repo}" "${_pkgarch}")/PKGBUILD"; echo "${pkgname[@]}"))
@@ -332,8 +332,7 @@ check_splitpkgs() {
echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging"
local xbsnames=($(. "$(xbs releasepath "${_pkgbase}" "${repo}" "${_pkgarch}")/PKGBUILD"; echo "${pkgname[@]}"))
- for xbsname in "${xbsnames[@]}"; do
- echo "${xbsname}" >> "${repo}/${_pkgarch}/${_pkgbase}/xbs"
+ printf '%s\n' "${xbsnames[@]}" >> "${repo}/${_pkgarch}/${_pkgbase}/xbs"
done
done
popd >/dev/null
@@ -441,13 +440,13 @@ arch_repo_remove() {
local filesfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}"
if [ ! -f "${dbfile}" ]; then
- error "No database found at '${dbfile}'"
+ error "No database found at '%s'" "${dbfile}"
return 1
fi
/usr/bin/repo-remove -q "${dbfile}" "${pkgs[@]}" >/dev/null \
- || error "repo-remove ${dbfile} ${pkgs[*]}"
+ || error '%s' "repo-remove ${dbfile} ${pkgs[*]}"
/usr/bin/repo-remove -q "${filesfile}" "${pkgs[@]}" \
- || error "repo-remove ${filesfile} ${pkgs[*]}"
+ || error '%s' "repo-remove ${filesfile} ${pkgs[*]}"
set_repo_permission "${repo}" "${arch}"
REPO_MODIFIED=1