diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-05-17 18:30:48 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-05-17 18:30:48 -0400 |
commit | 2c55a421d8a431faea07e678dc1f52634355ea65 (patch) | |
tree | b60a38a591603a6a09b5f2beba3853fe078c6bc4 /db-update | |
parent | b4ddeae83daca2e29d9b978abd50f49d2e6692ef (diff) | |
parent | dd63290fd4c15b6220ade6ef4d6f8f0e4878944e (diff) |
Merge branch 'master' into lukeshu/xbs
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -3,7 +3,10 @@ . "$(dirname "$(readlink -e "$0")")/config" . "$(dirname "$(readlink -e "$0")")/db-functions" -shopt -s nullglob +if [[ $STAGING = *luke* ]]; then + set -x + PKGEXT='.pkg.tar.?z' +fi if [ $# -ge 1 ]; then warning "Calling %s with a specific repository is no longer supported" "${0##*/}" @@ -32,11 +35,11 @@ done # check if packages are valid for repo in "${repos[@]}"; do + if ! check_repo_permission "${repo}"; then + die "You don't have permission to update packages in %s" "${repo}" + fi pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT})) if [ $? -eq 0 ]; then - if [ ${#pkgs[@]} -gt 0 ] && ! check_repo_permission "${repo}"; then - die "You don't have permission to update packages in %s" "${repo}" - fi for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then die "Package %s is a symbolic link" "${repo}/${pkg##*/}" @@ -100,10 +103,10 @@ done cd "${STAGING}" while read -r file; do pub="${FTP_BASE}/${file}" - if [[ -f $pub ]]; then + if [[ -f "$pub" ]]; then warning "file already exists: %s" "${file}" else mkdir -p -- "${pub%/*}" mv -vn "$file" "$pub" fi -done < <(find other sources -type f) +done < <(find other sources -type f 2>/dev/null) |