diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-02-21 16:54:10 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-02-21 16:54:10 +0100 |
commit | de0c93a652333b242e7ea282110619f25de7be8d (patch) | |
tree | 172a09b74679082c6655a78237107692b0a4c857 /db-move | |
parent | dea6954635ff0eccd116c384065c1ad745fcd1d2 (diff) | |
download | dbscripts-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-move')
-rwxr-xr-x | db-move | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -59,9 +59,7 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then for i in ${pkgname[@]}; do _pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT" - if [ ! -f "$ftppath_from/${_arch}/$_pkgfile" ]; then - die "error: package file '$_pkgfile' not found in repo '$repofrom'" - fi + getpkgfile "$ftppath_from/${_arch}/"$_pkgfile >/dev/null done if [ -d "$packagebase/repos/$svnrepo_to" ]; then @@ -101,13 +99,16 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then for i in ${pkgname[@]}; do _pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT" - /bin/cp "$ftppath_from/$architecture/$_pkgfile" . + _cpkgfile=$(getpkgfile "$ftppath_from/$architecture/"$_pkgfile) + [ $? -gt 0 ] && die + /bin/cp $_cpkgfile . /usr/bin/repo-add -q "$repoto$DBEXT" $_pkgfile || die "Error in repo-add $_pkgfile" done #use '*' to move the old DB too mv $repoto$DBEXT* $ftppath_to/$architecture for i in ${pkgname[@]}; do - _pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT" + _pkgfile=$(getpkgfile "$i-$pkgver-$pkgrel-$_arch"$PKGEXT) + [ $? -gt 0 ] && die if [ "${_arch}" == "any" ]; then mv ${_pkgfile} $ftppath_to/any ln -s ../any/${_pkgfile} $ftppath_to/$architecture/ |