[buildbot] scripts/signall.sh: make branch aware
LEDE Commits
lede-commits at lists.infradead.org
Mon May 15 08:39:22 PDT 2023
ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/bdb822236f2665c86293108a8640990f5932b857
commit bdb822236f2665c86293108a8640990f5932b857
Author: Thibaut VARÈNE <hacks at slashdirt.org>
AuthorDate: Mon Oct 24 16:56:37 2022 +0200
scripts/signall.sh: make branch aware
This commit is a NO-OP if signall.sh is called with a single argument,
as is currently done, and will allow fetching branch-specific signing
credentials if a branch name is passed as second argument.
Signed-off-by: Thibaut VARÈNE <hacks at slashdirt.org>
---
scripts/signall.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/scripts/signall.sh b/scripts/signall.sh
index 8f39500..b06844d 100755
--- a/scripts/signall.sh
+++ b/scripts/signall.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
tarball="$1"
+branch="$2"
tmpdir="signall.$$"
tarball="$(readlink -f "$tarball")"
@@ -50,12 +51,21 @@ case "$(gpg --version | head -n1)" in
*\ 2.*) loopback=1 ;;
esac
+if [ -z "$branch" ]; then
GPGKEY="$(iniget "${CONFIG_INI:-config.ini}" gpg key)"
GPGPASS="$(iniget "${CONFIG_INI:-config.ini}" gpg passphrase)"
GPGCOMMENT="$(iniget "${CONFIG_INI:-config.ini}" gpg comment)"
USIGNKEY="$(iniget "${CONFIG_INI:-config.ini}" usign key)"
USIGNCOMMENT="$(iniget "${CONFIG_INI:-config.ini}" usign comment)"
+else
+GPGKEY="$(iniget "${CONFIG_INI:-config.ini}" "branch $branch" "gpg_key")"
+GPGPASS="$(iniget "${CONFIG_INI:-config.ini}" "branch $branch" "gpg_passphrase")"
+GPGCOMMENT="$(iniget "${CONFIG_INI:-config.ini}" "branch $branch" "gpg_comment")"
+
+USIGNKEY="$(iniget "${CONFIG_INI:-config.ini}" "branch $branch" "usign_key")"
+USIGNCOMMENT="$(iniget "${CONFIG_INI:-config.ini}" "branch $branch" "usign_comment")"
+fi
if echo "$GPGKEY" | grep -q "BEGIN PGP PRIVATE KEY BLOCK"; then
umask 077
More information about the lede-commits
mailing list