]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_manager.py: set dnf's releasever setting from DISTRO_CODENAME
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Wed, 21 Jun 2017 12:58:21 +0000 (15:58 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Jul 2017 21:34:59 +0000 (22:34 +0100)
So that:

1) dnf does not complain anymore about releasever not being set and then fail
for the same reason;

2) it's possible to refer to $releasever in dnf package feed configuration
(repo paths in particular) without hardconding the release name (pyro, morty, etc.)

(From OE-Core rev: 789e3fc225adbb61f10aaa3bbc3677856f5f0238)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/lib/oe/package_manager.py

index 2795dd3823db5e2ee920cb9e5d0073503a729a53..93d079d73dbcf7d862503b19232964bc52ce2ee9 100644 (file)
@@ -494,9 +494,11 @@ class RpmPM(PackageManager):
         # This prevents accidental matching against libsolv's built-in policies
         if len(archs) <= 1:
             archs = archs + ["bogusarch"]
-        archconfdir = "%s/%s" %(self.target_rootfs, "etc/dnf/vars/")
-        bb.utils.mkdirhier(archconfdir)
-        open(archconfdir + "arch", 'w').write(":".join(archs))
+        confdir = "%s/%s" %(self.target_rootfs, "etc/dnf/vars/")
+        bb.utils.mkdirhier(confdir)
+        open(confdir + "arch", 'w').write(":".join(archs))
+        distro_codename = self.d.getVar('DISTRO_CODENAME')
+        open(confdir + "releasever", 'w').write(distro_codename if distro_codename is not None else '')
 
         open(oe.path.join(self.target_rootfs, "etc/dnf/dnf.conf"), 'w').write("")