[pacman-dev] [PATCH] Move geninteg block in makepkg before error checking

Allan McRae mcrae_allan at hotmail.com
Mon May 26 02:27:22 EDT 2008


This pactch moves the generating of integrity checks to before any
error checking takes place in the PKGBUILD file.  This allows integrity
generation to complete when unrelated errors exist in a PKGBUILD file
and allows the removal of multiple checks of the GENINTEG variable that
would otherwise be needed.

In addition a minor fix is made to a comment

Signed-off-by: Allan McRae <mcrae_allan at hotmail.com>
---
 scripts/makepkg.sh.in |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index cc44c68..38b22a5 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1187,8 +1187,7 @@ while true; do
 done
 
 if [ "$HOLDVER" = "1" -a "$FORCE_VER" != "" ]; then
-	# The extra '--' is here to prevent gettext from thinking --holdver is
-	# an option
+	# The '\\0' is here to prevent gettext from thinking --holdver is an option
 	error "$(gettext "\\0--holdver and --forcever cannot both be specified" )"
 	exit 1
 fi
@@ -1288,6 +1287,14 @@ fi
 
 source "$BUILDSCRIPT"
 
+if [ "$GENINTEG" = "1" ]; then
+	mkdir -p "$srcdir"
+	cd "$srcdir"
+	download_sources
+	generate_checksums
+	exit 0 # $E_OK
+fi
+
 # check for no-no's in the build script
 if [ -z "$pkgname" ]; then
 	error "$(gettext "%s is not allowed to be empty.")" "pkgname"
@@ -1340,7 +1347,7 @@ devel_check
 devel_update
 
 if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
-     -a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" ]; then
+     -a "$FORCE" = "0" -a "$SOURCEONLY" = "0" ]; then
 	if [ "$INSTALL" = "1" ]; then
 		warning "$(gettext "A package has already been built, installing existing package...")"
 		install_package
@@ -1386,11 +1393,11 @@ if [ "$SOURCEONLY" = "1" ]; then
 fi
 
 # fix flyspray bug #5973
-if [ "$NODEPS" = "1" -o "$GENINTEG" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" ]; then
+if [ "$NODEPS" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" ]; then
 	if [ "$NODEPS" = "1" ]; then
 		warning "$(gettext "Skipping dependency checks.")"
 	fi
-	# skip printing a warning message for the others: geninteg, nobuild, repkg
+	# skip printing a warning message for the others: nobuild, repkg
 elif [ $(type -p pacman) ]; then
 	unset pkgdeps # Set by resolve_deps() and used by remove_deps()
 	deperr=0
@@ -1416,12 +1423,6 @@ umask 0022
 mkdir -p "$srcdir"
 cd "$srcdir"
 
-if [ "$GENINTEG" = "1" ]; then
-	download_sources
-	generate_checksums
-	exit 0 # $E_OK
-fi
-
 if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
 	warning "$(gettext "Skipping source retrieval        -- using existing src/ tree")"
 	warning "$(gettext "Skipping source integrity checks -- using existing src/ tree")"
-- 
1.5.5.1





More information about the pacman-dev mailing list