[lorax] Install proper branding packages from repo (#813969)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The product string is not the best source for package names.
---
 share/runtime-install.tmpl |    2 --
 src/pylorax/treebuilder.py |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/share/runtime-install.tmpl b/share/runtime-install.tmpl
index 7af3f3e..e9056d5 100644
--- a/share/runtime-install.tmpl
+++ b/share/runtime-install.tmpl
@@ -95,8 +95,6 @@ installpkg gnome-themes-standard gnome-icon-theme-legacy
 
 ## branding & logos
 installpkg fedora-gnome-theme fedora-icon-theme
-installpkg ${product.name}-logos
-installpkg ${product.name}-release
 
 ## debugging/bug reporting tools
 installpkg gdb-gdbserver
diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index 1d4a24c..de3d0bd 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -76,8 +76,30 @@ class RuntimeBuilder(object):
                                            yum=yum, templatedir=templatedir)
         self._runner.defaults = self.vars
 
+    def _install_branding(self):
+        release = None
+        for pkg in self.yum.whatProvides('/etc/system-release', None, None):
+            if pkg.name.startswith('generic'):
+                continue
+            else:
+                release = pkg.name
+                break
+
+        if not release:
+            logger.error('could not get the release')
+            return
+
+        # release
+        logger.info('got release: %s', release)
+        self._runner.installpkg(release)
+
+        # logos
+        release, _suffix = release.split('-', 1)
+        self._runner.installpkg('%s-logos' % release)
+
     def install(self):
         '''Install packages and do initial setup with runtime-install.tmpl'''
+        self._install_branding()
         self._runner.run("runtime-install.tmpl")
 
     def writepkglists(self, pkglistdir):
-- 
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux