From 03447ce39cd6a3adb7a56bb978368a5f11659374 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Fri, 22 Jul 2011 20:08:39 +1000 Subject: makepkg: allow epoch to be overridden We can override pkgver and pkgrel so it is only logical to add epoch to that list Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 0dfbc5d5..b6f02a86 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -44,9 +44,9 @@ startdir="$PWD" packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge' 'upx') other_options=('ccache' 'distcc' 'buildflags' 'makeflags') -splitpkg_overrides=('pkgver' 'pkgrel' 'pkgdesc' 'arch' 'license' 'groups' \ - 'depends' 'optdepends' 'provides' 'conflicts' 'replaces' \ - 'backup' 'options' 'install' 'changelog') +splitpkg_overrides=('pkgver' 'pkgrel' 'epoch' 'pkgdesc' 'arch' 'license' \ + 'groups' 'depends' 'optdepends' 'provides' 'conflicts' \ + 'replaces' 'backup' 'options' 'install' 'changelog') readonly -a packaging_options other_options splitpkg_overrides # Options @@ -1360,10 +1360,13 @@ check_sanity() { fi done || ret=1 - if [[ ! $epoch =~ ^[0-9]*$ ]]; then - error "$(gettext "%s must be an integer.")" "epoch" - ret=1 - fi + awk -F'=' '/^[[:space:]]*epoch=/ { $1=""; print $0 }' "$BUILDFILE" | + while read i _; do + if [[ ! $i =~ ^[0-9]*$ ]]; then + error "$(gettext "%s must be an integer.")" "epoch" + return 1 + fi + done || ret=1 if [[ $arch != 'any' ]]; then if ! in_array $CARCH ${arch[@]}; then -- cgit v1.2.3-70-g09d2