From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 14:35:28 2021 Received: (at 50751) by debbugs.gnu.org; 23 Sep 2021 18:35:28 +0000 Received: from localhost ([127.0.0.1]:55850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTTZA-0001kA-31 for submit@debbugs.gnu.org; Thu, 23 Sep 2021 14:35:28 -0400 Received: from out2.migadu.com ([188.165.223.204]:43710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTTZ8-0001k1-9X for 50751@debbugs.gnu.org; Thu, 23 Sep 2021 14:35:27 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1632422124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UfRQ5mg6ed/d9CuegJCNzUhegI5dqxC0udi0xK6HakQ=; b=QwYB0eHfnohMOUPCqQ6/2GnFmsidrZEMmpXwXxht8s+U7k6EIg0x7LXE5dsrflkVAvKTy6 29FKlfaeq+733u9e3WRoGCpZWCJMu/T+0QmjLVX7SOcah7NJo+xz9o30bbwdOUrmSlU5jZ Y0xNhgqTubMmGg4KdTSRL4jEKXGodbo= From: Sarah Morgensen To: Attila Lendvai Subject: Re: [bug#50751] [PATCH] gnu: update Trezor support References: <20210923083045.10372-1-attila@lendvai.name> Date: Thu, 23 Sep 2021 11:35:22 -0700 In-Reply-To: <20210923083045.10372-1-attila@lendvai.name> (Attila Lendvai's message of "Thu, 23 Sep 2021 10:30:46 +0200 (9 hours, 43 minutes, 37 seconds ago)") Message-ID: <86mto3kumt.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50751 Cc: 50751@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Thanks for the patch! Reading over this, I have a few comments. Attila Lendvai writes: > Fetch everything from their git repos, instead of pypi. > Given the resulting version mismatch, and having to pick apart the sources, is there a compelling reason for this? It looks like the same files are included. > * gnu/packages/finance.scm (python-trezor-agent): Update to 0.14.2. > (python-trezor): Update to 0.12.3. > (trezor-agent): Update to 0.11.0. > (trezord): Update to 2.0.31. > * gnu/packages/patches/trezor-agent-fix-argv0.patch: New file. When at all possible, version updates should be separate commits from changes. > @@ -1091,14 +1137,14 @@ the KeepKey Hardware Wallet.") > (let* ((out (assoc-ref outputs "out"))) > ;; overwrite the wrapper with the real thing. > (install-file "./trezor_agent.py" > - (string-append out "/bin")) > - #t)))))) > + (string-append out "/bin"))) > + #t))))) This wasn't added by your patch, but it's odd that the reason for overriding the wrapper wasn't documented.... Because if we didn't overwrite the wrapper, your patch below would be unnecessary, because the wrapper sets argv[0] to the original name of the file. > diff --git a/gnu/packages/patches/trezor-agent-fix-argv0.patch b/gnu/packages/patches/trezor-agent-fix-argv0.patch > new file mode 100644 > index 0000000000..9462067cd5 > --- /dev/null > +++ b/gnu/packages/patches/trezor-agent-fix-argv0.patch > @@ -0,0 +1,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) Hope that helps, -- Sarah