diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-12-31 14:50:37 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-12-31 14:50:37 -0500 |
commit | f65c477e42f46a3e22b5fbc5da790f9561483770 (patch) | |
tree | 216acb4c2d0fef7720db927ee1c7c1bd8012f022 /db-functions | |
parent | 99d6b1d0f1f88bf30b75243225cd461afb565f6b (diff) |
clean up
Diffstat (limited to 'db-functions')
-rw-r--r-- | db-functions | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/db-functions b/db-functions index 072f43d..0b59a53 100644 --- a/db-functions +++ b/db-functions @@ -135,7 +135,7 @@ repo_lock () { _count=0 while [ $_count -le $_trial ] || $_lockblock ; do if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then - _owner="$(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 @@ -250,9 +250,6 @@ getpkgfile() { } getpkgfiles() { -# Ignore anything that doesn't glob to PKGEXT - shopt -s nullglob - local f if [ ! -z "$(echo ${@%\.*} | sed "s/ /\n/g" | sort | uniq -D)" ]; then error 'Duplicate packages found!' @@ -270,8 +267,6 @@ getpkgfiles() { done echo ${@} - - shopt -u nullglob } check_pkgfile() { @@ -330,7 +325,7 @@ check_splitpkgs() { for pkgfile in ${pkgfiles[@]}; do issplitpkg "${pkgfile}" || continue local _pkgbase="$(getpkgbase ${pkgfile})" - msg2 "Checking $_pkgbase" + msg2 "Checking %s" "$_pkgbase" local _pkgname="$(getpkgname ${pkgfile})" local _pkgarch="$(getpkgarch ${pkgfile})" mkdir -p "${repo}/${_pkgarch}/${_pkgbase}" @@ -411,7 +406,7 @@ set_repo_permission() { local filesfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}" if [ -w "${dbfile}" ]; then - local group=$(stat --printf='%G' "$(dirname "${dbfile}")") + local group=$(/usr/bin/stat --printf='%G' "$(dirname "${dbfile}")") chgrp $group "${dbfile}" || error "Could not change group of ${dbfile} to $group" chgrp $group "${filesfile}" || error "Could not change group of ${filesfile} to $group" chmod g+w "${dbfile}" || error "Could not set write permission for group $group to ${dbfile}" @@ -428,9 +423,9 @@ arch_repo_add() { # package files might be relative to repo dir pushd "${FTP_BASE}/${repo}/os/${arch}" >/dev/null - repo-add -q "${repo}${DBEXT}" ${pkgs[@]} >/dev/null \ + /usr/bin/repo-add -q "${repo}${DBEXT}" ${pkgs[@]} >/dev/null \ || error "repo-add ${repo}${DBEXT} ${pkgs[@]}" - repo-add -f -q "${repo}${FILESEXT}" ${pkgs[@]} \ + /usr/bin/repo-add -f -q "${repo}${FILESEXT}" ${pkgs[@]} \ || error "repo-add -f ${repo}${FILESEXT} ${pkgs[@]}" popd >/dev/null set_repo_permission "${repo}" "${arch}" @@ -449,9 +444,9 @@ arch_repo_remove() { error "No database found at '${dbfile}'" return 1 fi - repo-remove -q "${dbfile}" ${pkgs[@]} >/dev/null \ + /usr/bin/repo-remove -q "${dbfile}" ${pkgs[@]} >/dev/null \ || error "repo-remove ${dbfile} ${pkgs[@]}" - repo-remove -q "${filesfile}" ${pkgs[@]} \ + /usr/bin/repo-remove -q "${filesfile}" ${pkgs[@]} \ || error "repo-remove ${filesfile} ${pkgs[@]}" set_repo_permission "${repo}" "${arch}" |