summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-17 23:23:31 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-17 23:23:31 -0400
commitc54e53593927e5469cfe13bacd29d25168235606 (patch)
treeaa9c0956c87bd836995b8d4086c8a472302eb571 /db-functions
parentb1ac233691ac28645cb729d7d5e7c7b51fc899bd (diff)
more quoting fixes
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions30
1 files changed, 15 insertions, 15 deletions
diff --git a/db-functions b/db-functions
index 5b10e05..86a2b1e 100644
--- a/db-functions
+++ b/db-functions
@@ -12,7 +12,7 @@ set_umask () {
}
restore_umask () {
- umask $UMASK >/dev/null
+ umask "$UMASK" >/dev/null
}
# just like mv -f, but we touch the file and then copy the content so
@@ -39,7 +39,7 @@ REPO_MODIFIED=0
script_lock() {
local LOCKDIR="$TMPDIR/.scriptlock.${0##*/}"
if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then
- local _owner="$(/usr/bin/stat -c %U $LOCKDIR)"
+ local _owner="$(/usr/bin/stat -c %U "$LOCKDIR")"
error "Script ${0##*/} is already locked by $_owner."
exit 1
else
@@ -72,7 +72,7 @@ cleanup() {
arch=${l#*.}
if [ -d "$TMPDIR/.repolock.$repo.$arch" ]; then
msg "Removing left over lock from [${repo}] (${arch})"
- repo_unlock $repo $arch
+ repo_unlock "$repo" "$arch"
fi
done
if [ -d "$TMPDIR/.scriptlock.${0##*/}" ]; then
@@ -85,7 +85,7 @@ cleanup() {
date +%s > "${FTP_BASE}/lastupdate"
fi
- [ "$1" ] && exit $1
+ [ "$1" ] && exit "$1"
}
abort() {
@@ -133,9 +133,9 @@ repo_lock () {
fi
_count=0
- while [ $_count -le $_trial ] || $_lockblock ; do
+ while [ "$_count" -le "$_trial" ] || "$_lockblock" ; do
if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then
- _owner="$(/usr/bin/stat -c %U $LOCKDIR)"
+ _owner="$(/usr/bin/stat -c %U "$LOCKDIR")"
warning "Repo [${1}] (${2}) is already locked by $_owner. "
msg2 "Retrying in $LOCK_DELAY seconds..."
else
@@ -143,7 +143,7 @@ repo_lock () {
set_umask
return 0
fi
- sleep $LOCK_DELAY
+ sleep "$LOCK_DELAY"
let _count=$_count+1
done
@@ -241,12 +241,12 @@ getpkgfile() {
elif [ ! -f "${1}" ]; then
error "Package ${1} not found!"
exit 1
- elif ${REQUIRE_SIGNATURE} && [ ! -f "${1}.sig" ]; then
+ elif "${REQUIRE_SIGNATURE}" && [ ! -f "${1}.sig" ]; then
error "Package signature ${1}.sig not found!"
exit 1
fi
- echo ${1}
+ echo "${1}"
}
getpkgfiles() {
@@ -260,7 +260,7 @@ getpkgfiles() {
if [ ! -f "${f}" ]; then
error "Package ${f} not found!"
exit 1
- elif ${REQUIRE_SIGNATURE} && [ ! -f "${f}.sig" ]; then
+ elif "${REQUIRE_SIGNATURE}" && [ ! -f "${f}.sig" ]; then
error "Package signature ${f}.sig not found!"
exit 1
fi
@@ -272,11 +272,11 @@ getpkgfiles() {
check_pkgfile() {
local pkgfile=$1
- local pkgname="$(getpkgname ${pkgfile})"
+ local pkgname="$(getpkgname "${pkgfile}")"
[ $? -ge 1 ] && return 1
- local pkgver="$(getpkgver ${pkgfile})"
+ local pkgver="$(getpkgver "${pkgfile}")"
[ $? -ge 1 ] && return 1
- local pkgarch="$(getpkgarch ${pkgfile})"
+ local pkgarch="$(getpkgarch "${pkgfile}")"
[ $? -ge 1 ] && return 1
in_array "${pkgarch}" "${ARCHES[@]}" 'any' || return 1
@@ -305,7 +305,7 @@ check_pkgxbs() {
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[@]}))
+ eval "local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; printf '%q ' "${pkgname[@]}"))"
in_array "${_pkgname}" "${xbsnames[@]}" || return 1
return 0
@@ -331,7 +331,7 @@ check_splitpkgs() {
mkdir -p "${repo}/${_pkgarch}/${_pkgbase}"
echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging"
- local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; echo ${pkgname[@]}))
+ eval "local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; printf '%q ' "${pkgname[@]}"))"
for xbsname in "${xbsnames[@]}"; do
echo "${xbsname}" >> "${repo}/${_pkgarch}/${_pkgbase}/xbs"
done