[gnome-build-meta/valentindavid/eos-installer: 4/12] Split creation of developer test GPG key from ostree repository update script



commit 91cc930ec36e080c9e13f8f88e35973a4ab65dc9
Author: Valentin David <valentin david codethink co uk>
Date:   Wed Feb 26 11:36:16 2020 +0100

    Split creation of developer test GPG key from ostree repository update script
    
    This will be used in other developer scripts

 utils/ensure-local-key.sh  | 24 ++++++++++++++++++++++++
 utils/update-local-repo.sh | 21 +--------------------
 2 files changed, 25 insertions(+), 20 deletions(-)
---
diff --git a/utils/ensure-local-key.sh b/utils/ensure-local-key.sh
new file mode 100755
index 00000000..79c3ce9f
--- /dev/null
+++ b/utils/ensure-local-key.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -eu
+
+if ! [ -d ostree-gpg ]; then
+    rm -rf ostree-gpg.tmp
+    mkdir ostree-gpg.tmp
+    chmod 0700 ostree-gpg.tmp
+    cat >ostree-gpg.tmp/key-config <<EOF
+Key-Type: DSA
+Key-Length: 1024
+Subkey-Type: ELG-E
+Subkey-Length: 1024
+Name-Real: Gnome OS
+Expire-Date: 0
+%no-protection
+%commit
+%echo finished
+EOF
+    gpg --batch --homedir=ostree-gpg.tmp --generate-key ostree-gpg.tmp/key-config
+    default_key="$(gpg --homedir=ostree-gpg.tmp -k --with-colons | sed '/^fpr:/q;d' | cut -d: -f10)"
+    echo "default-key ${default_key}" >ostree-gpg.tmp/gpg.conf
+    mv ostree-gpg.tmp ostree-gpg
+fi
diff --git a/utils/update-local-repo.sh b/utils/update-local-repo.sh
index 64bc24cd..6a6e5819 100755
--- a/utils/update-local-repo.sh
+++ b/utils/update-local-repo.sh
@@ -7,29 +7,10 @@ export BST
 
 ref="$(${BST} show --format "%{vars}" --deps none vm/repo.bst | sed '/ostree-branch: /{;s///;q;};d')"
 
-if ! [ -d ostree-gpg ]; then
-    rm -rf ostree-gpg.tmp
-    mkdir ostree-gpg.tmp
-    chmod 0700 ostree-gpg.tmp
-    cat >ostree-gpg.tmp/key-config <<EOF
-Key-Type: DSA
-Key-Length: 1024
-Subkey-Type: ELG-E
-Subkey-Length: 1024
-Name-Real: Gnome OS
-Expire-Date: 0
-%no-protection
-%commit
-%echo finished
-EOF
-    gpg --batch --homedir=ostree-gpg.tmp --generate-key ostree-gpg.tmp/key-config
-    gpg --homedir=ostree-gpg.tmp -k --with-colons | sed '/^fpr:/q;d' | cut -d: -f10 
ostree-gpg.tmp/default-id
-    mv ostree-gpg.tmp ostree-gpg
-fi
+utils/ensure-local-key.sh
 
 utils/update-repo.sh \
     --gpg-homedir=ostree-gpg \
-    --gpg-sign="$(cat ostree-gpg/default-id)" \
     --collection-id=org.gnome.GnomeOS \
     --target-ref="${ref%/*}/devel" \
     ostree-repo vm/repo.bst \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]