diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-03 10:35:30 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-03 10:35:30 +0000 |
commit | 723f59f8182198361ec3339e21e1454d9fd9f855 (patch) | |
tree | 8e049b003f6d795c13778363dfa62cc47b591740 | |
parent | 705699cd23aba9c19ce48bfece7895f393344b1b (diff) | |
download | urpmi-723f59f8182198361ec3339e21e1454d9fd9f855.tar urpmi-723f59f8182198361ec3339e21e1454d9fd9f855.tar.gz urpmi-723f59f8182198361ec3339e21e1454d9fd9f855.tar.bz2 urpmi-723f59f8182198361ec3339e21e1454d9fd9f855.tar.xz urpmi-723f59f8182198361ec3339e21e1454d9fd9f855.zip |
Filter out selection of delta rpm packages that won't be installable
-rw-r--r-- | urpm.pm | 30 |
1 files changed, 27 insertions, 3 deletions
@@ -2461,8 +2461,11 @@ sub get_source_packages { next; } elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) { my ($fullname) = keys(%{$file2fullnames{$filename} || {}}); - defined($id = $fullname2id{$fullname}) - and $sources{$id} = $medium->{virtual} ? "$medium->{url}/$_" : $_; + if (defined($id = $fullname2id{$fullname})) { + if (!/\.delta\.rpm$/ || $urpm->is_delta_installable($urpm->{depslist}[$id], $options{root})) { + $sources{$id} = $medium->{virtual} ? "$medium->{url}/$_" : $_; + } + } $list_examined{$fullname} = $examined{$fullname} = undef; } } else { @@ -2491,7 +2494,11 @@ sub get_source_packages { my ($fullname) = keys(%{$file2fullnames{$fi} || {}}); unless (exists($list_examined{$fullname})) { ++$list_warning; - defined($id = $fullname2id{$fullname}) and $sources{$id} = "$medium->{url}/" . $fi; + if (defined($id = $fullname2id{$fullname})) { + if ($fi !~ /\.delta\.rpm$/ || $urpm->is_delta_installable($urpm->{depslist}[$id], $options{root})) { + $sources{$id} = "$medium->{url}/" . $fi; + } + } $examined{$fullname} = undef; } } @@ -2519,6 +2526,23 @@ sub get_source_packages { $error ? @{[]} : (\%local_sources, \@list); } +sub is_delta_installable { + my ($urpm, $pkg, $root) = @_; + $pkg->flag_installed or return 0; + my $f = $pkg->filename; + my $n = $pkg->name; + my ($v_match) = $f =~ /^\Q$n\E-(.*)_.+\.delta\.rpm$/; + my $db = URPM::DB::open($root) + or $urpm->{fatal}(9, N("unable to open rpmdb")); + my $v_installed; + $db->traverse(sub { + my ($p) = @_; + $p->name eq $n and $v_installed = $p->version . '-' . $p->release; + }); + return 0 if $v_match ne $v_installed; + 1; +} + #- download package that may need to be downloaded. #- make sure header are available in the appropriate directory. #- change location to find the right package in the local |