16 lines
658 B
Plaintext
16 lines
658 B
Plaintext
|
%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
|