all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 9462067cd517d7c76937430585237cc141f0ad72 1128 bytes (raw)
name: gnu/packages/patches/trezor-agent-fix-argv0.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
diff --git a/libagent/gpg/__init__.py b/libagent/gpg/__init__.py
index 3711bc8..67085de 100644
--- a/libagent/gpg/__init__.py
+++ b/libagent/gpg/__init__.py
@@ -122,15 +122,19 @@ def run_init(device_type, args):
     verify_gpg_version()
 
     # Prepare new GPG home directory for hardware-based identity
-    device_name = os.path.basename(sys.argv[0]).rsplit('-', 1)[0]
-    log.info('device name: %s', device_name)
+    exe_name = os.path.basename(sys.argv[0])
+    # drop the Guix wrapper's dot prefix from the name
+    if exe_name[0] == '.' and exe_name.endswith('-real'):
+        exe_name = exe_name[1:-5:]
+    device_name = exe_name.rsplit('-', 1)[0]
+    log.info('exe name: %s, device name: %s', exe_name, device_name)
     homedir = args.homedir
     if not homedir:
         homedir = os.path.expanduser('~/.gnupg/{}'.format(device_name))
 
     log.info('GPG home directory: %s', homedir)
 
-    if os.path.exists(homedir):
+    if os.path.exists(homedir) and not args.subkey:
         log.error('GPG home directory %s exists, '
                   'remove it manually if required', homedir)
         sys.exit(1)

debug log:

solving 9462067cd5 ...
found 9462067cd5 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.