Add Debian support for the repo generator

This commit is contained in:
Bo Maryniuk 2016-06-10 01:16:06 +02:00
parent 6280ad137e
commit ad45a265f5

View File

@ -140,18 +140,26 @@ class KiwiExporter(object):
:param node: :param node:
:return: :return:
''' '''
if self.__grains__.get('os_family') in ('Kali', 'Debian'):
pass
elif self.__grains__.get('os_family', '') == 'Suse':
priority = 99 priority = 99
for repo_id, repo_data in self._data.software.get('repositories', {}).items(): for repo_id, repo_data in self._data.software.get('repositories', {}).items():
if repo_data['enabled']: if type(repo_data) == list:
repo_data = repo_data[0]
if repo_data.get('enabled') or not repo_data.get('disabled'): # RPM and Debian, respectively
uri = repo_data.get('baseurl', repo_data.get('uri'))
if not uri:
continue
repo = etree.SubElement(node, 'repository') repo = etree.SubElement(node, 'repository')
if self.__grains__.get('os_family') in ('Kali', 'Debian'):
repo.set('alias', repo_id)
repo.set('distribution', repo_data['dist'])
else:
repo.set('alias', repo_data['alias']) repo.set('alias', repo_data['alias'])
if self.__grains__.get('os_family', '') == 'Suse':
repo.set('type', 'yast2') # TODO: Check for options! repo.set('type', 'yast2') # TODO: Check for options!
repo.set('priority', str(priority)) repo.set('priority', str(priority))
source = etree.SubElement(repo, 'source') source = etree.SubElement(repo, 'source')
source.set('path', repo_data['baseurl']) source.set('path', uri) # RPM and Debian, respectively
priority -= 1 priority -= 1
def _set_packages(self, node): def _set_packages(self, node):