From 4cadcec9f918e6a1058d1e3f1814505bd205c9d4 Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 26 Jan 2009 22:09:19 +0000 Subject: attempting to fix #56 git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@779 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/createpkg | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'trunk/src') diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 9b252f6..08280a4 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -266,6 +266,8 @@ function load_parameters { MOVE_BIN_PACKAGE="`eval_boolean_parameter MOVE_BIN_PACKAGE $off`" MOVE_SLACK_REQUIRED="`eval_boolean_parameter MOVE_SLACK_REQUIRED $off`" PACKAGES_REPOS_NOARCH="`eval_boolean_parameter PACKAGES_REPOS_NOARCH $on`" + FORCE_MANIFEST_CHECK="`eval_boolean_parameter FORCE_MANIFEST_CHECK $off`" + FORCE_MANIFEST_CHECK_SIGNATURE="`eval_boolean_parameter FORCE_MANIFEST_CHECK_SIGNATURE $off`" } @@ -600,6 +602,28 @@ function create_package { else FAKEROOT="" fi + + # Manifest checking + if [ $FORCE_MANIFEST_CHECK -eq $on ] || [ $FORCE_MANIFEST_CHECK_SIGNATURE -eq $on ]; then + if [ ! -e "`dirname $SCRIPT_NAME`/Manifest" ]; then + eecho $messag "$BASENAME: ERROR: no Manifest file for $PACKAGE." + return 1 + fi + fi + + # Manifest signature checking + if [ $FORCE_MANIFEST_CHECK_SIGNATURE -eq $on ]; then + if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" `dirname $SCRIPT_NAME`/Manifest; then + gpg --verify `dirname $SCRIPT_NAME`/Manifest &> /dev/null + if [ "$?" != "0" ]; then + eecho $messag "$BASENAME: ERROR: invalid signature for $PACKAGES's Manifest file." + return 1 + fi + else + eecho $messag "$BASENAME: ERROR: no signed Manifest file for $PACKAGE." + return 1 + fi + fi # Run SlackBuild script [ $DEBUG -eq $off ] && SHELL_FLAG="+x" || SHELL_FLAG="-x" @@ -754,7 +778,7 @@ function build_queue { # createpkg's build queue # usage: build_queue ... - local unable_to_install built=0 total=0 + local unable_to_install last_status built=0 total=0 if [ -z "$1" ]; then return @@ -762,20 +786,24 @@ function build_queue { for PACKAGE in $*; do create_package - if [ "$?" != "0" ]; then + last_status="$?" + let total++ + if [ "$last_status" != "0" ]; then unable_to_install="$unable_to_install\n\t`echo $PACKAGE | sed -e 's/\\\+/\+/'`" - let total++ else let built++ fi done - if [ ! -z "$unable_to_install" ]; then - eecho $messag "$BASENAME: done building $built of $total existing SlackBuilds." + if [ ! -z "$unable_to_install" ] && [[ $total > 1 ]]; then + eecho $messag "$BASENAME: done building $built of $total requested SlackBuilds." eecho $messag "$BASENAME: unable to create the following packages:" echo -e "$unable_to_install" fi + # Exit if last build package exit status + exit $last_status + } #--------------------------------------------------- -- cgit v1.2.3