1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-21 23:38:49 -05:00

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 <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2011-07-22 20:08:39 +10:00 committed by Dan McGee
parent a7940e7419
commit 03447ce39c
3 changed files with 12 additions and 8 deletions

View File

@ -314,7 +314,7 @@ Each split package uses a corresponding packaging function with name
All options and directives for the split packages default to the global values
given in the PKGBUILD. Nevertheless, the following ones can be overridden within
each split package's packaging function:
`pkgver`, `pkgrel`, `pkgdesc`, `arch`, `license`, `groups`, `depends`,
`pkgver`, `pkgrel`, `epoch`, `pkgdesc`, `arch`, `license`, `groups`, `depends`,
`optdepends`, `provides`, `conflicts`, `replaces`, `backup`, `options`,
`install` and `changelog`.

View File

@ -43,6 +43,7 @@ package_pkg1() {
# options and directives that can be overridden
pkgver=
pkgrel=
epoch=
pkgdesc=""
arch=()
license=()

View File

@ -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