diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-04 23:48:38 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-04 23:48:38 -0500 |
commit | 6223f9fca6803d814ba026cb5b88c9c2ed48b540 (patch) | |
tree | 1fdec1424a55471032ac4edd5b08157b005720e3 /checkpkg.in | |
parent | 021653a0acecc8763e1bbe90dbb770b4e6df4390 (diff) | |
parent | 40ea1b3ca5c6f6fdbeda230f4048ac7934d68acf (diff) | |
download | devtools-6223f9fca6803d814ba026cb5b88c9c2ed48b540.tar.xz |
Merge branch 'devtools'
Conflicts:
checkpkg.in
lib/common.sh
makechrootpkg.in
Diffstat (limited to 'checkpkg.in')
-rw-r--r-- | checkpkg.in | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/checkpkg.in b/checkpkg.in index eb95745..81e7184 100644 --- a/checkpkg.in +++ b/checkpkg.in @@ -29,18 +29,12 @@ STARTDIR=$(pwd) TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX) for _pkgname in "${pkgname[@]}"; do - pkgfile=(${_pkgname}-$(get_full_version $_pkgname)-${CARCH}.pkg.tar?(.?z)) - if (( ${#pkgfile[*]} != 1 )); then - die 'Ambiguous package name: %s\n' "${pkgfile[*]}" + target_pkgver=$(get_full_version "$_pkgname") + if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then + die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver" fi - if [[ -f "$STARTDIR/$pkgfile" ]]; then - ln -s "$STARTDIR/$pkgfile" "$TEMPDIR/$pkgfile" - elif [[ -f "$PKGDEST/$pkgfile" ]]; then - ln -s "$PKGDEST/$pkgfile" "$TEMPDIR/$pkgfile" - else - die "File \"%s\" doesn't exist" "$pkgfile" - fi + ln -s "$pkgfile" "$TEMPDIR" pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname") @@ -54,28 +48,26 @@ for _pkgname in "${pkgname[@]}"; do die "The built package (%s) is the one in the repo right now!" "$_pkgname" fi - if [[ ! -f $oldpkg ]]; then - if [[ $pkgurl = file://* ]]; then - ln -s "${pkgurl#file://}" "${pkgurl##file://*/}" - elif [[ -f "$PKGDEST/$oldpkg" ]]; then - ln -s "$PKGDEST/$oldpkg" "$oldpkg" - elif [[ -f "$STARTDIR/$oldpkg" ]]; then - ln -s "$STARTDIR/$oldpkg" "$oldpkg" - else - curl -fsLC - --retry 3 --retry-delay 3 -o "$oldpkg" "$pkgurl" - fi + if [[ $pkgurl = file://* ]]; then + ln -s "${pkgurl#file://}" "$TEMPDIR/$oldpkg" + elif [[ -f "$PKGDEST/$oldpkg" ]]; then + ln -s "$PKGDEST/$oldpkg" "$TEMPDIR/$oldpkg" + elif [[ -f "$STARTDIR/$oldpkg" ]]; then + ln -s "$STARTDIR/$oldpkg" "$TEMPDIR/$oldpkg" + else + curl -fsLC - --retry 3 --retry-delay 3 -o "$TEMPDIR/$oldpkg" "$pkgurl" fi - bsdtar tf "$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old" + bsdtar tf "$TEMPDIR/$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old" bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname" sdiff -s "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname" 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)" + bsdtar -x -C "$TEMPDIR" -f "$pkgfile" #> /dev/null + comm -13 <(sort "$TEMPDIR/filelist-$_pkgname-old") <(sort "$TEMPDIR/filelist-$_pkgname") | grep .so$ | while read i; do + echo "${i}: " "$(objdump -p "$TEMPDIR/$i" | grep SONAME)" done else msg "No soname differences for %s." "$_pkgname" |