2004-06-24 22:02:28 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2011-11-01 15:33:08 +01:00
|
|
|
m4_include(lib/common.sh)
|
|
|
|
|
2008-01-13 20:53:29 +01:00
|
|
|
# Source makepkg.conf; fail if it is not found
|
2011-08-24 10:18:24 +02:00
|
|
|
if [[ -r '/etc/makepkg.conf' ]]; then
|
2010-02-13 19:47:16 +01:00
|
|
|
source '/etc/makepkg.conf'
|
2008-01-13 20:53:29 +01:00
|
|
|
else
|
2011-11-01 15:33:08 +01:00
|
|
|
die '/etc/makepkg.conf not found!'
|
2008-01-13 20:53:29 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Source user-specific makepkg.conf overrides
|
2011-08-24 10:18:24 +02:00
|
|
|
if [[ -r ~/.makepkg.conf ]]; then
|
2008-01-13 20:53:29 +01:00
|
|
|
source ~/.makepkg.conf
|
|
|
|
fi
|
2007-10-02 06:05:18 +02:00
|
|
|
|
2011-08-24 10:18:24 +02:00
|
|
|
if [[ ! -f PKGBUILD ]]; then
|
2011-11-01 15:33:08 +01:00
|
|
|
die 'This must be run in the directory of a built package.'
|
2004-06-24 22:32:57 +02:00
|
|
|
fi
|
|
|
|
|
2010-02-13 19:47:16 +01:00
|
|
|
. PKGBUILD
|
2011-08-24 10:18:24 +02:00
|
|
|
if [[ $arch == 'any' ]]; then
|
2010-02-13 19:47:16 +01:00
|
|
|
CARCH='any'
|
2009-10-06 18:18:02 +02:00
|
|
|
fi
|
2004-06-24 22:32:57 +02:00
|
|
|
|
2010-08-17 14:51:12 +02:00
|
|
|
STARTDIR=$(pwd)
|
2011-10-13 11:03:35 +02:00
|
|
|
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
|
2011-08-24 10:18:24 +02:00
|
|
|
cd "$TEMPDIR"
|
2010-07-11 13:45:51 +02:00
|
|
|
|
2011-08-24 10:18:24 +02:00
|
|
|
for _pkgname in "${pkgname[@]}"; do
|
2011-11-01 15:33:08 +01:00
|
|
|
pkgfile=${_pkgname}-$(get_full_version $_pkgname)-${CARCH}${PKGEXT}
|
2010-02-13 19:47:16 +01:00
|
|
|
|
2011-08-24 10:18:24 +02:00
|
|
|
if [[ -f "$STARTDIR/$pkgfile" ]]; then
|
2011-08-08 21:16:23 +02:00
|
|
|
ln -s "$STARTDIR/$pkgfile" "$pkgfile"
|
2011-08-24 10:18:24 +02:00
|
|
|
elif [[ -f "$PKGDEST/$pkgfile" ]]; then
|
2011-08-08 21:16:23 +02:00
|
|
|
ln -s "$PKGDEST/$pkgfile" "$pkgfile"
|
2010-02-13 19:47:16 +01:00
|
|
|
else
|
2011-11-01 15:33:08 +01:00
|
|
|
die "File \"$pkgfile\" doesn't exist"
|
2010-02-13 19:47:16 +01:00
|
|
|
fi
|
2009-10-22 09:03:51 +02:00
|
|
|
|
2011-08-24 10:18:25 +02:00
|
|
|
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname")
|
2004-07-19 07:43:20 +02:00
|
|
|
|
2011-08-24 10:18:24 +02:00
|
|
|
if [[ $? -ne 0 ]]; then
|
2011-11-01 15:33:08 +01:00
|
|
|
die "Couldn't download previous package for $_pkgname."
|
2010-02-13 19:47:16 +01:00
|
|
|
fi
|
2004-07-19 07:43:20 +02:00
|
|
|
|
2011-08-24 10:18:25 +02:00
|
|
|
oldpkg=${pkgurl##*://*/}
|
2004-06-24 22:32:57 +02:00
|
|
|
|
2011-08-24 10:18:26 +02:00
|
|
|
if [[ ${oldpkg##*/} = ${pkgfile##*/} ]]; then
|
2011-11-01 15:33:08 +01:00
|
|
|
die "The built package ($_pkgname) is the one in the repo right now!"
|
2010-02-13 19:47:16 +01:00
|
|
|
fi
|
|
|
|
|
2011-08-24 10:18:24 +02:00
|
|
|
if [[ ! -f $oldpkg ]]; then
|
2011-08-24 10:18:26 +02:00
|
|
|
if [[ $pkgurl = file://* ]]; then
|
|
|
|
ln -s "${pkgurl#file://}" "${pkgurl##file://*/}"
|
2011-08-24 10:18:24 +02:00
|
|
|
elif [[ -f "$PKGDEST/$oldpkg" ]]; then
|
2011-08-08 21:16:23 +02:00
|
|
|
ln -s "$PKGDEST/$oldpkg" "$oldpkg"
|
2011-08-24 10:18:24 +02:00
|
|
|
elif [[ -f "$STARTDIR/$oldpkg" ]]; then
|
2011-08-08 21:16:23 +02:00
|
|
|
ln -s "$STARTDIR/$oldpkg" "$oldpkg"
|
2010-02-13 19:47:16 +01:00
|
|
|
else
|
2011-08-24 10:18:24 +02:00
|
|
|
wget --quiet "$pkgurl"
|
2010-02-13 19:47:16 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2011-08-24 10:18:28 +02:00
|
|
|
bsdtar tf "$oldpkg" | sort > "filelist-$_pkgname-old"
|
|
|
|
bsdtar tf "$pkgfile" | sort > "filelist-$_pkgname"
|
2010-02-13 19:47:16 +01:00
|
|
|
|
2011-08-24 10:18:24 +02:00
|
|
|
sdiff -s "filelist-$_pkgname-old" "filelist-$_pkgname"
|
2004-06-24 23:10:02 +02:00
|
|
|
|
2011-08-24 10:18:24 +02:00
|
|
|
if diff "filelist-$_pkgname-old" "filelist-$_pkgname" | grep '\.so' > /dev/null 2>&1; then
|
2010-02-13 19:47:16 +01:00
|
|
|
mkdir -p pkg
|
|
|
|
cd pkg
|
2010-09-06 17:24:33 +02:00
|
|
|
bsdtar xf ../"$pkgfile" > /dev/null
|
2011-08-24 10:18:27 +02:00
|
|
|
diff "../filelist-$_pkgname-old" "../filelist-$_pkgname" | awk '/>.*\.so/{$1 = ""; print $0}' | while read i; do
|
2011-08-24 10:18:24 +02:00
|
|
|
echo "${i}: " "$(objdump -p "$i" | grep SONAME)"
|
2010-02-13 19:47:16 +01:00
|
|
|
done
|
2010-12-19 10:03:06 +01:00
|
|
|
cd ..
|
2005-02-24 05:32:43 +01:00
|
|
|
else
|
2011-11-01 15:33:08 +01:00
|
|
|
msg "No soname differences for $_pkgname."
|
2005-02-24 05:32:43 +01:00
|
|
|
fi
|
2009-10-22 09:03:51 +02:00
|
|
|
done
|
2010-07-11 13:45:51 +02:00
|
|
|
|
2011-11-01 15:33:08 +01:00
|
|
|
msg "Files saved to $TEMPDIR"
|