checkpkg: Added split package support

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
Eric Bélanger 2009-10-22 03:03:51 -04:00 committed by Aaron Griffin
parent db962d9b7c
commit 40791b305f
1 changed files with 44 additions and 41 deletions

View File

@ -26,64 +26,67 @@ source PKGBUILD
if [ "$arch" == "any" ]; then if [ "$arch" == "any" ]; then
CARCH="any" CARCH="any"
fi fi
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}${PKGEXT}
if [ -f "$(pwd)/$pkgfile" ]; then for _pkgname in ${pkgname[@]}; do
pkgfile=$(pwd)/$pkgfile pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
elif [ -f "$PKGDEST/$pkgfile" ]; then oldstylepkgfile=${_pkgname}-${pkgver}-${pkgrel}${PKGEXT}
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` if [ -f "$(pwd)/$pkgfile" ]; then
pkgfile=$(pwd)/$pkgfile
if [ $? -ne 0 ]; then elif [ -f "$PKGDEST/$pkgfile" ]; then
echo "Couldn't download previous package." 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 exit 1
fi fi
pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev` tmp=`pacman -Spd --noconfirm $_pkgname`
oldpkg=`strip_url $pkgurl` if [ $? -ne 0 ]; then
echo "Couldn't download previous package for $_pkgname."
if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package is the one in the repo right now!"
exit 1 exit 1
fi fi
if [ ! -f $oldpkg ]; then pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev`
oldpkg=`strip_url $pkgurl`
if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package ($_pkgname) is the one in the repo right now!"
exit 1
fi
if [ ! -f $oldpkg ]; then
if echo $pkgurl | grep "^file:///" > /dev/null 2>&1; then if echo $pkgurl | grep "^file:///" > /dev/null 2>&1; then
cp `echo $pkgurl | sed 's#^file://##'` . cp `echo $pkgurl | sed 's#^file://##'` .
else else
wget $pkgurl wget $pkgurl
fi fi
fi fi
bsdtar tf $oldpkg > filelist-old bsdtar tf $oldpkg > filelist-$_pkgname-old
bsdtar tf "$pkgfile" > filelist bsdtar tf "$pkgfile" > filelist-$_pkgname
sort -o filelist filelist sort -o filelist-$_pkgname filelist-$_pkgname
sort -o filelist-old filelist-old sort -o filelist-$_pkgname-old filelist-$_pkgname-old
diff filelist-old filelist diff filelist-$_pkgname-old filelist-$_pkgname
if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then if diff filelist-$_pkgname-old filelist-$_pkgname | grep '\.so\.' > /dev/null 2>&1; then
mkdir -p pkg mkdir -p pkg
cd pkg cd pkg
bsdtar xf "$pkgfile" > /dev/null bsdtar xf "$pkgfile" > /dev/null
for i in `diff ../filelist-old ../filelist | grep \> | grep \.so\. | awk '{print $2}'`; do for i in `diff ../filelist-$_pkgname-old ../filelist-$_pkgname | grep \> | grep \.so\. | awk '{print $2}'`; do
echo -n "${i}: " echo -n "${i}: "
objdump -p $i | grep SONAME objdump -p $i | grep SONAME
done done
else else
echo "No filename differences" echo "No filename differences for $_pkgname."
fi fi
done
# vim:ft=sh:ts=4:sw=4:et: # vim:ft=sh:ts=4:sw=4:et: