summaryrefslogtreecommitdiff
path: root/checkpkg.in
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-09-26 16:23:32 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-09-26 16:23:32 -0400
commit67bcecbbe42c727936d825363fbd1e2173bab574 (patch)
tree4443427102b172f3963f98a6e32c76e7b1da4b1a /checkpkg.in
parent46e8d5b656945179d7dc79c6d5c93034f1495367 (diff)
parent9c85d116f0425817b4a631e7a693dc5c948e2470 (diff)
Merge branch 'devtools' (early part)
Conflicts: arch-nspawn.in This effectively reverts my machine_name patch; I took a simpler route to dealing with a working_dir with funny characters in it, using a different scheme for the machine_name. This fixes the problems devtools' original scheme had, so I'm going back to that.
Diffstat (limited to 'checkpkg.in')
-rw-r--r--checkpkg.in32
1 files changed, 17 insertions, 15 deletions
diff --git a/checkpkg.in b/checkpkg.in
index 2cceafa..eb95745 100644
--- a/checkpkg.in
+++ b/checkpkg.in
@@ -1,5 +1,7 @@
#!/bin/bash
+shopt -s extglob
+
m4_include(lib/common.sh)
# Source makepkg.conf; fail if it is not found
@@ -18,22 +20,24 @@ if [[ ! -f PKGBUILD ]]; then
die 'This must be run in the directory of a built package.'
fi
-. PKGBUILD
+. ./PKGBUILD
if [[ $arch == 'any' ]]; then
CARCH='any'
fi
STARTDIR=$(pwd)
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
-cd "$TEMPDIR"
for _pkgname in "${pkgname[@]}"; do
- pkgfile=${_pkgname}-$(get_full_version $_pkgname)-${CARCH}${PKGEXT}
+ pkgfile=(${_pkgname}-$(get_full_version $_pkgname)-${CARCH}.pkg.tar?(.?z))
+ if (( ${#pkgfile[*]} != 1 )); then
+ die 'Ambiguous package name: %s\n' "${pkgfile[*]}"
+ fi
if [[ -f "$STARTDIR/$pkgfile" ]]; then
- ln -s "$STARTDIR/$pkgfile" "$pkgfile"
+ ln -s "$STARTDIR/$pkgfile" "$TEMPDIR/$pkgfile"
elif [[ -f "$PKGDEST/$pkgfile" ]]; then
- ln -s "$PKGDEST/$pkgfile" "$pkgfile"
+ ln -s "$PKGDEST/$pkgfile" "$TEMPDIR/$pkgfile"
else
die "File \"%s\" doesn't exist" "$pkgfile"
fi
@@ -58,23 +62,21 @@ for _pkgname in "${pkgname[@]}"; do
elif [[ -f "$STARTDIR/$oldpkg" ]]; then
ln -s "$STARTDIR/$oldpkg" "$oldpkg"
else
- curl -fsLC - --retry 3 --retry-delay 3 -o "$oldpkg" "$pkgurl"
+ curl -fsLC - --retry 3 --retry-delay 3 -o "$oldpkg" "$pkgurl"
fi
fi
- bsdtar tf "$oldpkg" | sort > "filelist-$_pkgname-old"
- bsdtar tf "$pkgfile" | sort > "filelist-$_pkgname"
+ bsdtar tf "$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old"
+ bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname"
- sdiff -s "filelist-$_pkgname-old" "filelist-$_pkgname"
+ sdiff -s "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname"
- if diff "filelist-$_pkgname-old" "filelist-$_pkgname" | grep '\.so' > /dev/null 2>&1; then
- mkdir -p pkg
- cd pkg
- bsdtar xf ../"$pkgfile" > /dev/null
- diff "../filelist-$_pkgname-old" "../filelist-$_pkgname" | awk '/>.*\.so/{$1 = ""; print $0}' | while read i; do
+ if diff "$TEMPDIR/filelist-$_pkgname"{-old,} | grep '\.so' &>/dev/null; then
+ mkdir -p "$TEMPDIR/pkg"
+ bsdtar -C "$TEMPDIR" xf ../"$pkgfile" #> /dev/null
+ diff "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname" | awk '/>.*\.so/{$1 = ""; print $0}' | while read i; do
echo "${i}: " "$(objdump -p "$i" | grep SONAME)"
done
- cd ..
else
msg "No soname differences for %s." "$_pkgname"
fi