summaryrefslogtreecommitdiffstats
path: root/db-update
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-02-21 16:54:10 +0100
committerPierre Schmitz <pierre@archlinux.de>2010-02-21 16:54:10 +0100
commitde0c93a652333b242e7ea282110619f25de7be8d (patch)
tree172a09b74679082c6655a78237107692b0a4c857 /db-update
parentdea6954635ff0eccd116c384065c1ad745fcd1d2 (diff)
downloaddbscripts-de0c93a652333b242e7ea282110619f25de7be8d.tar.gz
dbscripts-de0c93a652333b242e7ea282110619f25de7be8d.tar.xz
Accept any *.pkg.tar.* package file name
With this patch packages with different compressions are accepted. It is ensured that one cannot have the same package with different compression extensions. The new functions getpkgfile{,s} are used to sanitize globed filenames. Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'db-update')
-rwxr-xr-xdb-update12
1 files changed, 6 insertions, 6 deletions
diff --git a/db-update b/db-update
index 17d3b71..0973bf3 100755
--- a/db-update
+++ b/db-update
@@ -89,7 +89,7 @@ done
# Process architecture-independent packages first.
if [ -d "$stagedir" ]; then
- ANYPKGS="$(/bin/ls $stagedir/*-any$PKGEXT 2>/dev/null)"
+ ANYPKGS="$(getpkgfiles $stagedir/*-any$PKGEXT 2>/dev/null)"
fi
mkdir -p $WORKDIR
@@ -115,7 +115,7 @@ if [ -n "$ANYPKGS" ]; then
/usr/bin/svn up -q $_pkgbase
if [ -d "$_pkgbase/repos/$svnrepo" ]; then
. "$_pkgbase/repos/$svnrepo/$BUILDSCRIPT"
- if [ "$_pkgfile" = "$_pkgname-$pkgver-$pkgrel-any$PKGEXT" ]; then
+ if echo "$_pkgfile" | grep -q "$_pkgname-$pkgver-$pkgrel-any"; then
to_add_any="$to_add_any $pkg"
else
echo " WARNING: $_pkgfile does not match $BUILDSCRIPT in $svnrepo"
@@ -155,7 +155,7 @@ for current_arch in ${ARCHES[@]}; do
to_add=""
if [ -d "$stagedir" ]; then
- ADDPKGS="$(/bin/ls $stagedir/*-${current_arch}$PKGEXT 2>/dev/null)"
+ ADDPKGS="$(getpkgfiles $stagedir/*-${current_arch}$PKGEXT 2>/dev/null)"
fi
if [ -n "$ADDPKGS" -o -n "$ANYPKGS" ]; then
@@ -186,7 +186,7 @@ for current_arch in ${ARCHES[@]}; do
/usr/bin/svn up -q $_pkgbase
if [ -d "$_pkgbase/repos/$svnrepo" ]; then
. "$_pkgbase/repos/$svnrepo/$BUILDSCRIPT"
- if [ "$_pkgfile" = "$_pkgname-$pkgver-$pkgrel-$current_arch$PKGEXT" ]; then
+ if echo "$_pkgfile" | grep -q "$_pkgname-$pkgver-$pkgrel-$current_arch"; then
to_add="$to_add $pkg"
else
echo " WARNING: $_pkgfile does not match $BUILDSCRIPT in $svnrepo"
@@ -216,7 +216,7 @@ for current_arch in ${ARCHES[@]}; do
# if non empty, move all build dirs
if [ $(/bin/ls "$WORKDIR/build/" 2>/dev/null | wc -l) != 0 ]; then
- if [ $(/bin/ls "$WORKDIR/build/"*-$current_arch$PKGEXT 2>/dev/null | wc -l) != 0 ]; then
+ if [ $(getpkgfiles "$WORKDIR/build/"*-$current_arch$PKGEXT 2>/dev/null | wc -l) != 0 ]; then
echo "Copying new files to '$ftppath'"
for f in "$WORKDIR/build/"*-$current_arch$PKGEXT; do
if ! /bin/cp "$f" "$ftppath/"; then
@@ -224,7 +224,7 @@ for current_arch in ${ARCHES[@]}; do
fi
done
fi
- if [ $(/bin/ls "$WORKDIR/build/"*-any$PKGEXT 2>/dev/null | wc -l) != 0 ]; then
+ if [ $(getpkgfiles "$WORKDIR/build/"*-any$PKGEXT 2>/dev/null | wc -l) != 0 ]; then
echo "Copying new files to '$ftppath_any' and symlinking"
for f in "$WORKDIR/build/"*-any$PKGEXT; do
if ! /bin/cp "$f" "$ftppath_any"; then