mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: simplify epoch handling
We can avoid setting a default value for epoch since we intend to mean unset and "0" as the same thing. This is also a more consistent default as the display of epoch=0 is no epoch at all in the full package version. The extra paranoia in get_full_version can be removed due to lint_epoch guarding against non-integer values of epoch. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
03aa44a3ec
commit
bd746568f6
@ -866,7 +866,6 @@ update_pkgver() {
|
|||||||
fi
|
fi
|
||||||
@SEDINPLACE@ "s:^pkgrel=[^ ]*:pkgrel=1:" "$BUILDFILE"
|
@SEDINPLACE@ "s:^pkgrel=[^ ]*:pkgrel=1:" "$BUILDFILE"
|
||||||
source_safe "$BUILDFILE"
|
source_safe "$BUILDFILE"
|
||||||
epoch=${epoch:-0}
|
|
||||||
local fullver=$(get_full_version)
|
local fullver=$(get_full_version)
|
||||||
msg "$(gettext "Updated version: %s")" "$pkgbase $fullver"
|
msg "$(gettext "Updated version: %s")" "$pkgbase $fullver"
|
||||||
else
|
else
|
||||||
@ -888,7 +887,7 @@ missing_source_file() {
|
|||||||
# return : full version spec, including epoch (if necessary), pkgver, pkgrel
|
# return : full version spec, including epoch (if necessary), pkgver, pkgrel
|
||||||
##
|
##
|
||||||
get_full_version() {
|
get_full_version() {
|
||||||
if [[ $epoch ]] && (( epoch > 0 )); then
|
if (( epoch > 0 )); then
|
||||||
printf "%s\n" "$epoch:$pkgver-$pkgrel"
|
printf "%s\n" "$epoch:$pkgver-$pkgrel"
|
||||||
else
|
else
|
||||||
printf "%s\n" "$pkgver-$pkgrel"
|
printf "%s\n" "$pkgver-$pkgrel"
|
||||||
@ -3364,7 +3363,6 @@ fi
|
|||||||
|
|
||||||
# set defaults if they weren't specified in buildfile
|
# set defaults if they weren't specified in buildfile
|
||||||
pkgbase=${pkgbase:-${pkgname[0]}}
|
pkgbase=${pkgbase:-${pkgname[0]}}
|
||||||
epoch=${epoch:-0}
|
|
||||||
basever=$(get_full_version)
|
basever=$(get_full_version)
|
||||||
|
|
||||||
if [[ $BUILDDIR = "$startdir" ]]; then
|
if [[ $BUILDDIR = "$startdir" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user