summaryrefslogtreecommitdiff
path: root/commitpkg
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-03-03 21:41:53 +0100
committerPierre Schmitz <pierre@archlinux.de>2010-03-03 21:41:53 +0100
commita7c5010d24dd9388c3f6e829c01cf5d72b68d7fb (patch)
treed96b12618a7f44224452e8902ea85350ef8388b3 /commitpkg
parentf72775feaceed4d6c77e635978be5d0ada5954ef (diff)
Upload any pkg.tar.* file as long as it is canonical
Diffstat (limited to 'commitpkg')
-rwxr-xr-xcommitpkg20
1 files changed, 16 insertions, 4 deletions
diff --git a/commitpkg b/commitpkg
index 52ca2ac..8e1e72b 100755
--- a/commitpkg
+++ b/commitpkg
@@ -5,6 +5,17 @@ abort() {
exit 1
}
+getpkgfile() {
+ if [[ ${#} -ne 1 ]]; then
+ echo 'ERROR: No canonical package found!' >&2
+ exit 1
+ elif [ ! -f "${1}" ]; then
+ echo "ERROR: Package ${1} not found!" >&2
+ exit 1
+ fi
+
+ echo ${1}
+}
# Source makepkg.conf; fail if it is not found
if [ -r '/etc/makepkg.conf' ]; then
@@ -74,11 +85,12 @@ echo 'done'
for _arch in ${arch[@]}; do
for _pkgname in ${pkgname[@]}; do
- pkgfile=$_pkgname-$pkgver-$pkgrel-${_arch}$PKGEXT
+ pkgfile=$(getpkgfile "$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null)
+ pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null)
- if [ ! -f $pkgfile -a -f "$PKGDEST/$pkgfile" ]; then
- pkgfile="$PKGDEST/$pkgfile"
- elif [ ! -f $pkgfile ]; then
+ if [ ! -f "$pkgfile" -a -f "$pkgdestfile" ]; then
+ pkgfile="$pkgdestfile"
+ elif [ ! -f "$pkgfile" ]; then
echo "skipping ${_arch}"
continue 2
fi