diff options
author | 2024-07-24 17:09:10 +0100 | |
---|---|---|
committer | 2024-07-26 11:22:41 +0100 | |
commit | f99eb91227918d5bf0cc531e78bd597c73b7ce1f (patch) | |
tree | 0dc31e612f597e2b3d6697f13976ca7e590e30c3 /bin | |
parent | Check whether xtrace is enabled sensibly (diff) | |
download | portage-f99eb91227918d5bf0cc531e78bd597c73b7ce1f.tar.gz portage-f99eb91227918d5bf0cc531e78bd597c73b7ce1f.tar.bz2 portage-f99eb91227918d5bf0cc531e78bd597c73b7ce1f.zip |
emerge-webrsync: actually honour the sync-webrsync-verify-signature attribute
The repo_has_webrsync_verify variable was always being set as the empty
string, despite later being compared to 1 in the arithmetic context.
Have it work in the way that was originally intended. This also
eliminates a superfluous use of the has() function, which was the reason
for my inspecting the code in the first place.
Also, apply the exact same fix to emerge-delta-webrsync.
Fixes: b5cd549e07f3d835cbe04e5b718cdd47d7ee69f5
Fixes: 0347637fe5033d3d8eb4fdafa1e86de171934819
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/emerge-webrsync | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index caa4986da..124bcaddc 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -105,16 +105,17 @@ do_debug=0 keep=false handle_pgp_setup() { + local attr repo_has_webrsync_verify webrsync_gpg + # WEBRSYNC_VERIFY_SIGNATURE=0: disable PGP verification # WEBRSYNC_VERIFY_SIGNATURE=1: use gemato for verification, fallback to regular gpg # WEBRSYNC_VERIFY_SIGNATURE=2: use legacy FEATURES="webrsync-gpg" WEBRSYNC_VERIFY_SIGNATURE=1 - has webrsync-gpg ${FEATURES} && webrsync_gpg=1 || webrsync_gpg=0 + has webrsync-gpg ${FEATURES} && webrsync_gpg=1 - repo_has_webrsync_verify=$( - has $(__repo_attr "${repo_name}" sync-webrsync-verify-signature | LC_ALL=C tr '[:upper:]' '[:lower:]') true yes - ) + attr=$(__repo_attr "${repo_name}" sync-webrsync-verify-signature) + [[ ${attr,,} == @(true|yes) ]] && repo_has_webrsync_verify=1 if [[ -n ${PORTAGE_TEMP_GPG_DIR} ]] || [[ ${repo_has_webrsync_verify} -eq 1 ]]; then # If FEATURES=webrsync-gpg is enabled then allow direct emerge-webrsync |