[elbe-devel] [PATCH 5/6] init: set GPGHOME directory when generating elbe-keyring.gpg

John Ogness john.ogness at linutronix.de
Wed Oct 2 00:26:56 CEST 2019


Patch says GPGHOME but code sets GNUPGHOME.

On 2019-10-01, Torben Hohn <torben.hohn at linutronix.de> wrote:
> when ~/.gnupg does not exist, gnupg will refuse to work:
>
> --------------------------------------------------------------------
> 18:53:50  INFO:root:gpg --no-options --no-default-keyring --keyring /initvm/image/.elbe-in/elbe-keyring --import
> 18:53:50  gpg: Fatal: /home/elbe/.gnupg: directory does not exist!
> --------------------------------------------------------------------
>
> the result is, that keys from the xml file are not added to the installer
> keyring, and several packages can not be installed, when the key differs
> from the default elbe key, which is also added via the system keyrings.

I don't understand how setting GNUPGHOME is related to what you've
written here. Please elaborate.

Also, see comments below...

> While touching these lines also make sure, they are not longer than 80.
>
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
> ---
>  elbepack/commands/init.py | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
> index 6b463b4cb..3b0c32d45 100644
> --- a/elbepack/commands/init.py
> +++ b/elbepack/commands/init.py
> @@ -231,12 +231,23 @@ def run_command(argv):
>          keys = []
>          for key in xml.all(".//initvm/mirror/url-list/url/raw-key"):
>              keys.append(key.et.text)
> +
>          import_keyring = os.path.join(out_path, "elbe-keyring")
> -        do('gpg --no-options --no-default-keyring --keyring %s --import' % import_keyring,
> -                    stdin="".join(keys), allow_fail=True)
> +
> +        do('gpg --no-options \
> +                --no-default-keyring \
> +                --keyring %s --import' % import_keyring,
> +           stdin="".join(keys),
> +           allow_fail=True,
> +           env_add={'GNUPGHOME': out_path})
> +
>          export_keyring = import_keyring + ".gpg"
> -        do('gpg --no-options --no-default-keyring --keyring %s --export --output %s' % (import_keyring,
> -                                                                                    export_keyring))
> +
> +        do('gpg --no-options \
> +                --no-default-keyring \
> +                --keyring %s \
> +                --export \
> +                --output %s' % (import_keyring, export_keyring))

Doesn't GNUPGHOME need to be set when exporting as well?

>      if opt.devel:
>          out_real = os.path.realpath(out_path)

John



More information about the elbe-devel mailing list