summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-02-05 03:02:00 +0100
committerDan McGee <dan@archlinux.org>2013-02-05 03:02:00 +0100
commitf98ff8cd22185c11dccdbe19b5bb7ed849b38e6b (patch)
treee5c304a5cf5a93bad4bb4b67914d04d4805e9ca5
parentcfa2798880eccda63a3ed4d3eddadeb01f5065d2 (diff)
downloadarchweb-f98ff8cd22185c11dccdbe19b5bb7ed849b38e6b.tar.gz
archweb-f98ff8cd22185c11dccdbe19b5bb7ed849b38e6b.tar.xz
Add './' hack to generate_keyring as well
If you specify a relative path to gpg without a slash character, it interprets as relative to ~/.gnupg, which is stupid. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--devel/management/commands/generate_keyring.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/devel/management/commands/generate_keyring.py b/devel/management/commands/generate_keyring.py
index 15ae488..34bcd2f 100644
--- a/devel/management/commands/generate_keyring.py
+++ b/devel/management/commands/generate_keyring.py
@@ -55,6 +55,10 @@ def generate_keyring(keyserver, keyring):
master_key_ids = MasterKey.objects.values_list("pgp_key", flat=True)
logger.info("%d keys fetched from master keys", len(master_key_ids))
+ # GPG is stupid and interprets any filename without path portion as being
+ # in ~/.gnupg/. Fake it out if we just get a bare filename.
+ if '/' not in keyring:
+ keyring = './%s' % keyring
gpg_cmd = ["gpg", "--no-default-keyring", "--keyring", keyring,
"--keyserver", keyserver, "--recv-keys"]
logger.info("running command: %r", gpg_cmd)