mtes-geomatique/tmpl/99-additional_repositories

16 lines
658 B
Plaintext
Raw Normal View History

2020-12-01 10:46:58 +01:00
%import re
%def repository_identification(%%repository)
%set %%repository_re = re.compile(r'^((deb)|(deb-src)) (\[ .* \] )?(((http)|(https)|(ftp)|(ftps))://(?P<url>\S+)) (?P<suite>(\S+))(?P<components>(( \S+)+)?)')
%set %%elements = %%repository_re.match(%%repository).groupdict()
%return 'o={},a={},c={}'.format(%%elements['url'].split('/')[0], %%elements['suite'], %%elements['components'].strip())
%return %%repository
%end def
%for %%repository in %%getVar('additional_repository_name', [])
Package: *
Pin: release %%repository_identification(%%repository.additional_repository_source)
Pin-Priority: %%additional_repository_global_priority
%end for