Skip to content

Commit 6b5e0ce

Browse files
committed
Revert "build: auto-generate CONFLICTS for package variants sharing PROVIDES"
This reverts commit 6d5c71f. Since we have recovered the previous state regarding package variants sharing PROVIDES and how package manager(apk) handle packages conflict in general, we no longer need to auto-generate CONFLICTS for them. VARIANTs that share PROVIDES can be installed together as long as they do not share files, which is the expected behavior. Defining explicit CONFLICTS to avoid simultaneous selection on menuconfig should be the preferred way to allow packagers decide whether packages must conflict or not. Now, apk package manager will apply the same conflicts as kconfig/menuconfig based on the CONFLICTS field if defined, not because of some PROVIDES field definition pattern. (apk internally uses provides field for conflicts at package level but we abtract that using our specific CONFLICTS field for that purpose) Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
1 parent 8f443af commit 6b5e0ce

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

scripts/package-metadata.pl

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -255,52 +255,6 @@ sub mconf_conflicts {
255255
return $res;
256256
}
257257

258-
sub add_implicit_provides_conflicts {
259-
foreach my $provide (keys %vpackage) {
260-
next if $provide =~ /-any$/;
261-
262-
my $providers = $vpackage{$provide};
263-
next unless $providers && @$providers > 1;
264-
265-
my $default_pkg;
266-
my @non_defaults;
267-
268-
foreach my $pkg (@$providers) {
269-
next if $pkg->{buildonly};
270-
if ($pkg->{variant_default}) {
271-
$default_pkg = $pkg;
272-
} else {
273-
push @non_defaults, $pkg;
274-
}
275-
}
276-
277-
next unless $default_pkg && @non_defaults;
278-
279-
my %existing_conflicts;
280-
if ($default_pkg->{conflicts}) {
281-
%existing_conflicts = map { $_ => 1 } @{$default_pkg->{conflicts}};
282-
}
283-
284-
foreach my $non_default (@non_defaults) {
285-
next if $existing_conflicts{$non_default->{name}};
286-
287-
my $already_conflicts = 0;
288-
if ($non_default->{conflicts}) {
289-
foreach my $c (@{$non_default->{conflicts}}) {
290-
if ($c eq $default_pkg->{name}) {
291-
$already_conflicts = 1;
292-
last;
293-
}
294-
}
295-
}
296-
next if $already_conflicts;
297-
298-
$default_pkg->{conflicts} ||= [];
299-
push @{$default_pkg->{conflicts}}, $non_default->{name};
300-
}
301-
}
302-
}
303-
304258
sub print_package_config_category($) {
305259
my $cat = shift;
306260
my %menus;
@@ -396,7 +350,6 @@ ()
396350

397351
sub gen_package_config() {
398352
parse_package_metadata($ARGV[0]) or exit 1;
399-
add_implicit_provides_conflicts();
400353
print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault n\n";
401354
print "source \"package/*/image-config.in\"\n";
402355
if (scalar glob "package/feeds/*/*/image-config.in") {

0 commit comments

Comments
 (0)