From b8edaa009697a36fdd09b159d8ad28a3b126776c Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Mon, 27 Aug 2018 14:51:09 +0100 Subject: drakclassic: a few name changes to improve readability. --- lib/MGA/DrakISO/BuildMedia.pm | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'lib') diff --git a/lib/MGA/DrakISO/BuildMedia.pm b/lib/MGA/DrakISO/BuildMedia.pm index 1e545b9..10fe0ea 100644 --- a/lib/MGA/DrakISO/BuildMedia.pm +++ b/lib/MGA/DrakISO/BuildMedia.pm @@ -17,9 +17,9 @@ # SYNOPSIS # -------- -# This package provides a function to create the installation media that will -# be used by the classic installer and to collect together the various other -# files that are needed on the installer ISO. +# This package provides a function to create the urpmi media that will be used +# by the classic installer and to generate the product.id and package.lst +# files that will be included in the installer ISO image. package MGA::DrakISO::BuildMedia; @@ -99,7 +99,7 @@ sub prepare_media { build_installer_media($build); - check_installer_media($build, ${$build->{repo}{classes}}[0]); + check_installer_media($build, ${$build->{urpmi_media}{enabled_sections}}[0]); check_installer_media($build, '*'); my $arch_dir = $build->get_build_dir('files/' . $build->{settings}{arch}); @@ -144,10 +144,10 @@ sub prepare_urpmi_media { my %media_valid; my $repo = $build->{settings}{repository}; my $arch = $build->{settings}{arch}; - foreach my $class (@{$build->{repo}{classes}}) { - foreach my $type (@{$build->{repo}{types}}) { - my $name = $class . '-' . $type; - my $url = $repo . '/' . $arch . '/media/' . $class . '/' . $type; + foreach my $section (@{$build->{urpmi_media}{enabled_sections}}) { + foreach my $subsection (@{$build->{urpmi_media}{enabled_subsections}}) { + my $name = $section . '-' . $subsection; + my $url = $repo . '/' . $arch . '/media/' . $section . '/' . $subsection; if ($media{$name} eq $url) { # This medium already exists, so we just need to make sure it # is up to date. @@ -186,7 +186,7 @@ sub get_available_packages { urpm::media::configure($urpm); - my $base_class = ${$build->{repo}{classes}}[0]; + my $base_section = ${$build->{urpmi_media}{enabled_sections}}[0]; $urpm->traverse(sub { my ($pkg) = @_; @@ -196,7 +196,7 @@ sub get_available_packages { if (!defined $package{$name} || $pkg->compare_pkg($package{$name}{best_pkg}) > 0) { $package{$name}{best_pkg} = $pkg; } - return if $medium[0]->{name} !~ /^$base_class/; + return if $medium[0]->{name} !~ /^$base_section/; if (!defined $package{$name}{base_pkg} || $pkg->compare_pkg($package{$name}{base_pkg}) > 0) { $package{$name}{base_pkg} = $pkg; } @@ -462,13 +462,13 @@ sub build_installer_media { my $media_dir = $arch_dir . '/media/'; rm_rf($media_dir) if -e $media_dir; mkdir_p($media_dir . 'media_info'); - mkdir_p($media_dir . $_ . '/media_info') foreach @{$build->{repo}{classes}}; + mkdir_p($media_dir . $_ . '/media_info') foreach @{$build->{urpmi_media}{enabled_sections}}; print " adding RPMs\n" if $::verbose > 1; # Find the URLs for the selected RPMs and add them to the appropriate # media directory. Note that in the installation media there is only a - # single medium for each class, so we ignore the source media type. + # single medium for each section, so we ignore the source media subsection. my @packages = grep { defined $package{$_}{class} } keys %package; foreach my $name (@packages) { foreach my $pkg (uniq($package{$name}{best_pkg}, $package{$name}{base_pkg})) { @@ -486,12 +486,12 @@ sub build_installer_media { print " generating media info\n" if $::verbose > 1; # Copy the pubkeys from the repository. Use the pubkeys from the first - # media type in each class. + # media subsection in each section. my $repo_media_dir = $build->{settings}{repository} . '/' . $arch . '/media/'; - my $prime_type = ${$build->{repo}{types}}[0]; - foreach my $class (@{$build->{repo}{classes}}) { - my $pubkey = $repo_media_dir . $class . '/' . $prime_type . '/media_info/pubkey'; - copy_or_link($pubkey, $media_dir . $class . '/media_info/pubkey'); + my $first_subsection = ${$build->{urpmi_media}{enabled_subsections}}[0]; + foreach my $section (@{$build->{urpmi_media}{enabled_sections}}) { + my $pubkey = $repo_media_dir . $section . '/' . $first_subsection . '/media_info/pubkey'; + copy_or_link($pubkey, $media_dir . $section . '/media_info/pubkey'); } # Create the media config file. @@ -526,26 +526,26 @@ sub create_media_cfg { print $f "askmedia=1\n" if $build->{media_cfg}{askmedia}; print $f "suppl=1\n" if $build->{media_cfg}{suppl}; print $f "xml-info=1\n" if $build->{media_cfg}{xml_info}; - foreach my $class (@{$build->{repo}{classes}}) { + foreach my $section (@{$build->{urpmi_media}{enabled_sections}}) { print $f "\n"; - print $f "[$class]\n"; - print $f "synthesis=../$class/media_info/synthesis.hdlist.cz\n"; - print $f "hdlist=../$class/media_info/hdlist.cz\n"; - print $f "pubkey=../$class/media_info/pubkey\n"; - print $f "name=" . ucfirst($class) . " Release (Installer)\n"; + print $f "[$section]\n"; + print $f "synthesis=../$section/media_info/synthesis.hdlist.cz\n"; + print $f "hdlist=../$section/media_info/hdlist.cz\n"; + print $f "pubkey=../$section/media_info/pubkey\n"; + print $f "name=" . ucfirst($section) . " Release (Installer)\n"; } close $f; } sub check_installer_media { - my ($build, $class) = @_; + my ($build, $section) = @_; - print "Checking installer media [$class]\n" if $::verbose; + 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/$class/media_info/hdlist.cz | rpmcheck -explain -failures > $log_file") + run_("zcat -q $media_dir/$section/media_info/hdlist.cz | rpmcheck -explain -failures > $log_file") or die "ERROR: failed to run rpmcheck\n"; if (system('grep', '-q', 'FAILED', $log_file) == 0) { -- cgit v1.2.1