Skip to contentSkip to conversation

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

PATCH Superseded Otavio Salvador 3 participants 3 messages Oct 2, 2017 2 messages not in the archive

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 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 v3:
- Check if package signing is disabled prior disabling it

Changes in v2:
- Improve commit log

 meta/lib/oe/package_manager.py | 2 ++
 1 file changed, 2 insertions(+)
meta/lib/oe/package_manager.py +2 -0
index 658c964277..4fbc293992 100644
@@ -551,6 +551,8 @@ class RpmPM(PackageManager):
         if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
             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'))
+        elif: self.d.getVar('RPM_SIGN_PACKAGES') == '0':
+            gpg_opts = 'gpgcheck=0\n'
         else:
             gpg_opts = ''
 
Signature · 1 line
2.14.2
#1 lore raw

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

Quoted 8 lines · Otavio Salvador
meta/lib/oe/package_manager.py +2 -0
@@ -551,6 +551,8 @@ class RpmPM(PackageManager):
          if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
              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'))
+        elif: self.d.getVar('RPM_SIGN_PACKAGES') == '0':
+            gpg_opts = 'gpgcheck=0\n'
          else:
              gpg_opts = ''

Still wrong! I'm kind of getting tired though. Can you figure it out for yourself, this time?

Alex

#4 lore raw
In reply to a message not in the archive
Quoted 24 lines · Alexander Kanavin
Quoted 23 lines · Otavio Salvador

Em 2 de out de 2017 11:57 AM, "Alexander Kanavin" <[email protected] <mailto:[email protected]>> escreveu:

    On 10/02/2017 05:52 PM, Otavio Salvador wrote:

        @@ -551,6 +551,8 @@ class RpmPM(PackageManager):
                   if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
                       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'))
        +        elif: self.d.getVar('RPM_SIGN_PACKAGES') == '0':
        +            gpg_opts = 'gpgcheck=0\n'
                   else:
                       gpg_opts = ''


    Still wrong! I'm kind of getting tired though. Can you figure it out
    for yourself, this time?
Quoted 7 lines
Quoted 3 lines

Even better, I'll leave it broken.

I use I'll myself so good luck with rpm.

FWIW, the wrong part in this patch is that when PACKAGE_FEED_SIGN is set to 1, but RPM_SIGN_PACKAGES is set to 0, you will not get gpgsign=0 added to configuration.

Good that you know how to fix it. I gave up as you said, I got tired. Being not an active RPM user I took the time to check and test it and got a non-helpful attitude from one of its maintainers so please go ahead and fix it if you care. I got tired too.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750