FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-16-2012, 12:01 PM
Allan McRae
 
Default makepkg: check pkgver validity after updating

If a PKGBUILD has a pkgver() function, skip checking the pkgver validity
until it has been updated.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
scripts/makepkg.sh.in | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 8f14418..ed14577 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -547,6 +547,7 @@ download_sources() {

if declare -f pkgver >/dev/null && (( GET_VCS )); then
update_pkgver
+ check_pkgver || exit 1
fi

popd &>/dev/null
@@ -1782,7 +1783,7 @@ check_sanity() {
# check for no-no's in the build script
local i
local ret=0
- for i in 'pkgname' 'pkgrel' 'pkgver'; do
+ for i in 'pkgname' 'pkgrel'; do
if [[ -z ${!i} ]]; then
error "$(gettext "%s is not allowed to be empty.")" "$i"
ret=1
@@ -1806,14 +1807,9 @@ check_sanity() {
ret=1
fi

- awk -F'=' '$1 ~ /^[[:space:]]*pkgver$/' "$BUILDFILE" | sed "s/[[:space:]]*#.*//" |
- while IFS='=' read -r _ i; do
- eval i="$(sed 's/^(['"])(.*)1$/2/' <<< "${i%%+([[:space:]])}")"
- if [[ $i = *[[:space:]:-]* ]]; then
- error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
- return 1
- fi
- done || ret=1
+ if ! declare -f pkgver >/dev/null; then
+ check_pkgver || ret=1
+ fi

awk -F'=' '$1 ~ /^[[:space:]]*pkgrel$/' "$BUILDFILE" | sed "s/[[:space:]]*#.*//" |
while IFS='=' read -r _ i; do
@@ -1943,6 +1939,26 @@ check_sanity() {
return $ret
}

+check_pkgver() {
+ local ret=0
+
+ if [[ -z ${pkgver} ]]; then
+ error "$(gettext "%s is not allowed to be empty.")" "$i"
+ ret=1
+ fi
+
+ awk -F'=' '$1 ~ /^[[:space:]]*pkgver$/' "$BUILDFILE" | sed "s/[[:space:]]*#.*//" |
+ while IFS='=' read -r _ i; do
+ eval i="$(sed 's/^(['"])(.*)1$/2/' <<< "${i%%+([[:space:]])}")"
+ if [[ $i = *[[:space:]:-]* ]]; then
+ error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
+ return 1
+ fi
+ done || ret=1
+
+ return $ret
+}
+
check_software() {
# check for needed software
local ret=0
--
1.7.11.2
 

Thread Tools




All times are GMT. The time now is 07:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org