aboutsummaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src')
-rw-r--r--trunk/src/createpkg34
-rwxr-xr-xtrunk/src/mkbuild2
-rwxr-xr-xtrunk/src/simplaret10
3 files changed, 41 insertions, 5 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index 87fa202..94469da 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -263,6 +263,10 @@ function load_parameters {
CREATEPKG_AUTHOR="`eval_parameter CREATEPKG_AUTHOR`"
TMP="`eval_parameter TMP /tmp`"
+ SIGN_PACKAGES="`eval_boolean_parameter SIGN_PACKAGES $off`"
+ SIGN_PACKAGES_USER="`eval_parameter SIGN_PACKAGES_USER`"
+ SIGN_PACKAGES_KEYID="`eval_parameter SIGN_PACKAGES_KEYID`"
+
REMOVE_OLD_PACKAGE="`eval_boolean_parameter REMOVE_OLD_PACKAGE $off`"
MOVE_BIN_PACKAGE="`eval_boolean_parameter MOVE_BIN_PACKAGE $off`"
MOVE_SLACK_REQUIRED="`eval_boolean_parameter MOVE_SLACK_REQUIRED $off`"
@@ -385,8 +389,9 @@ function remove_old_package_data {
cd $makepkg_repos
# Using -mindepth 2 so it doesn't delete the new PACKAGE
- for file in `find . -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -o -name "$PACKAGE-*-*-*.meta"`; do
- candidate="`echo $file | sed -e 's/\.meta/\.tgz/'`" # otherwise PACKAGE info functions can fail
+ for file in `find . -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -o -name "$PACKAGE-*-*-*.meta" -o -name "$PACKAGE-*-*-*.tgz.asc"`; do
+ candidate="`echo $file | sed -e 's/\.meta$/\.tgz/'`" # otherwise PACKAGE info functions can fail
+ candidate="`echo $candidate | sed -e 's/\.asc$//'`" # otherwise PACKAGE info functions can fail
# Just delete packages with different arch, version, build number or folder
if [ "`package_version $candidate`" != "$PACKAGE_VERSION" ] || \
[ "`package_arch $candidate`" != "$PACKAGE_ARCH" ] || \
@@ -410,6 +415,7 @@ function remove_old_package_data {
# Using -mindepth 2 so it doesn't delete the new package
find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -exec rm {} 2>/dev/null \;
find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.meta" -exec rm {} 2>/dev/null \;
+ find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.tgz.asc" -exec rm {} 2>/dev/null \;
find $makepkg_repos -name "$PACKAGE.slack-required" -exec rm {} 2>/dev/null \;
fi
fi
@@ -671,6 +677,7 @@ PACKAGE_VERSION="`package_version $PKG_NAME`"
PACKAGE_ARCH="`package_arch $PKG_NAME`"
PACKAGE_BUILD="`package_build $PKG_NAME`"
+# Update package author
if [ ! -z "$CREATEPKG_AUTHOR" ]; then
AUTHOR="`echo $PACKAGE_BUILD | sed -e 's/^[0-9]*//'`"
if [ "$AUTHOR" != "$CREATEPKG_AUTHOR" ]; then
@@ -685,6 +692,23 @@ if [ ! -z "$CREATEPKG_AUTHOR" ]; then
fi
fi
+# Sign package
+if [ $SIGN_PACKAGES -eq $on ]; then
+
+ if [ ! -z "$SIGN_PACKAGES_KEYID" ]; then
+ SIGN_KEYID="-u $SIGN_PACKAGES_KEYID"
+ else
+ SIGN_KEYID=""
+ fi
+
+ if [ ! -z "$SIGN_PACKAGES_USER" ]; then
+ su -c $SIGN_PACKAGES_USER -c "gpg --use-agent --armor -sb $SIGN_KEYID $PACKAGES_DIR/$PKG_NAME"
+ else
+ gpg --use-agent --armor -sb $SIGN_KEYID $PACKAGES_DIR/$PKG_NAME
+ fi
+
+fi
+
# Select repository directory
if [ $MOVE_BIN_PACKAGE -eq $on ]; then
SUBFOLDER="$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} )"
@@ -707,11 +731,16 @@ remove_old_package_data $PACKAGES_DIR
if [ $MOVE_BIN_PACKAGE -eq $on ]; then
mv $PACKAGES_DIR/$PKG_NAME $NEW_REPOS/
+ if [ -e "$PACKAGES_DIR/$PKG_NAME.asc" ]; then
+ mv $PACKAGES_DIR/$PKG_NAME.asc $NEW_REPOS/
+ fi
+
if [ -d "$NEW_REPOS/.svn" ]; then
(
cd $NEW_REPOS
chown_svn $PACKAGES_DIR && chgrp_svn $PACKAGES_DIR
svn_add $PKG_NAME
+ svn_add $PKG_NAME.asc
)
fi
@@ -739,6 +768,7 @@ if [ $PACKAGES_REPOS_NOARCH -eq $on ] && [ "`package_arch $PKG_NAME`" == "noarch
remove_old_package_data $NOARCH_DIR
svn_copy $NEW_REPOS/$PKG_NAME $NOARCH_DIR/$SUBFOLDER/
svn_copy $NEW_REPOS/`basename $PKG_NAME .tgz`.meta $NOARCH_DIR/$SUBFOLDER/
+ svn_copy $NEW_REPOS/`basename $PKG_NAME`.asc $NOARCH_DIR/$SUBFOLDER/
svn_copy $NEW_REPOS/$PACKAGE.slack-required $NOARCH_DIR/$SUBFOLDER/
update_metadata $NOARCH_DIR
svn_remove_empty_folders $NOARCH_DIR
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 228d7b0..fa91278 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -649,7 +649,7 @@ function submit_mkbuild {
function submit_cleanup {
# remove files that should not be stored at the mkbuilds repository
- if [ "$(cd $(dirname $MKBUILD_PATH) ; pwd)" == "$WORK" ]; then
+ if is_the_same $(dirname $MKBUILD_PATH) $WORK; then
(
cd $WORK
rm -f *.old *.tmp *.SlackBuild *.slack-required
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index 8611721..9519cfe 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -674,12 +674,18 @@ function simplaret_get {
# echo $folder/$candidate
silent="--silent"
fi
- if [ -f "$folder/$candidate.asc" ] || [ "$SIGNATURE_CHECKING" == "1" ]; then
+ if [ -f "$folder/$candidate.asc" ] || [ "$SIGNATURE_CHECKING" == "$on" ]; then
gpg --verify $folder/$candidate.asc $folder/$candidate
+ if [ "$?" != "0" ]; then
+ echo "Package signature does not match. Removing package."
+ rm -f $folder/$candidate.asc $folder/$candidate
+ LAST_DOWNLOADED_PACKAGE=""
+ return 1
+ fi
fi
# generate the patches FILE_LIST and PACKAGES.TXT if needed
if [ "$generate_patches" == "1" ]; then
- gen_patches_filelst $folder
+ gen_patches_filelist $folder
gen_packages_txt $folder
gen_md5_checksums $folder
fi