summaryrefslogtreecommitdiffstats
path: root/pkgdb1
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2007-09-14 18:38:41 +0200
committerThomas Bächler <thomas@archlinux.org>2007-09-14 18:38:41 +0200
commita1d4355f6cae8275d4da6ee39f52095909cf11a0 (patch)
tree418cd69081e81ea1942df5bbb130eec96285d2f6 /pkgdb1
parentab3b5e0eac5c557843716ab44ba44e49603f5d65 (diff)
downloaddbscripts-a1d4355f6cae8275d4da6ee39f52095909cf11a0.tar.gz
dbscripts-a1d4355f6cae8275d4da6ee39f52095909cf11a0.tar.xz
adjusted scripts for pacman 3 naming scheme, should still work with the old one
Diffstat (limited to 'pkgdb1')
-rwxr-xr-xpkgdb119
1 files changed, 15 insertions, 4 deletions
diff --git a/pkgdb1 b/pkgdb1
index 5b2f09a..2c86ef8 100755
--- a/pkgdb1
+++ b/pkgdb1
@@ -1,5 +1,17 @@
#!/bin/bash
-# $Id: pkgdb1,v 1.4 2006/02/20 06:33:40 judd Exp $
+# $Id: pkgdb1,v 1.5 2007/09/14 16:38:41 thomas Exp $
+
+# 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%-*-*}
+}
STAGEDIR=`pwd`
@@ -16,9 +28,8 @@ fi
cd $STAGEDIR
for pkgfile in `ls $STAGEDIR/*.pkg.tar.gz`; do
- tmp=${pkgfile##*/}
- pkgname=${tmp%-*-*};
- fullname=${tmp%.pkg.tar.gz}
+ pkgname=$(getpkgname $pkgfile);
+ fullname=$(basename $pkgfile)
# find the matching PKGBUILD
tmpf=$(mktemp /tmp/pkgdb1.XXXXXXXXXX) || exit 1
find $ABSDIR -type d -name "$pkgname" >$tmpf