diff options
Diffstat (limited to 'lib/MGA/DrakISO')
-rw-r--r-- | lib/MGA/DrakISO/BuildMedia.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/MGA/DrakISO/BuildMedia.pm b/lib/MGA/DrakISO/BuildMedia.pm index b4479d9..81ce9c7 100644 --- a/lib/MGA/DrakISO/BuildMedia.pm +++ b/lib/MGA/DrakISO/BuildMedia.pm @@ -201,6 +201,7 @@ sub get_available_packages { $package{$name}{base_pkg} = $pkg; } }); + } ############################################################################### @@ -397,6 +398,7 @@ sub update_dependencies() { my @requires = $pkg->requires_nosense; $urpm->traverse_tag('whatprovides', \@requires, sub { my ($pkg) = @_; + return if is_obsolete($urpm, $pkg); my $name = $pkg->name; # kernel and kmod packages embed the kernel version and release # in the package name (and always have a version-release of 1-1) @@ -430,6 +432,21 @@ sub update_dependencies() { report_package_count(); } +sub is_obsolete { + my ($urpm, $pkg) = @_; + + # This is derived from URPM::Resolve::_find_packages_obsoleting(). The + # arch compatibility checks have been dropped, as we know we only have + # one arch in our urpmi database. + my @obsoleting_pakages = grep { + $_ && !$_->flag_skip + && $_->obsoletes_overlap($pkg->name . " == " . $pkg->epoch . ":" . $pkg->version . "-" . $pkg->release) + && $_->fullname ne $pkg->fullname; + } $urpm->packages_obsoleting($pkg->name); + + @obsoleting_pakages > 0; +} + ############################################################################### # Installation Media Generation ############################################################################### |