be more specific about conflict handling: conflicts can be registered at

any level in the dependency tree, but we shouldn't mark as conflicting packages
that do depend on each other or that have common dependencies.

Issue noticed by alek@ on plone vs. zope.
This commit is contained in:
espie 2005-12-12 13:37:21 +00:00
parent 9376b211df
commit f755566506
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $OpenBSD: find-all-conflicts,v 1.10 2005/09/04 22:34:23 espie Exp $
# $OpenBSD: find-all-conflicts,v 1.11 2005/12/12 13:37:21 espie Exp $
# Copyright (c) 2000-2005
# Marc Espie. All rights reserved.
# Redistribution and use in source and binary forms, with or without
@ -77,6 +77,7 @@ my $cache2 = {};
sub find_a_conflict
{
my ($conflicts, $deps, $pkg, $pkg2) = @_;
return 0 if $pkg eq $pkg2;
if (defined $conflicts->{$pkg} && $conflicts->{$pkg}->conflicts_with($pkg2)) {
return 1;
@ -113,7 +114,7 @@ sub compute_problems
for my $pkg (@$l) {
my $keepit = 0;
for my $pkg2 (@$l) {
next if $pkg2 eq $pkg;
next if $pkg eq $pkg2;
if (!(find_a_conflict($conflicts, $deps, $pkg, $pkg2) ||
find_a_conflict($conflicts, $deps, $pkg2, $pkg))) {
$keepit = 1;

View File

@ -1,6 +1,6 @@
#! /usr/bin/perl
# $OpenBSD: find-plist-issues,v 1.3 2005/09/13 20:48:41 espie Exp $
# $OpenBSD: find-plist-issues,v 1.4 2005/12/12 13:37:21 espie Exp $
# Copyright (c) 2000-2005
# Marc Espie. All rights reserved.
# Redistribution and use in source and binary forms, with or without
@ -145,6 +145,7 @@ my @available = ();
sub find_a_conflict
{
my ($conflicts, $deps, $pkg, $pkg2) = @_;
return 0 if $pkg2 eq $pkg;
if (defined $conflicts->{$pkg} && $conflicts->{$pkg}->conflicts_with($pkg2)) {
return 1;
@ -179,9 +180,10 @@ sub compute_conflicts
# create a list of unconflicting packages.
my $l2 = [];
for my $pkg (@$l) {
my $keepit = 0;
my $keepit = 0;
for my $pkg2 (@$l) {
next if $pkg2 eq $pkg;
next if $pkg eq $pkg2;
if (!(find_a_conflict($conflicts, $deps, $pkg, $pkg2) ||
find_a_conflict($conflicts, $deps, $pkg2, $pkg))) {
$keepit = 1;