diff options
author | Johannes Schauer <j.schauer@email.de> | 2014-08-19 07:57:03 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-06 02:07:31 +0200 |
commit | 98956c26a2d8039b8ec66231910fc9418329c09b (patch) | |
tree | 6c9753140b6cde5be9ceefe392181251e1d242da /scripts/Dpkg/Deps.pm | |
parent | 61e228eb7b68b85529dc8e9c9c49ef7f51a797bb (diff) | |
download | dpkg-98956c26a2d8039b8ec66231910fc9418329c09b.tar.gz |
scripts: Update restriction formula syntax
- The restriction list parsing now reflects the changes at
<https://wiki.debian.org/BuildProfileSpec> which were agreed upon
in the bootstrap sprint 2014 in Paris.
- Restriction lists are now restriction formulas.
- Restriction formulas are given in disjunctive normal form expression:
pkg <bar baz> <blub>
- Removal of the implicit prefix/namespace mechanic.
- Since there can be more than one <> block, the regex in
parse_string() in Dpkg::Deps is now greedy.
- Construct the profiles entry of the Packages-List field by converting
the "<bar baz> <blub>" syntax into "bar,baz+blub".
- Include a temporary compatibility mapping for the old way to write
the Build-Profiles field in binary packages which can be removed once
all affected source packages have moved to the new syntax.
- Adjust testcases.
Closes: #760158
[guillem@debian.org:
- Add a warning when using the old syntax in dpkg-source.
- Move comments before the regexes, not besides them in dpkg-source.
- Change from an xnor to == in evaluate_restriction_formula().
- Move the Dpkg::Util import close to the other Dpkg imports.
- Add test cases for the new parse_build_profiles() behavior. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
Diffstat (limited to 'scripts/Dpkg/Deps.pm')
-rw-r--r-- | scripts/Dpkg/Deps.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm index d40366e8b..99945fc8e 100644 --- a/scripts/Dpkg/Deps.pm +++ b/scripts/Dpkg/Deps.pm @@ -209,15 +209,16 @@ Define the active build profiles. By default no profile is defined. =item reduce_profiles (defaults to 0) If set to 1, ignore dependencies that do not concern the current build -profile. This implicitly strips off the profile restriction list so +profile. This implicitly strips off the profile restriction formula so that the resulting dependencies are directly applicable to the current profiles. =item reduce_restrictions (defaults to 0) If set to 1, ignore dependencies that do not concern the current set of -restrictions. This implicitly strips off any restriction list so that the -resulting dependencies are directly applicable to the current restriction. +restrictions. This implicitly strips off any architecture restriction list +or restriction formula so that the resulting dependencies are directly +applicable to the current restriction. This currently implies C<reduce_arch> and C<reduce_profiles>, and overrides them if set. @@ -601,7 +602,7 @@ sub parse_string { )? # end of optional architecture (?: # start of optional restriction \s* < # open bracket for restriction - \s* (.*?) # don't parse restrictions now + \s* (.*) # do not parse restrictions now \s* > # closing bracket )? # end of optional restriction \s*$ # trailing spaces at end @@ -636,7 +637,9 @@ sub output { $res .= ' [' . join(' ', @{$self->{arches}}) . ']'; } if (defined($self->{restrictions})) { - $res .= ' <' . join(' ', @{$self->{restrictions}}) . '>'; + for my $restrlist (@{$self->{restrictions}}) { + $res .= ' <' . join(' ', @{$restrlist}) . '>'; + } } if (defined($fh)) { print { $fh } $res; |