diff options
author | Thomas Bächler <thomas@archlinux.org> | 2007-09-14 18:38:41 +0200 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2007-09-14 18:38:41 +0200 |
commit | a1d4355f6cae8275d4da6ee39f52095909cf11a0 (patch) | |
tree | 418cd69081e81ea1942df5bbb130eec96285d2f6 /genpkglist | |
parent | ab3b5e0eac5c557843716ab44ba44e49603f5d65 (diff) | |
download | dbscripts-a1d4355f6cae8275d4da6ee39f52095909cf11a0.tar.gz dbscripts-a1d4355f6cae8275d4da6ee39f52095909cf11a0.tar.xz |
adjusted scripts for pacman 3 naming scheme, should still work with the old one
Diffstat (limited to 'genpkglist')
-rwxr-xr-x | genpkglist | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -1,5 +1,5 @@ #!/bin/bash -# $Id: genpkglist,v 1.14 2006/05/05 01:38:33 judd Exp $ +# $Id: genpkglist,v 1.15 2007/09/14 16:38:41 thomas Exp $ # # genpkglist @@ -8,8 +8,21 @@ # (also used to check for missing packages in the download directory) # +# Get the package name from the filename +# hackish, but should work for now +getpkgname() { + local tmp + + tmp=${1##*/} + tmp=${tmp%.pkg.tar.gz} + tmp=${tmp%-i686} + tmp=${tmp%-x86_64} + echo ${tmp%-*-*} +} + pkgfile="`pwd`/packages.txt" ftppath=$1 +dbarch=$2 rm -f $pkgfile for category in `find * -maxdepth 0 -type d | grep -v CVS`; do @@ -20,8 +33,10 @@ for category in `find * -maxdepth 0 -type d | grep -v CVS`; do . PKGBUILD if [ -f $ftppath/$pkgname-$pkgver-$pkgrel.pkg.tar.gz ]; then echo "$category/$pkgname-$pkgver-$pkgrel.pkg.tar.gz" >>$pkgfile + elif [ -f $ftppath/$pkgname-$pkgver-$pkgrel-$dbarch.pkg.tar.gz ]; then + echo "$category/$pkgname-$pkgver-$pkgrel-$dbarch.pkg.tar.gz" >>$pkgfile else - echo "notice: Missing $pkgname-$pkgver-$pkgrel.pkg.tar.gz in ftp site" >&2 + echo "notice: Missing $pkgname-$pkgver-$pkgrel-$dbarch.pkg.tar.gz in ftp site" >&2 fi fi cd .. @@ -32,7 +47,7 @@ done cd $ftppath unset DUPES DUPEFILES last for pkg in *.pkg.tar.gz; do - pkgname=${pkg%-*-*} + pkgname=$(getpkgname $pkg) if [ "$last" = "$pkgname" ]; then DUPES="$DUPES $pkgname" DUPEFILES="$DUPEFILES $pkg" |