Skip to contentSkip to conversation

gpg_sign: depress the owership warnings on homedir

PATCH In review Jia Zhang 1 participant 2 messages Aug 24, 2017

lore
Share & tools
lore

Jia Zhang

author
#0 lore raw

PATCH 1/1 gpg_sign: depress the owership warnings on homedir

A gpg command, e.g, called by get_gpg_version(), may trigger such a warning:
gpg: WARNING: unsafe ownership on homedir '/home/user/.gnupg'

This sort of warning is harmless so it can be depressed through specifying --no-permission-warning.

---
 meta/lib/oe/gpg_sign.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oe/gpg_sign.py +1 -1
index 008478dfeb..7d58f93888 100644
@@ -98,7 +98,7 @@ class LocalSigner(object):
         """Return the gpg version as a tuple of ints"""
         import subprocess
         try:
-            ver_str = subprocess.check_output((self.gpg_bin, "--version")).split()[2].decode("utf-8")
+            ver_str = subprocess.check_output((self.gpg_bin, "--version", "--homedir", self.gpg_path)).split()[2].decode("utf-8")
             return tuple([int(i) for i in ver_str.split('.')])
         except subprocess.CalledProcessError as e:
             raise bb.build.FuncFailed("Could not get gpg version: %s" % e)
Signature · 1 line
2.14.1
author
#1 lore raw

Sorry plz ignore this patch. I will send a new one.

Jia

Quoted 24 lines · Jia Zhang

A gpg command, e.g, called by get_gpg_version(), may trigger such a warning:
gpg: WARNING: unsafe ownership on homedir '/home/user/.gnupg'

This sort of warning is harmless so it can be depressed through specifying --no-permission-warning.

---
  meta/lib/oe/gpg_sign.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oe/gpg_sign.py +1 -1
index 008478dfeb..7d58f93888 100644
@@ -98,7 +98,7 @@ class LocalSigner(object):
          """Return the gpg version as a tuple of ints"""
          import subprocess
          try:
-            ver_str = subprocess.check_output((self.gpg_bin, "--version")).split()[2].decode("utf-8")
+            ver_str = subprocess.check_output((self.gpg_bin, "--version", "--homedir", self.gpg_path)).split()[2].decode("utf-8")
              return tuple([int(i) for i in ver_str.split('.')])
          except subprocess.CalledProcessError as e:
              raise bb.build.FuncFailed("Could not get gpg version: %s" % e)