all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sarah Morgensen <iskarian@mgsn.dev>
To: Attila Lendvai <attila@lendvai.name>
Cc: 50751@debbugs.gnu.org
Subject: [bug#50751] [PATCH] gnu: update Trezor support
Date: Thu, 23 Sep 2021 11:35:22 -0700	[thread overview]
Message-ID: <86mto3kumt.fsf@mgsn.dev> (raw)
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)")

Hi,

Thanks for the patch!  Reading over this, I have a few comments.

Attila Lendvai <attila@lendvai.name> 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




  reply	other threads:[~2021-09-23 18:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  8:30 [bug#50751] [PATCH] gnu: update Trezor support Attila Lendvai
2021-09-23 18:35 ` Sarah Morgensen [this message]
2021-09-24 11:05   ` Attila Lendvai
2021-09-24 11:05 ` [bug#50751] [PATCH 1/2] gnu: python-trezor-agent: Fix key generation with trezor-gpg init Attila Lendvai
2021-09-24 11:05   ` [bug#50751] [PATCH 2/2] gnu: update Trezor support Attila Lendvai
2021-11-28 20:35     ` bug#50751: " Nicolas Goaziou
2021-11-28 20:34   ` [bug#50751] [PATCH 1/2] gnu: python-trezor-agent: Fix key generation with trezor-gpg init Nicolas Goaziou
2021-11-30 20:51     ` Attila Lendvai
2021-12-01 15:34       ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86mto3kumt.fsf@mgsn.dev \
    --to=iskarian@mgsn.dev \
    --cc=50751@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.