From a1d4355f6cae8275d4da6ee39f52095909cf11a0 Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Fri, 14 Sep 2007 16:38:41 +0000 Subject: adjusted scripts for pacman 3 naming scheme, should still work with the old one --- pkgdb1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'pkgdb1') 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 -- cgit v1.2.3-54-g00ecf