commit: 9d70ee2c2b825ae14270e0d1b275146bf4d0a027
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Jun 16 11:48:19 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 17 03:00:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9d70ee2c
emerge-webrsync: improve a comment in check_file_signature_gpg_unwrapped()
The check_file_signature_gpg_unwrapped() function contains a comment
concerning the rationale for creating an ephemeral keyring in the case
that the 'PORTAGE_GPG_DIR' variable is unset or empty. Rewrite this
comment in a formal manner and hoist it upwards in advance of further
refactoring.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/emerge-webrsync | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 93e0e5a87d..b64f71d6d4 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -300,12 +300,13 @@ check_file_signature_gpg_unwrapped() {
fi
gpgdir="${PORTAGE_GPG_DIR}"
- if [[ -z ${gpgdir} ]] ; then
+ if [[ ! ${gpgdir} ]]; then
+ # The PORTAGE_GPG_DIR variable is either unset or
+ # empty. Create a temporary directory to contain an
+ # ephemeral keyring into which Gentoo's distributed
+ # public key block shall be imported.
gpgdir=$(mktemp -d --
"${PORTAGE_TMPDIR}/portage/webrsync.XXXXXX") || exit
- # If we're created our own temporary directory, it's
okay for us
- # to import the keyring by ourselves. But we'll avoid
doing it
- # if the user has set PORTAGE_GPG_DIR by themselves.
gpg --no-default-keyring --homedir "${gpgdir}" --batch
--import "${key}"
elif [[ ! -w ${gpgdir} ]] ; then
die "gpgdir is not writable: ${gpgdir}"