%import re %def repository_identification(%%repository) %set %%repository_re = re.compile(r'^((deb)|(deb-src)) (\[ .* \] )?(((http)|(https)|(ftp)|(ftps))://(?P\S+)) (?P(\S+))(?P(( \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