Commit 74735e36 authored by Nikos Skalkotos's avatar Nikos Skalkotos

Detect more Ubuntu variants

Detect Kubuntu, Lubuntu and Xubuntu
parent 70cf2232
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
"""This module hosts OS-specific code for Ubuntu Linux""" """This module hosts OS-specific code for Ubuntu Linux"""
import re
from image_creator.os_type.linux import Linux from image_creator.os_type.linux import Linux
...@@ -27,12 +29,19 @@ class Ubuntu(Linux): ...@@ -27,12 +29,19 @@ class Ubuntu(Linux):
"""Collect metadata about the OS""" """Collect metadata about the OS"""
super(Ubuntu, self)._do_collect_metadata() super(Ubuntu, self)._do_collect_metadata()
apps = self.image.g.inspect_list_applications(self.root)
for app in apps: regexp = re.compile('^(k|l|x)?ubuntu-desktop$')
if app['app_name'] == 'kubuntu-desktop': variant = ""
self.meta['OS'] = 'kubuntu' for app in self.image.g.inspect_list_applications(self.root):
descr = self.meta['DESCRIPTION'].replace('Ubuntu', 'Kubuntu') match = regexp.match(app['app_name'])
self.meta['DESCRIPTION'] = descr if match:
variant = match.group(1) + 'ubuntu'
break break
if variant:
self.meta['OS'] = variant
descr = self.meta['DESCRIPTION'].replace('Ubuntu',
variant.capitalize())
self.meta['DESCRIPTION'] = descr
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai : # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment