From 3856df4e6c9d3ceecc5e2996f6678ea115f8517f Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 20 Sep 2024 10:18:19 +0200 Subject: [PATCH] Restore sign_rpms script, it's used in sign_stage_rpms This partially reverts "drop signing scripts that were used with koji" Fixes: 39674f49ec52ae39a3f44eaa259908defa24641b --- sign_rpms | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 sign_rpms diff --git a/sign_rpms b/sign_rpms new file mode 100755 index 0000000..31053bc --- /dev/null +++ b/sign_rpms @@ -0,0 +1,21 @@ +#!/bin/bash -e + +. settings + +gpg_pass=$(mktemp) +trap 'shred --remove "${gpg_pass}"' EXIT +chmod 0700 "$gpg_pass" +show_gpg_password > "$gpg_pass" + +SIGN_FLAGS=(--define "_gpg_sign_cmd_extra_args --pinentry-mode loopback --passphrase-file ${gpg_pass}" --define "_gpg_path $KEYDIR" --define="_gpg_name $SIGNER") + +rpmdev-vercmp $(rpm --query --queryformat='%{EVR}' rpm) 4.16.0 || RESULT=$? +if [[ $RESULT == "11" ]]; then + SIGN_FLAGS+=("--rpmv3") +fi + +if [[ -n $1 ]] ; then + echo "$@" | xargs $XARGS_JOBS rpmsign --addsign "${SIGN_FLAGS[@]}" +else + find "$RPMDIR" -name '*.rpm' | xargs $XARGS_JOBS rpmsign --addsign "${SIGN_FLAGS[@]}" +fi