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 /pkgdb1 | |
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 'pkgdb1')
-rwxr-xr-x | pkgdb1 | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -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 |