From b3c27405fb9e2686d3db9ee23ca616dc6b93b1f3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 14:20:35 -0400 Subject: silly whitespace and similar fidling --- db-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'db-functions') diff --git a/db-functions b/db-functions index 51fc1bd..accc508 100644 --- a/db-functions +++ b/db-functions @@ -188,7 +188,7 @@ repo_lock () { while [ "$_count" -le "$_trial" ] || "$_lockblock" ; do if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then _owner="$(/usr/bin/stat -c %U "$LOCKDIR")" - warning "Repo [%s] (%s) is already locked by %s." "$1" "$2" "$_owner" + warning "Repo [%s] (%s) is already locked by %s." "${1}" "${2}" "$_owner" msg2 "Retrying in %d seconds..." "$LOCK_DELAY" else LOCKS+=("$1.$2") @@ -490,7 +490,7 @@ set_repo_permission() { if [ -w "${dbfile}" ]; then local group=$(/usr/bin/stat --printf='%G' "$(dirname "${dbfile}")") - chgrp "$group" "${dbfile}" || error "Could not change group of %s to %s" "${dbfile}" "$group" + chgrp "$group" "${dbfile}" || error "Could not change group of %s to %s" "${dbfile}" "$group" chgrp "$group" "${filesfile}" || error "Could not change group of %s to %s" "${filesfile}" "$group" chmod g+w "${dbfile}" || error "Could not set write permission for group %s to %s" "$group" "${dbfile}" chmod g+w "${filesfile}" || error "Could not set write permission for group %s to %s" "$group" "${filesfile}" -- cgit v1.2.3-2-g168b From 12faf7365342bcfebb951dd748d48b5db8a1acba Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 14:20:54 -0400 Subject: oops --- db-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-functions') diff --git a/db-functions b/db-functions index accc508..e45f673 100644 --- a/db-functions +++ b/db-functions @@ -171,7 +171,7 @@ repo_lock () { return 1 fi if [ -f "${FILESLOCKFILE}" ]; then - error "Repo [%s] (%s) is already locked by repo-{add,remove} process %s" "$2" "$2" "$(<"$FILESLOCKFILE")" + error "Repo [%s] (%s) is already locked by repo-{add,remove} process %s" "$1" "$2" "$(<"$FILESLOCKFILE")" return 1 fi -- cgit v1.2.3-2-g168b From 108262939f3b80bc82e1a2eec983944f448f2afd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 14:21:18 -0400 Subject: db-functions:check_repo_permissions: ARCHES is an array --- db-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-functions') diff --git a/db-functions b/db-functions index e45f673..ca43259 100644 --- a/db-functions +++ b/db-functions @@ -472,7 +472,7 @@ check_repo_permission() { [ -w "$FTP_BASE/${PKGPOOL}" ] || return 1 local arch - for arch in ${ARCHES}; do + for arch in "${ARCHES[@]}"; do local dir="${FTP_BASE}/${repo}/os/${arch}/" [ -w "${dir}" ] || return 1 [ -f "${dir}${repo}"${DBEXT} -a ! -w "${dir}${repo}"${DBEXT} ] && return 1 -- cgit v1.2.3-2-g168b From 14dc8bc6bf985464c119910eeb22f65f534a57b0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 14:21:29 -0400 Subject: more quoting fixes --- db-functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'db-functions') diff --git a/db-functions b/db-functions index ca43259..5ccaaad 100644 --- a/db-functions +++ b/db-functions @@ -298,7 +298,7 @@ getpkgfile() { exit 1 fi - echo ${1} + echo "${1}" } getpkgfiles() { @@ -425,11 +425,11 @@ check_splitpkgs() { check_pkgrepos() { 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 [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1 -- cgit v1.2.3-2-g168b From 809e7ede093e6348552a9dc3d28b61e669bb49fd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 14:34:32 -0400 Subject: db-funtions:check_splitpkgs(): use printf instead of a loop --- db-functions | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'db-functions') diff --git a/db-functions b/db-functions index 5ccaaad..6543d96 100644 --- a/db-functions +++ b/db-functions @@ -404,8 +404,7 @@ check_splitpkgs() { fi local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}")) - for svnname in "${svnnames[@]}"; do - echo "${svnname}" >> "${repo}/${_pkgarch}/${_pkgbase}/svn" + printf '%s\n' "${svnnames[@]}" >> "${repo}/${_pkgarch}/${_pkgbase}/svn" done done popd >/dev/null -- cgit v1.2.3-2-g168b From cdc18bf703f6f6a55053b86c36df3775ed02eea7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 19:26:57 -0400 Subject: oops --- db-functions | 1 - 1 file changed, 1 deletion(-) (limited to 'db-functions') diff --git a/db-functions b/db-functions index 6543d96..a4b072b 100644 --- a/db-functions +++ b/db-functions @@ -405,7 +405,6 @@ check_splitpkgs() { local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}")) printf '%s\n' "${svnnames[@]}" >> "${repo}/${_pkgarch}/${_pkgbase}/svn" - done done popd >/dev/null -- cgit v1.2.3-2-g168b