* [PATCH rdma-core] cbuild: Run gpg with a home directy in the tmpdir
@ 2019-09-24 7:59 Leon Romanovsky
0 siblings, 0 replies; only message in thread
From: Leon Romanovsky @ 2019-09-24 7:59 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe; +Cc: RDMA mailing list, Leon Romanovsky
From: Jason Gunthorpe <jgg@mellanox.com>
To avoid interaction with the user's gpg home directory.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
buildlib/cbuild | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/buildlib/cbuild b/buildlib/cbuild
index c9522841d..742a9e225 100755
--- a/buildlib/cbuild
+++ b/buildlib/cbuild
@@ -221,13 +221,15 @@ class APTEnvironment(Environment):
# key for the toolchain ppa. Fetch it in the host and just import the
# gpg data directly into the trusted keyring.
kb = os.path.join(tmpdir,"%s.kb.gpg"%(keyid));
- subprocess.check_call(["gpg","--no-default-keyring","--keyring",kb,"--always-trust",
- "--recv-key",keyid]);
+ env = {k:v for k,v in os.environ.items()};
+ env["HOME"] = tmpdir;
+ subprocess.check_call(["gpg","--keyserver", "keyserver.ubuntu.com", "--no-default-keyring","--keyring",kb,"--always-trust",
+ "--recv-key",keyid],env=env);
kr = os.path.join(gpgd,"%s.gpg"%(keyid));
with open(kr,"wb") as F:
F.write(subprocess.check_output(["gpg","--no-default-keyring",
"--keyring",kb,
- "--export",keyid]));
+ "--export",keyid],env=env));
os.unlink(kb);
self.add_source_list(tmpdir,keyid + ".list",srcline);
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-24 7:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24 7:59 [PATCH rdma-core] cbuild: Run gpg with a home directy in the tmpdir Leon Romanovsky
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 NNTP newsgroup(s).