[PATCH] Update script

Szczepan Zalega | Nitrokey szczepan at nitrokey.com
Fri Jul 13 13:54:48 CEST 2018

On 07/13/2018 09:41 AM, NIIBE Yutaka wrote:
> I applied the first two, which require no discussion.  For others, let
> me have more time.

Thank you for the review! As a general comment - I tried to make it as
easy to use as possible, so users could be up to date with no effort or
frustration, regardless of their overall PC experience level.

> Firstly, for Python programming, I think that all import should be done
> earlier (not only in some function or in some if clause).  That's
> because if import fails in the deep call chain, sometime, it is a
> disaster, where user can do no recovery.
I agree and will keep that in mind. Besides `requirements.txt` we could
keep `import` in try/catch block and print further installation
instructions to user.

> Secondly, I don't agree the way like
> 0004-Kill-scdaemon-on-connection-failure.patch.  Let user invoke the
> command.
Scdaemon owning a device is the most frequent cause of the script update
failure on Ubuntu I am aware of (and perhaps other distros, where
scdaemon/pcscd are used), hence the solution. It is called only on
connection failure and is easily recoverable as well (it starts on
request from GnuPG), so it should be pretty harmless. Alternatively the
whole command could be printed to the console with the proper further

> For 0005-Handle-CLI-parsing-protect-from-mistakes-and-give-me.patch, I
> partially agree it will be useful, but I wonder if your intended "user"
> uses GUI or not.
To be honest I was myself frequently opening the update script to see,
whenever I supply the binaries in the correct order and the improvements
here are making this checks for me. Argparse module is in Python since
3.2 (and in 2.7), so there are no further installation actions required.
I do not entirely get the GUI reference - could you elaborate? If you
feel it GUI-like in the sense of guiding the user, then I think this is
a good experience :-)

Regarding making a separate update GUI application, I have plans for it
(for further future).

What is your opinion on moving the Python tools to 3.x? As far as I
remember 2.7 will be stopped being supported this year.

Best regards,

More information about the Gnuk-users mailing list