diff options
Diffstat (limited to 'trunk/src')
-rw-r--r-- | trunk/src/createpkg | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 0694d24..a1c0baa 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -716,10 +716,13 @@ if [ $SIGN_PACKAGES -eq $on ]; then fi if [ ! -z "$SIGN_PACKAGES_USER" ]; then - REPOSITORY_OWNER="$(get_owner $PACKAGES_DIR)" - chown $SIGN_PACKAGES_USER `dirname $PACKAGES_DIR` - su $SIGN_PACKAGES_USER -c "gpg --use-agent --armor -sb -u $SIGN_KEYID $PACKAGES_DIR/$PKG_NAME" - chown $REPOSITORY_OWNER $PACKAGES_DIR + if tmpfile="`su $SIGN_PACKAGES_USER -c "mktemp $TMP/createpkg_sig.XXXXXX"`"; then + su $SIGN_PACKAGES_USER -c "gpg --use-agent --armor -sb -u -o $tmpfile $SIGN_KEYID $PACKAGES_DIR/$PKG_NAME" + cp $tmpfile $PACKAGES_DIR/$PKG_NAME.asc + su $SIGN_PACKAGES_USER -c "rm -f $tmpfile" + else + echo "Error signing package: could not create tmp file." + fi else gpg --use-agent --armor -sb -u $SIGN_KEYID $PACKAGES_DIR/$PKG_NAME fi |