Un saut de ligne est nécessaire que les blocs soient bien interprétés

This commit is contained in:
Benjamin Bohard 2020-12-04 17:25:42 +01:00
parent 963dfe22a3
commit 244142f50a

View File

@ -1,12 +1,10 @@
%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
%set %%repositories_detail = {}
%for %%additional_repository in %%getVar('additional_repository_name')
%silent %%repositories_detail[%%str(%%additional_repository)] = {'source': %%additional_repository.additional_repository_source, 'priority': 500, 'exceptions': []}
@ -19,7 +17,6 @@
%end if
%end if
%end for
%for %%repository in %%repositories_detail
Package: *
Pin: release %%repository_identification(%%repositories_detail[%%repository]['source'])
@ -28,6 +25,8 @@ Pin-Priority: %%repositories_detail[%%repository]['priority']
Package: %%exception
Pin: release %%repository_identification(%%repositories_detail[%%repository]['source'])
Pin-Priority: 500
%end for
%end for