Skip to contentSkip to conversation

lib/oe/package_manager.py (rpm): Allow use of non-signed packages

PATCH In review Otavio Salvador 2 participants 2 messages Oct 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 lib/oe/package_manager.py (rpm): Allow use of non-signed packages

When we wish to use the package feed for local development, it does not uses GPG signed feeds by default but dnf uses package signature check. We need to configure the GPG signature check out so it works out of box.

With this patch, installing non-signed packages works:

$: dnf install <package>

---

Changes in v5:
- Fix typo.

Changes in v4:
- Rework code.

Changes in v3:
- Check if package signing is disabled prior disabling it

Changes in v2:
- Improve commit log

 meta/lib/oe/package_manager.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/lib/oe/package_manager.py +5 -3
index 658c964277..6afe81583a 100644
@@ -548,11 +548,13 @@ class RpmPM(PackageManager):
         if feed_uris == "":
             return
 
+        gpg_opts = ''
         if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-            gpg_opts = 'repo_gpgcheck=1\n'
+            gpg_opts += 'repo_gpgcheck=1\n'
             gpg_opts += 'gpgkey=file://%s/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-%s-%s\n' % (self.d.getVar('sysconfdir'), self.d.getVar('DISTRO'), self.d.getVar('DISTRO_CODENAME'))
-        else:
-            gpg_opts = ''
+
+        if self.d.getVar('RPM_SIGN_PACKAGES') == '0':
+            gpg_opts += 'gpgcheck=0\n'
 
         bb.utils.mkdirhier(oe.path.join(self.target_rootfs, "etc", "yum.repos.d"))
         remote_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
Signature · 1 line
2.14.2
#1 lore raw
Quoted 8 lines · Otavio Salvador
meta/lib/oe/package_manager.py +1 -1
@@ -548,11 +548,13 @@ class RpmPM(PackageManager):
          if feed_uris == "":
              return
 
+        gpg_opts = ''
          if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-            gpg_opts = 'repo_gpgcheck=1\n'

meta/lib/oe/package_manager.py class RpmPM(PackageManager): · line 560

Quoted 10 lines
meta/lib/oe/package_manager.py +4 -2
+            gpg_opts += 'repo_gpgcheck=1\n'
              gpg_opts += 'gpgkey=file://%s/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-%s-%s\n' % (self.d.getVar('sysconfdir'), self.d.getVar('DISTRO'), self.d.getVar('DISTRO_CODENAME'))
-        else:
-            gpg_opts = ''
+
+        if self.d.getVar('RPM_SIGN_PACKAGES') == '0':
+            gpg_opts += 'gpgcheck=0\n'
 
          bb.utils.mkdirhier(oe.path.join(self.target_rootfs, "etc", "yum.repos.d"))
          remote_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())

This one looks good, thanks for persevering :)

Alex