diff options
author | Mandrake <mandrake@mandriva.com> | 2006-09-12 10:57:40 +0000 |
---|---|---|
committer | Mandrake <mandrake@mandriva.com> | 2006-09-12 10:57:40 +0000 |
commit | 862faaf416eb543c96514be8ff161e25bf51391d (patch) | |
tree | fc777645281a082daea4244fb48cebf2f6640637 /lib/Youri | |
parent | ebcaa03738159dcdfcc4e7dfd82d9828964c02b7 (diff) | |
download | mga-youri-core-862faaf416eb543c96514be8ff161e25bf51391d.tar mga-youri-core-862faaf416eb543c96514be8ff161e25bf51391d.tar.gz mga-youri-core-862faaf416eb543c96514be8ff161e25bf51391d.tar.bz2 mga-youri-core-862faaf416eb543c96514be8ff161e25bf51391d.tar.xz mga-youri-core-862faaf416eb543c96514be8ff161e25bf51391d.zip |
alter the get_obsoleted version, the filter should be deported into URPM.pm, but working for now
Diffstat (limited to 'lib/Youri')
-rw-r--r-- | lib/Youri/Repository.pm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/Youri/Repository.pm b/lib/Youri/Repository.pm index 255d217..30bd520 100644 --- a/lib/Youri/Repository.pm +++ b/lib/Youri/Repository.pm @@ -181,7 +181,10 @@ sub get_obsoleted_packages { my @packages; foreach my $obsolete ($package->get_obsoletes()) { my $pattern = $self->get_package_class()->get_pattern($obsolete->[Youri::Package::DEPENDENCY_NAME]); - push(@packages, + my $obs = $obsolete->[Youri::Package::DEPENDENCY_NAME]; + my $range = $obsolete->[Youri::Package::DEPENDENCY_RANGE]; + my @list; + push(@list, map { $self->get_package_class()->new(file => $_) } $self->get_files( $self->{_install_root}, @@ -189,7 +192,23 @@ sub get_obsoleted_packages { $pattern ) ); + my ($flag, $version) = $range =~ /(\S+)\s+(.*)/; + if ($version) { + my ($epoch, $ver, $release) = $version =~ /(?:(\d+):)?([^-]+(?:-[^-]*)?)/; + $release ||= '0'; + $epoch ||= '0'; + $range = "$flag $epoch-$ver-$release"; + print "Potential obsolete: @list\n"; + push @packages, grep { + my $full_version = $_->get_full_version; + print "Comparing $range with $full_version\n"; + URPM::ranges_overlap($range, "== $full_version") + } @list; + } else { + push @packages, @list + } } + print "Obsoleted: @packages\n"; return @packages; } |