From c0321832a7b190873cd198fa279f4cb1dadd63d2 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 2 Oct 2022 14:07:32 +0100 Subject: 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. --- lib/MGA/DrakISO/BuildMedia.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/MGA/DrakISO') 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 # # 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) { -- cgit v1.2.1