Commit 97d4a8bb authored by Travis Willard's avatar Travis Willard Committed by Aaron Griffin
Browse files

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: default avatarTravis Willard <travis@archlinux.org>
Signed-off-by: default avatarAaron Griffin <aaronmgriffin@gmail.com>
parent 67485704
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -27,19 +27,18 @@ 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
if [ -f "$(pwd)/$pkgfile" ]; then
    pkgfile=$(pwd)/$pkgfile
elif [ -f "$PKGDEST/$pkgfile" ]; then
    pkgfile=$PKGDEST/$pkgfile
		oldstylepkgfile=$PKGDEST/$oldstylepkgfile
	elif [ -f $oldstylepkgfile ]; then
		pkgfile=$oldstylepkgfile
	elif [ -f $PKGDEST/$oldstylepkgfile ]; then
elif [ -f "$(pwd)/$oldstylepkgfile" ]; then
    pkgfile=$(pwd)/$oldstylepkgfile
elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
    pkgfile=$PKGDEST/$oldstylepkgfile
else
		echo "File $pkgfile doesn't exist"
    echo "File \"$pkgfile\" doesn't exist"
    exit 1
fi
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