summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-07-04 22:51:46 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-07-04 22:51:46 -0400
commitb85f896c2cb614ac22b11c14bd9e7994773309eb (patch)
treeaac6a40a088a99781ee34e5bf4525be0903ec7da
parente029bd5f834a5973ba3be45fd06eed911f26477b (diff)
Fix having a flexible PKGEXT
-rw-r--r--config2
-rwxr-xr-xdb-update15
2 files changed, 10 insertions, 7 deletions
diff --git a/config b/config
index 75e88cb..f4c1e15 100644
--- a/config
+++ b/config
@@ -47,7 +47,7 @@ OURARCHES=(mips64el)
ARCHES=(${ARCHARCHES[@]} ${OURARCHES[@]})
DBEXT=".db.tar.gz"
FILESEXT=".files.tar.gz"
-PKGEXT=".pkg.tar.xz"
+PKGEXT=".pkg.tar.?z"
SRCEXT=".src.tar.gz"
MAKEPKGCONF="~/.makepkg.conf"
diff --git a/db-update b/db-update
index a0a3e39..3c06f63 100755
--- a/db-update
+++ b/db-update
@@ -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##*/}"
@@ -95,10 +98,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)