aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/createpkg
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src/createpkg')
-rw-r--r--trunk/src/createpkg38
1 files changed, 33 insertions, 5 deletions
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 <package1> ... <packageN>
- 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
+
}
#---------------------------------------------------