From 97d4a8bbd02c6813a6ef03ac9e8c2c48d68015a3 Mon Sep 17 00:00:00 2001 From: Travis Willard Date: Sun, 13 Jan 2008 15:07:35 -0500 Subject: Ensure pkgurl is always fully-qualified pathname in checkpkg. This keeps the pkgurl variable consistently fully-qualified, so that whenever we use that variable we know it points straight at the package file. Signed-off-by: Travis Willard Signed-off-by: Aaron Griffin --- checkpkg | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/checkpkg b/checkpkg index 2cffa78..d132e0c 100755 --- a/checkpkg +++ b/checkpkg @@ -27,18 +27,17 @@ source PKGBUILD pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz -if [ ! -f $pkgfile ]; then - if [ -f $PKGDEST/$pkgfile ]; then - pkgfile=$PKGDEST/$pkgfile - oldstylepkgfile=$PKGDEST/$oldstylepkgfile - elif [ -f $oldstylepkgfile ]; then - pkgfile=$oldstylepkgfile - elif [ -f $PKGDEST/$oldstylepkgfile ]; then - pkgfile=$PKGDEST/$oldstylepkgfile - else - echo "File $pkgfile doesn't exist" - exit 1 - fi +if [ -f "$(pwd)/$pkgfile" ]; then + pkgfile=$(pwd)/$pkgfile +elif [ -f "$PKGDEST/$pkgfile" ]; then + pkgfile=$PKGDEST/$pkgfile +elif [ -f "$(pwd)/$oldstylepkgfile" ]; then + pkgfile=$(pwd)/$oldstylepkgfile +elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then + pkgfile=$PKGDEST/$oldstylepkgfile +else + echo "File \"$pkgfile\" doesn't exist" + exit 1 fi tmp=`pacman -Spd --noconfirm $pkgname` @@ -52,7 +51,7 @@ pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev` oldpkg=`strip_url $pkgurl` -if [ "$oldpkg" = "$pkgfile" ]; then +if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then echo "The built package is the one in the repo right now!" exit 1 fi @@ -66,7 +65,7 @@ if [ ! -f $oldpkg ]; then fi tar tzf $oldpkg > filelist-old -tar tzf $pkgfile > filelist +tar tzf "$pkgfile" > filelist sort -o filelist filelist sort -o filelist-old filelist-old @@ -76,7 +75,7 @@ diff filelist-old filelist if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then mkdir -p pkg cd pkg - tar xzf ../$pkgfile > /dev/null + tar xzf "$pkgfile" > /dev/null for i in `diff ../filelist-old ../filelist | grep \> | grep \.so\. | awk '{print $2}'`; do echo -n "${i}: " objdump -p $i | grep SONAME -- cgit v1.2.3-54-g00ecf