unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob b23e76da7ce688f1eda7bca7b297124420797073 1438 bytes (raw)
name: gnu/packages/patches/rnp-fix-gnupg-list-packets.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
28
29
30
31
32
33
34
35
 
From 4cb5b2c1d3783bfad3c4f77b2ad2ac89921e91f4 Mon Sep 17 00:00:00 2001
From: Justus Winter <teythoon@avior.uberspace.de>
Date: Tue, 21 Jul 2020 16:03:32 +0200
Subject: [PATCH 4/6] Make invoking GnuPG more robust.

GnuPG will try to read its state even for operations that do not
require it, e.g. listing packets.  If the state directory does not
exist, GnuPG will try to create it.  If this fails, GnuPG errors out.

In some build environments, $HOME may not exist or may not be
writable (e.g. in Guix and Nix, $HOME does not exist).  This leads to
a spurious test failures when GnuPG is invoked to inspect packets.

Fix this by using the current directory as GnuPG state directory.
---
 src/tests/cli_tests.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tests/cli_tests.py b/src/tests/cli_tests.py
index 74b28983..2b7d772a 100755
--- a/src/tests/cli_tests.py
+++ b/src/tests/cli_tests.py
@@ -106,7 +106,8 @@ RNP_TO_GPG_CIPHERS = {'AES' : 'aes128', 'AES192' : 'aes192', 'AES256' : 'aes256'
         'IDEA' : 'idea', '3DES' : '3des', 'CAST5' : 'cast5', 'BLOWFISH' : 'blowfish'}
 
 def check_packets(fname, regexp):
-    ret, output, err = run_proc(GPG, ['--list-packets', path_for_gpg(fname)])
+    ret, output, err = run_proc(GPG, ['--homedir', '.',
+                                      '--list-packets', path_for_gpg(fname)])
     if ret != 0:
         logging.error(err)
         return None
-- 
2.20.1


debug log:

solving b23e76da7c ...
found b23e76da7c in https://yhetil.org/guix-patches/20200723120322.8385-3-justus@sequoia-pgp.org/

applying [1/1] https://yhetil.org/guix-patches/20200723120322.8385-3-justus@sequoia-pgp.org/
diff --git a/gnu/packages/patches/rnp-fix-gnupg-list-packets.patch b/gnu/packages/patches/rnp-fix-gnupg-list-packets.patch
new file mode 100644
index 0000000000..b23e76da7c

1:31: trailing whitespace.
 
1:39: trailing whitespace.
-- 
Checking patch gnu/packages/patches/rnp-fix-gnupg-list-packets.patch...
1:41: new blank line at EOF.
+
Applied patch gnu/packages/patches/rnp-fix-gnupg-list-packets.patch cleanly.
warning: 3 lines add whitespace errors.

index at:
100644 b23e76da7ce688f1eda7bca7b297124420797073	gnu/packages/patches/rnp-fix-gnupg-list-packets.patch

(*) 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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).