aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--trunk/conf/simplepkg.conf6
-rw-r--r--trunk/doc/CHANGELOG11
-rw-r--r--trunk/src/createpkg38
3 files changed, 45 insertions, 10 deletions
diff --git a/trunk/conf/simplepkg.conf b/trunk/conf/simplepkg.conf
index 2da1116..841eddd 100644
--- a/trunk/conf/simplepkg.conf
+++ b/trunk/conf/simplepkg.conf
@@ -127,6 +127,12 @@ SIGN_MANIFESTS_KEYID=""
# Whether to use gpg-agent to sign Manifests
SIGN_MANIFESTS_WITH_GPG_AGENT="off"
+# Whether to just build packages that have Manifest files.
+FORCE_MANIFEST_CHECK="off"
+
+# Whether to just build packages that have signed Manifest files.
+FORCE_MANIFEST_CHECK_SIGNATURE="off"
+
#---------------------------------------------------------------------
# SIMPLARET SECTION
#---------------------------------------------------------------------
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG
index 59fcef4..257be66 100644
--- a/trunk/doc/CHANGELOG
+++ b/trunk/doc/CHANGELOG
@@ -51,12 +51,13 @@ simplepkg changelog
- minor changes
- renamed config parameter CREATE_ARCH to CREATEPKG_ARCH
- renamed all "MAKEPKG" config parameters to "PACKAGES", "MAKEPKG_REPOS" to "PACKAGES_DIR"
- - new config parameters PACKAGES_REPOS_STYLE, MOVE_SLACK_REQUIRED, MKBUILDS_SVN_USER,
- PACKAGES_SVN_USER, PACKAGES_SVN_GROUP, MKBUILDS_SVN_GROUP, PACKAGES_REPOS_NOARCH,
- PACKAGES_SVN, CREATEPKG_AUTHOR, SIGN_PACKAGES, SIGN_PACKAGES_USER. SIGN_PACKAGES_KEYID,
- SIGN_PACKAGES_WITH_GPG_AGENT, SOURCE_DIR_USER, SOURCE_DIR_GROUP, SIGN_MANIFESTS,
- SIGN_MANIFESTS_KEYID, SIGN_MANIFESTS_WITH_GPG_AGENT
- cleaner -s option output
+ - new config parameters PACKAGES_REPOS_STYLE, MOVE_SLACK_REQUIRED, MKBUILDS_SVN_USER,
+ PACKAGES_SVN_USER, PACKAGES_SVN_GROUP, MKBUILDS_SVN_GROUP, PACKAGES_REPOS_NOARCH,
+ PACKAGES_SVN, CREATEPKG_AUTHOR, SIGN_PACKAGES, SIGN_PACKAGES_USER. SIGN_PACKAGES_KEYID,
+ SIGN_PACKAGES_WITH_GPG_AGENT, SOURCE_DIR_USER, SOURCE_DIR_GROUP, SIGN_MANIFESTS,
+ SIGN_MANIFESTS_KEYID, SIGN_MANIFESTS_WITH_GPG_AGENT, FORCE_MANIFEST_CHECK,
+ FORCE_MANIFEST_CHECK_SIGNATURE
- lspkg: fix on package search routine
- jail-commit: using unified diff
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
+
}
#---------------------------------------------------