summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2022-10-02 14:07:32 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2022-10-02 14:07:32 +0100
commitc0321832a7b190873cd198fa279f4cb1dadd63d2 (patch)
tree685381ac164cfc0001a57304de18479a135daefe /lib/MGA/DrakISO
parent1ab4a92f0d6713cd316e46ad9a6b5c7d83ab0417 (diff)
downloaddrakiso-c0321832a7b190873cd198fa279f4cb1dadd63d2.tar
drakiso-c0321832a7b190873cd198fa279f4cb1dadd63d2.tar.gz
drakiso-c0321832a7b190873cd198fa279f4cb1dadd63d2.tar.bz2
drakiso-c0321832a7b190873cd198fa279f4cb1dadd63d2.tar.xz
drakiso-c0321832a7b190873cd198fa279f4cb1dadd63d2.zip
Optimise BuildMedia::check_installer_media().
- use the rpmcheck -compressed-input option to allow the hdlist.cz files to be read directly - use the rpmcheck -base option when checking other sections to avoid rechecking the packages in the core section.
Diffstat (limited to 'lib/MGA/DrakISO')
-rw-r--r--lib/MGA/DrakISO/BuildMedia.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/MGA/DrakISO/BuildMedia.pm b/lib/MGA/DrakISO/BuildMedia.pm
index ffff043..8f2717a 100644
--- a/lib/MGA/DrakISO/BuildMedia.pm
+++ b/lib/MGA/DrakISO/BuildMedia.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 Mageia
+# Copyright (C) 2017-2022 Mageia
# Martin Whitaker <mageia@martin-whitaker.me.uk>
#
# This program is free software; you can redistribute it and/or modify
@@ -101,8 +101,10 @@ sub prepare_media {
build_installer_media($build);
- check_installer_media($build, ${$build->{urpmi_media}{enabled_sections}}[0]);
- check_installer_media($build, '*');
+ my $base_section = ${$build->{urpmi_media}{enabled_sections}}[0];
+ foreach my $section (@{$build->{urpmi_media}{enabled_sections}}) {
+ check_installer_media($build, $section, $base_section);
+ }
my $arch_dir = $build->get_build_dir('files/' . $build->{settings}{arch});
@@ -552,14 +554,15 @@ sub create_media_cfg {
}
sub check_installer_media {
- my ($build, $section) = @_;
+ my ($build, $section, $base_section) = @_;
print "Checking installer media [$section]\n" if $::verbose;
my $arch = $build->{settings}{arch};
my $media_dir = $build->get_build_dir('files/' . $arch . '/media');
my $log_file = $build->get_build_dir('tmp') . '/rpmcheck.log';
- run_("zcat -q $media_dir/$section/media_info/hdlist.cz | rpmcheck -explain -failures > $log_file")
+ my $base = $section ne $base_section ? "-base $media_dir/$base_section/media_info/hdlist.cz" : "";
+ run_("cat $media_dir/$section/media_info/hdlist.cz | rpmcheck -explain -failures -compressed-input $base > $log_file")
or die "ERROR: failed to run rpmcheck\n";
if (system('grep', '-q', 'FAILED', $log_file) == 0) {