Skip to contentSkip to conversation

Implement GPG_PATH variable

PATCH New Markus Lehtonen 1 participant 3 messages Oct 14, 2015

lore
Share & tools
lore
#0 lore raw

cover Implement GPG_PATH variable

This optional setting makes it possible to specify a non-default gpg home directory in the bitbake configuration.

[YOCTO #8134]

The following changes since commit e42d8eff9eed7d1454b4f331d96dcee6dea232df:

bash: Disable custom memory allocator (2015-10-12 14:35:42 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib marquiz/rpmsign
http://git.openembedded.org/openembedded-core-contrib/log/?h=marquiz/rpmsign

Markus Lehtonen (2):
sign_rpm.bbclass: introduce GPG_PATH variable
package_manager: support GPG_PATH variable

 meta/classes/sign_rpm.bbclass  | 4 ++++
 meta/lib/oe/package_manager.py | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/2 sign_rpm.bbclass: introduce GPG_PATH variable

This bitbake configuration variable can be used to define the gpg home directory.

---
 meta/classes/sign_rpm.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/sign_rpm.bbclass +4 -0
index 0aa4cd8..23aea42 100644
@@ -12,6 +12,8 @@
 # GPG_BIN
 #           Optional variable for specifying the gpg binary/wrapper to use for
 #           signing.
+# GPG_PATH
+#           Optional variable for specifying the gnupg "home" directory:
 #
 inherit sanity
 
@@ -41,6 +43,8 @@ def rpmsign_wrapper(d, files, passphrase, gpg_name=None):
                                "(e.g. in  ~/.oerpmmacros", d)
     if d.getVar('GPG_BIN', True):
         cmd += "--define '%%__gpg %s' " % d.getVar('GPG_BIN', True)
+    if d.getVar('GPG_PATH', True):
+        cmd += "--define '_gpg_path %s' " % d.getVar('GPG_PATH', True)
     cmd += ' '.join(files)
 
     # Need to use pexpect for feeding the passphrase
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/2 package_manager: support GPG_PATH variable

In reply to Markus Lehtonen

If defined, use GPG_PATH as the gpg home directory when signing package feeds. This setting is only used by package_manager if package feed singning has been enabled, i.e. PACKAGE_FEED_SIGN="1".

---
 meta/lib/oe/package_manager.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/lib/oe/package_manager.py +5 -2
index c34e436..5c2130b 100644
@@ -133,8 +133,11 @@ class RpmIndexer(Indexer):
             if pkgfeed_gpg_name:
                 repomd_file = os.path.join(arch_dir, 'repodata', 'repomd.xml')
                 gpg_cmd = "%s --detach-sign --armor --batch --no-tty --yes " \
-                          "--passphrase-file '%s' -u '%s' %s" % (gpg_bin,
-                          pkgfeed_gpg_pass, pkgfeed_gpg_name, repomd_file)
+                          "--passphrase-file '%s' -u '%s' " % \
+                          (gpg_bin, pkgfeed_gpg_pass, pkgfeed_gpg_name)
+                if self.d.getVar('GPG_PATH', True):
+                    gpg_cmd += "--homedir %s " % self.d.getVar('GPG_PATH', True)
+                gpg_cmd += repomd_file
                 repo_sign_cmds.append(gpg_cmd)
 
             rpm_dirs_found = True
Signature · 1 line
2.1.4