diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_any.pm | 26 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 30 |
2 files changed, 28 insertions, 28 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 661de041d..0b1ce16b6 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -53,8 +53,8 @@ sub useMedium($) { $asked_medium = $_[0]; } sub changeMedium($$) { - my ($method, $medium) = @_; - log::l("change to medium $medium for method $method (refused by default)"); + my ($method, $medium_name) = @_; + log::l("change to medium $medium_name for method $method (refused by default)"); 0; } sub relGetFile($) { @@ -66,13 +66,13 @@ sub relGetFile($) { $_; } sub askChangeMedium($$) { - my ($method, $medium) = @_; + my ($method, $medium_name) = @_; my $allow; do { - local $::o->{method} = $method = 'cdrom' if $medium =~ /^\d+s$/; #- Suppl CD - eval { $allow = changeMedium($method, $medium) }; + local $::o->{method} = $method = 'cdrom' if $medium_name =~ /^\d+s$/; #- Suppl CD + eval { $allow = changeMedium($method, $medium_name) }; } while $@; #- really it is not allowed to die in changeMedium!!! or install will cores with rpmlib!!! - log::l($allow ? "accepting medium $medium" : "refusing medium $medium"); + log::l($allow ? "accepting medium $medium_name" : "refusing medium $medium_name"); $allow; } @@ -371,7 +371,7 @@ sub setPackages { && $o->ask_yesorno('', N("Do you have a supplementary CD to install?"), 0)) { #- by convention, the media names for suppl. CDs match /^\d+s$/ - my $medium = '1s'; #- supplement 1 + my $medium_name = '1s'; #- supplement 1 local $::isWizard = 0; local $o->{method} = 'cdrom'; (my $cdromdev) = detect_devices::cdroms(); @@ -382,17 +382,17 @@ sub setPackages { if ($o->ask_okcancel('', N("Insert the CD"), 1)) { mountCdrom("/mnt/cdrom", $cdrom); log::l($@) if $@; - useMedium($medium); + useMedium($medium_name); my $supplmedium = pkgs::psUsingHdlist( $o->{prefix}, # /mnt 'cdrom', $o->{packages}, - "hdlist$medium.cz", - $medium, + "hdlist$medium_name.cz", + $medium_name, 'media/main', - "Supplementary CD $medium", + "Supplementary CD $medium_name", 1, # selected - "/mnt/cdrom/media/main/media_info/hdlist$medium.cz", + "/mnt/cdrom/media/main/media_info/hdlist$medium_name.cz", ); if ($supplmedium) { log::l("read suppl hdlist"); @@ -403,7 +403,7 @@ sub setPackages { log::l("no suppl hdlist"); } #- TODO loop if there are several supplementary CDs - # ++$medium; $medium .= "s"; + # ++$medium_name; $medium_name .= "s"; } } else { $suppl_CDs = 0; diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 5a31480e1..264818fae 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -228,8 +228,8 @@ sub allMediums { sort { $a <=> $b } keys %{$packages->{mediums}}; } sub mediumDescr { - my ($packages, $medium) = @_; - $packages->{mediums}{$medium}{descr}; + my ($packages, $medium_name) = @_; + $packages->{mediums}{$medium_name}{descr}; } sub packageRequest { @@ -387,7 +387,7 @@ sub psUsingHdlists { @$packages{qw(count mediums)} = (0, {}); #- parse hdlists file. - my $medium = 1; + my $medium_name = 1; foreach (<$listf>) { chomp; s/\s*#.*$//; @@ -399,9 +399,9 @@ sub psUsingHdlists { #- make sure the first medium is always selected! #- by default select all image. - psUsingHdlist($prefix, $method, $packages, $2, $medium, $3, $4, !$1); + psUsingHdlist($prefix, $method, $packages, $2, $medium_name, $3, $4, !$1); - ++$medium; + ++$medium_name; } log::l("psUsingHdlists read " . int(@{$packages->{depslist}}) . @@ -411,17 +411,17 @@ sub psUsingHdlists { } sub psUsingHdlist { - my ($prefix, $method, $packages, $hdlist, $medium, $rpmsdir, $descr, $selected, $o_fhdlist, $o_pubkey) = @_; - my $fakemedium = "$descr ($method$medium)"; + my ($prefix, $method, $packages, $hdlist, $medium_name, $rpmsdir, $descr, $selected, $o_fhdlist, $o_pubkey) = @_; + my $fakemedium = "$descr ($method$medium_name)"; my $urpmidir = urpmidir($prefix); - log::l("trying to read $hdlist for medium $medium"); + log::l("trying to read $hdlist for medium $medium_name"); #- if the medium already exist, use it. - $packages->{mediums}{$medium} and return $packages->{mediums}{$medium}; + $packages->{mediums}{$medium_name} and return $packages->{mediums}{$medium_name}; my $m = { hdlist => $hdlist, method => $method, - medium => $medium, + medium => $medium_name, rpmsdir => $rpmsdir, #- where is RPMS directory. descr => $descr, fakemedium => $fakemedium, @@ -458,13 +458,13 @@ sub psUsingHdlist { } #- integrate medium in media list, only here to avoid download error (update) to be propagated. - $packages->{mediums}{$medium} = $m; + $packages->{mediums}{$medium_name} = $m; #- avoid using more than one medium if Cd is not ejectable. #- but keep all medium here so that urpmi has the whole set. $m->{ignored} ||= ( - install_any::method_allows_medium_change($method) && $medium > 1 #- first cdrom - && $medium !~ /^\d+s/ #- not a suppl. CD + install_any::method_allows_medium_change($method) && $medium_name > 1 #- first cdrom + && $medium_name !~ /^\d+s/ #- not a suppl. CD && !common::usingRamdisk()); #- parse synthesis (if available) of directly hdlist (with packing). @@ -476,12 +476,12 @@ sub psUsingHdlist { } elsif (-s $newf) { ($m->{start}, $m->{end}) = $packages->parse_hdlist($newf, 1); } else { - delete $packages->{mediums}{$medium}; + delete $packages->{mediums}{$medium_name}; unlink $newf; $o_fhdlist or unlink $newsf; die "fatal: no hdlist nor synthesis to read for $fakemedium"; } - $m->{start} > $m->{end} and do { delete $packages->{mediums}{$medium}; + $m->{start} > $m->{end} and do { delete $packages->{mediums}{$medium_name}; unlink $newf; $o_fhdlist or unlink $newsf; die "fatal: nothing read in hdlist or synthesis for $fakemedium" }; |