summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-07-22 20:08:39 +1000
committerDan McGee <dan@archlinux.org>2011-07-27 12:45:18 -0500
commit03447ce39cd6a3adb7a56bb978368a5f11659374 (patch)
treecb977c9f81edaf9dd9280ea10d898f23629c49b2
parenta7940e7419a6fb39eeafb0bfd053b90a64946d5c (diff)
downloadpacman-03447ce39cd6a3adb7a56bb978368a5f11659374.tar.xz
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>
-rw-r--r--doc/PKGBUILD.5.txt2
-rw-r--r--proto/PKGBUILD-split.proto1
-rw-r--r--scripts/makepkg.sh.in17
3 files changed, 12 insertions, 8 deletions
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt
index d9cf6230..a66414c6 100644
--- a/doc/PKGBUILD.5.txt
+++ b/doc/PKGBUILD.5.txt
@@ -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`.
diff --git a/proto/PKGBUILD-split.proto b/proto/PKGBUILD-split.proto
index 52aacc54..763cb86c 100644
--- a/proto/PKGBUILD-split.proto
+++ b/proto/PKGBUILD-split.proto
@@ -43,6 +43,7 @@ package_pkg1() {
# options and directives that can be overridden
pkgver=
pkgrel=
+ epoch=
pkgdesc=""
arch=()
license=()
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