aboutsummaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src')
-rw-r--r--trunk/src/createpkg9
-rwxr-xr-xtrunk/src/simplaret26
2 files changed, 31 insertions, 4 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index 86be854..fe908b5 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -437,6 +437,7 @@ function update_metadata {
cd $makepkg_repos
+ repo_gpg_key $makepkg_repos
gen_meta $SUBFOLDER/$PKG_NAME
gen_filelist
update_md5_checksum $makepkg_repos $SUBFOLDER/$PKG_NAME
@@ -697,10 +698,16 @@ if [ $SIGN_PACKAGES -eq $on ]; then
echo "Signing package..."
+ check_gnupg $SIGN_PACKAGES_USER
+
if [ ! -z "$SIGN_PACKAGES_KEYID" ]; then
SIGN_KEYID="-u $SIGN_PACKAGES_KEYID"
else
- SIGN_KEYID=""
+ if [ ! -z "$SIGN_PACKAGES_USER" ]; then
+ SIGN_KEYID="-u `su $SIGN_PACKAGES_USER -c "gpg --list-secret-keys --with-colons | grep ^sec | head -n 1 | cut -d : -f 5"`"
+ else
+ SIGN_KEYID="-u `gpg --list-secret-keys --with-colons | grep ^sec | head -n 1 | cut -d : -f 5`"
+ fi
fi
if [ ! -z "$SIGN_PACKAGES_USER" ]; then
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index df55526..1d9d47a 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -63,8 +63,8 @@ function simplaret_backup_index {
function simplaret_check_index {
for file in `simplaret_metafiles`; do
- if [ ! -f "$1/$file" ] && [ -f "$1/$file" ]; then
- echo restoring old $file to $1...
+ if [ ! -f "$1/$file" ] && [ -f "$1/$file.old" ]; then
+ echo Restoring old $file to $1...
mv $1/$file.old $1/$file
else
rm -f $1/$file.old
@@ -73,6 +73,21 @@ function simplaret_check_index {
}
+function simplaret_import_gpg_keys {
+
+ if [ "$SIGNATURE_CHECKING" == "$on" ]; then
+ check_gnupg
+ if [ -f "$1/GPG-KEY" ] && [ -f "$1/GPG-KEY.old" ]; then
+ if diff $1/GPG-KEY $1/GPG-KEY.old &> /dev/null; then
+ gpg --import < $1/GPG-KEY
+ fi
+ elif [ -f "$1/GPG-KEY" ]; then
+ gpg --import < $1/GPG-KEY
+ fi
+ fi
+
+}
+
function simplaret_download {
# download a file from a repo to a folder
@@ -262,6 +277,7 @@ function simplaret_update {
simplaret_get_index $repository_url $storage/$repository_name
simplaret_check_index $storage/$repository_name
+ simplaret_import_gpg_keys $storage/$repository_name
unset repository_name repository_url repository_protocol
@@ -320,7 +336,11 @@ function simplaret_filelist {
function simplaret_metafiles {
- echo `simplaret_filelist` CHECKSUMS.md5
+ if [ "$SIGNATURE_CHECKING" == "$on" ]; then
+ echo `simplaret_filelist` CHECKSUMS.md5 GPG-KEY
+ else
+ echo `simplaret_filelist` CHECKSUMS.md5
+ fi
}