summaryrefslogtreecommitdiffstats
path: root/lib/MGA
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-07-31 23:16:41 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-07-31 23:19:41 +0100
commit0f9fc83390f96e0c740b13a8ba809b7ef64f542d (patch)
tree3bc349328610d77795c8c1b2d9114a68580c9864 /lib/MGA
parentecf33b2dc64167dfa93a0acc60579fa3314abd6c (diff)
downloaddrakiso-0f9fc83390f96e0c740b13a8ba809b7ef64f542d.tar
drakiso-0f9fc83390f96e0c740b13a8ba809b7ef64f542d.tar.gz
drakiso-0f9fc83390f96e0c740b13a8ba809b7ef64f542d.tar.bz2
drakiso-0f9fc83390f96e0c740b13a8ba809b7ef64f542d.tar.xz
drakiso-0f9fc83390f96e0c740b13a8ba809b7ef64f542d.zip
drakclassic: filter out obsolete packages when calculating dependencies.
Diffstat (limited to 'lib/MGA')
-rw-r--r--lib/MGA/DrakISO/BuildMedia.pm17
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
###############################################################################