diff options
author | Florian Pritz <bluewind@server-speed.net> | 2011-03-20 15:53:16 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-03-23 19:03:10 +0100 |
commit | 3bc5f6b5c97165ed8fa1fad2cf63acba61185a44 (patch) | |
tree | 22b4ae2aa9108285d1d06b80fe8d65d35f4f60ee /commitpkg | |
parent | d1304a3f1d527801b7afa1c8498b2f2a8f28ecd8 (diff) | |
download | devtools32-3bc5f6b5c97165ed8fa1fad2cf63acba61185a44.tar.xz |
add epoch support
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'commitpkg')
-rwxr-xr-x | commitpkg | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -17,6 +17,19 @@ getpkgfile() { echo ${1} } +## +# usage : get_full_version( $epoch, $pkgver, $pkgrel ) +# return : full version spec, including epoch (if necessary), pkgver, pkgrel +## +get_full_version() { + if [[ $1 -eq 0 ]]; then + # zero epoch case, don't include it in version + echo $2-$3 + else + echo $1:$2-$3 + fi +} + # Source makepkg.conf; fail if it is not found if [ -r '/etc/makepkg.conf' ]; then source '/etc/makepkg.conf' @@ -108,8 +121,9 @@ echo 'done' for _arch in ${arch[@]}; do for _pkgname in ${pkgname[@]}; do - pkgfile=$(getpkgfile "$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null) - pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null) + fullver=$(get_full_version ${epoch:-0} $pkgver $pkgrel) + pkgfile=$(getpkgfile "$_pkgname-$fullver-${_arch}".pkg.tar.* 2>/dev/null) + pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$fullver-${_arch}".pkg.tar.* 2>/dev/null) if [ ! -f "$pkgfile" -a -f "$pkgdestfile" ]; then pkgfile="$pkgdestfile" |