index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <d@falconindy.com> | 2012-01-01 18:49:59 -0500 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-01-18 11:06:51 +0100 |
commit | 2d79191c97e8ee965bfea1feef03de26c839dc8a (patch) | |
tree | 2f5c6ad954564191a09160dc36b00143c4c82ddd | |
parent | 5b3ca82ae5934cf6625911d4c1d11c5fad63aa92 (diff) |
-rw-r--r-- | commitpkg.in | 29 |
diff --git a/commitpkg.in b/commitpkg.in index c298256..9cc4912 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -3,13 +3,19 @@ m4_include(lib/common.sh) getpkgfile() { - if [[ ${#} -ne 1 ]]; then - die 'No canonical package found!' - elif [[ ! -f $1 ]]; then - die "Package ${1} not found!" - fi + case $# in + 0) + error 'No canonical package found!' + return 1 + ;; + [!1]) + error 'Failed to canonicalize package name -- multiple packages found:' + msg2 '%s' "$@" + return 1 + ;; + esac - echo ${1} + echo "$1" } # Source makepkg.conf; fail if it is not found @@ -127,15 +133,10 @@ for _arch in ${arch[@]}; do for _pkgname in ${pkgname[@]}; do fullver=$(get_full_version $_pkgname) - pkgfile=$(getpkgfile "$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null) - pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null) - if [[ -f $pkgfile ]]; then - pkgfile="./$pkgfile" - elif [[ -f $pkgdestfile ]]; then - pkgfile="$pkgdestfile" - else - warning "Could not find ${pkgfile}. Skipping ${_arch}" + if ! pkgfile=$(shopt -s nullglob; + getpkgfile "${DESTDIR+$DESTDIR/}$_pkgname-$fullver-${_arch}".pkg.tar.?z); then + warning "Skipping $_pkgname-$fullver-$_arch: failed to locate package file" skip_arches+=($_arch) continue 2 fi |