diff options
-rw-r--r-- | URPM.pm | 9 | ||||
-rw-r--r-- | URPM.xs | 5 | ||||
-rw-r--r-- | URPM/Resolve.pm | 14 | ||||
-rw-r--r-- | perl-URPM.spec | 8 |
4 files changed, 32 insertions, 4 deletions
@@ -6,7 +6,7 @@ use vars qw($VERSION @ISA); require DynaLoader; @ISA = qw(DynaLoader); -$VERSION = '0.10'; +$VERSION = '0.11'; bootstrap URPM $VERSION; @@ -73,6 +73,13 @@ sub traverse_tag { ++$count; } } + } elsif ($tag eq 'whatconflicts') { + foreach (@{$urpm->{depslist} || []}) { + if (grep { /^([^ \[]*)/ && exists $names{$1} } $_->conflicts) { + $callback and $callback->($_); + ++$count; + } + } } elsif ($tag eq 'group') { foreach (@{$urpm->{depslist} || []}) { if (exists $names{$_->group}) { @@ -1593,7 +1593,8 @@ int Pkg_flag_available(pkg) URPM::Package pkg CODE: - RETVAL = pkg->flag & FLAG_INSTALLED || (pkg->flag & FLAG_UPGRADE ? pkg->flag & (FLAG_BASE | FLAG_REQUESTED | FLAG_REQUIRED) : 0); + RETVAL = (pkg->flag & FLAG_INSTALLED && !(pkg->flag & FLAG_UPGRADE)) || + (pkg->flag & FLAG_UPGRADE ? pkg->flag & (FLAG_BASE | FLAG_REQUESTED | FLAG_REQUIRED) : 0); OUTPUT: RETVAL @@ -1774,6 +1775,8 @@ Db_traverse_tag(db,tag,names,callback) rpmtag = RPMTAG_PROVIDENAME; else if (!strcmp(tag, "whatrequires")) rpmtag = RPMTAG_REQUIRENAME; + else if (!strcmp(tag, "whatconflicts")) + rpmtag = RPMTAG_CONFLICTNAME; else if (!strcmp(tag, "group")) rpmtag = RPMTAG_GROUP; else if (!strcmp(tag, "triggeredby")) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 6c1400a..8aafd9e 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -317,6 +317,20 @@ sub resolve_requested { } } } + + #- examine if an existing package does not conflicts with this one. + $db->traverse_tag('whatconflicts', [ $pkg->name ], sub { + my ($p) = @_; + foreach my $property ($p->conflicts) { + if (grep { ranges_overlap($_, $property) } $pkg->provides) { + $state->{conflicts}{$p->fullname}{$pkg->id} = undef; + #- all these packages should be removed. + $options{keep_state} or + $urpm->resolve_closure_ask_remove($db, $state, $p, + { conflicts => $property, pkg => $pkg }); + } + } + }); } if ($options{keep_state}) { diff --git a/perl-URPM.spec b/perl-URPM.spec index 449d8fb..810e941 100644 --- a/perl-URPM.spec +++ b/perl-URPM.spec @@ -1,7 +1,7 @@ %define name perl-URPM %define real_name URPM -%define version 0.10 -%define release 2mdk +%define version 0.11 +%define release 1mdk %{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)} @@ -48,6 +48,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jul 19 2002 François Pons <fpons@mandrakesoft.com> 0.11-1mdk +- added whatconflicts to traverse_tag. +- fixed semantic of flag_available (package installed or selected). + * Tue Jul 16 2002 François Pons <fpons@mandrakesoft.com> 0.10-2mdk - extended selected and available flag to take care of base flag. - improved resolve_requested (use keep_state) and delete |