Move geninteg block in makepkg before error checking

This patch 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@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2008-05-26 16:27:22 +10:00 committed by Dan McGee
parent 7313c8546a
commit c11bdf19b1

View file

@ -1203,8 +1203,7 @@ while true; do
done done
if [ "$HOLDVER" = "1" -a "$FORCE_VER" != "" ]; then if [ "$HOLDVER" = "1" -a "$FORCE_VER" != "" ]; then
# The extra '--' is here to prevent gettext from thinking --holdver is # The '\\0' is here to prevent gettext from thinking --holdver is an option
# an option
error "$(gettext "\\0--holdver and --forcever cannot both be specified" )" error "$(gettext "\\0--holdver and --forcever cannot both be specified" )"
exit 1 exit 1
fi fi
@ -1297,6 +1296,14 @@ fi
source "$BUILDSCRIPT" 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 # check for no-no's in the build script
if [ -z "$pkgname" ]; then if [ -z "$pkgname" ]; then
error "$(gettext "%s is not allowed to be empty.")" "pkgname" error "$(gettext "%s is not allowed to be empty.")" "pkgname"
@ -1368,7 +1375,7 @@ devel_check
devel_update devel_update
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
-a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" -a "$NOBUILD" = "0" ]; then -a "$FORCE" = "0" -a "$SOURCEONLY" = "0" -a "$NOBUILD" = "0" ]; then
if [ "$INSTALL" = "1" ]; then if [ "$INSTALL" = "1" ]; then
warning "$(gettext "A package has already been built, installing existing package...")" warning "$(gettext "A package has already been built, installing existing package...")"
install_package install_package
@ -1414,11 +1421,11 @@ if [ "$SOURCEONLY" != "0" ]; then
fi fi
# fix flyspray bug #5973 # 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 if [ "$NODEPS" = "1" ]; then
warning "$(gettext "Skipping dependency checks.")" warning "$(gettext "Skipping dependency checks.")"
fi 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 elif [ $(type -p pacman) ]; then
unset pkgdeps # Set by resolve_deps() and used by remove_deps() unset pkgdeps # Set by resolve_deps() and used by remove_deps()
deperr=0 deperr=0
@ -1444,12 +1451,6 @@ umask 0022
mkdir -p "$srcdir" mkdir -p "$srcdir"
cd "$srcdir" cd "$srcdir"
if [ "$GENINTEG" = "1" ]; then
download_sources
generate_checksums
exit 0 # $E_OK
fi
if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
warning "$(gettext "Skipping source retrieval -- using existing src/ tree")" warning "$(gettext "Skipping source retrieval -- using existing src/ tree")"
warning "$(gettext "Skipping source integrity checks -- using existing src/ tree")" warning "$(gettext "Skipping source integrity checks -- using existing src/ tree")"