aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/createpkg
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-01-26 22:09:19 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-01-26 22:09:19 +0000
commit4cadcec9f918e6a1058d1e3f1814505bd205c9d4 (patch)
tree4acd4332c2ba318fa256f4b38e6dae87847a3e6d /trunk/src/createpkg
parentd16544fa58ed55e767b2be53b4524b95b57299fe (diff)
downloadsimplepkg-4cadcec9f918e6a1058d1e3f1814505bd205c9d4.tar.gz
simplepkg-4cadcec9f918e6a1058d1e3f1814505bd205c9d4.tar.bz2
attempting to fix #56
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@779 04377dda-e619-0410-9926-eae83683ac58
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
+
}
#---------------------------------------------------