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,19 +140,27 @@ class KiwiExporter(object):
:param node: :param node:
:return: :return:
''' '''
if self.__grains__.get('os_family') in ('Kali', 'Debian'): priority = 99
pass
elif self.__grains__.get('os_family', '') == 'Suse': for repo_id, repo_data in self._data.software.get('repositories', {}).items():
priority = 99 if type(repo_data) == list:
for repo_id, repo_data in self._data.software.get('repositories', {}).items(): repo_data = repo_data[0]
if repo_data['enabled']: if repo_data.get('enabled') or not repo_data.get('disabled'): # RPM and Debian, respectively
repo = etree.SubElement(node, 'repository') uri = repo_data.get('baseurl', repo_data.get('uri'))
if not uri:
continue
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):
''' '''