From bdb822236f2665c86293108a8640990f5932b857 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thibaut=20VAR=C3=88NE?= Date: Mon, 24 Oct 2022 16:56:37 +0200 Subject: [PATCH] scripts/signall.sh: make branch aware MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 -- 2.30.2