From dbdda66e1dbce410bc9e35bf1346f681c16bf366 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 4 Apr 2000 15:01:35 +0000 Subject: *** empty log message *** --- perl-install/ChangeLog | 9 ++++++++ perl-install/Xconfigurator.pm | 5 +++-- perl-install/install_any.pm | 8 +++---- perl-install/install_steps_interactive.pm | 17 +++++++++------ perl-install/pkgs.pm | 35 ++++++++++++++++++++----------- 5 files changed, 50 insertions(+), 24 deletions(-) (limited to 'perl-install') diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index e3ab8d249..aed1ad361 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -1,3 +1,12 @@ +2000-04-04 François Pons + + * pkgs.pm: modified selection packages from compssList by + incremental selection, much more quickly. + added selected medium for selecting a package. + * install_any.pm: refused media hash transfered to selected value + of media table. + @needToCopy list should only have package of default medium. + 2000-04-03 Pixel * fs.pm (format_ext2): add options "-b 1024 -O none" for alpha diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 215bf4b26..69d08a5d2 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -332,8 +332,9 @@ sub testFinalConfig($;$$) { open STDERR, ">$f_err"; chroot $prefix if $prefix; exec $o->{card}{prog}, - ($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($::xf4 && $o->{card}{driver} && "-4")), - ":9" or c::_exit(0); + ($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($::xf4 && $o->{card}{driver} && "-4")) : + ())), + ":9" or c::_exit(0); } do { sleep 1 } until c::Xtest(":9") || waitpid($pid, c::WNOHANG()); diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 53926c3ec..943118a72 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -31,7 +31,7 @@ use log; #- package that have to be copied for proper installation (just to avoid changing cdrom) #- here XFree86 is copied entirey if not already installed, maybe better to copy only server. @needToCopy = qw( -XFree86 dhcpcd pump ppp ypbind rhs-printfilters samba ncpfs kernel-fb +XFree86 dhcpxd pump ppp ypbind rhs-printfilters samba ncpfs kernel-fb ); #-###################################################################################### @@ -40,7 +40,6 @@ XFree86 dhcpcd pump ppp ypbind rhs-printfilters samba ncpfs kernel-fb my $postinstall_rpms = ''; my $current_medium = ''; my $asked_medium = ''; -my %refused_media = (); sub useMedium($) { #- before ejecting the first CD, there are some files to copy! #- does nothing if the function has already been called. @@ -66,7 +65,7 @@ sub errorOpeningFile($) { my ($file) = @_; $file eq 'XXX' and return; #- special case to force closing file after rpmlib transaction. $current_medium eq $asked_medium and return; #- nothing to do in such case. - $refused_media{$asked_medium} and return; #- refused forever... + $::o->{packages}[2]{$asked_medium}{selected} or return; #- not selected means no need for worying about. my $max = 32; #- always refuse after $max tries. if ($::o->{method} eq "cdrom") { @@ -91,7 +90,8 @@ sub errorOpeningFile($) { } #- keep in mind the asked medium has been refused on this way. - $refused_media{$asked_medium} = 'refused'; + #- this means it is no more selected. + $::o->{packages}[2]{$asked_medium}{selected} = undef; return; } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index a0b363efd..1a76e2972 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -123,7 +123,7 @@ Hey no kidding, you will be allowed powerfull but dangerous things here."), first(list2kv(@c)), ${{reverse %c}}{$o->{installClass}}, [ __("Install"), __("Upgrade") ], $o->{isUpgrade} ? "Upgrade" : "Install") eq "Upgrade"; - if ($::beginner || $o->{isUpgrade}) { + if ($::corporate || $::beginner || $o->{isUpgrade}) { $o->{installClass} = "normal"; } else { my %c = ( @@ -263,6 +263,10 @@ sub selectPackagesToUpgrade { sub choosePackages { my ($o, $packages, $compss, $compssUsers, $compssUsersSorted, $first_time) = @_; + #- this is done at the very beginning to take into account + #- selection of CD by user. + $o->chooseCD($packages); + require pkgs; unless ($o->{isUpgrade}) { my $available = pkgs::invCorrectSize(install_any::getAvailableSpace($o) / sqr(1024)) * sqr(1024); @@ -277,7 +281,6 @@ sub choosePackages { pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $::expert ? 90 : 80, $available, $o->{installClass}); my $min_size = pkgs::selectedSize($packages); - $o->chooseCD($packages); $o->chooseGroups($packages, $compssUsers, $compssUsersSorted); my $max_size = int (sum map { pkgs::packageSize($_) } values %{$packages->[0]}); @@ -582,8 +585,10 @@ sub servicesConfig { } #------------------------------------------------------------------------------ -sub printerConfig($) { - my ($o) = @_; +sub printerConfig { + my ($o, $clicked) = @_; + + return if $::corporate && $::beginner && !$clicked; require printer; eval { add2hash($o->{printer} ||= {}, printer::getinfo($o->{prefix})) }; @@ -592,7 +597,7 @@ sub printerConfig($) { } #------------------------------------------------------------------------------ -sub setRootPassword($) { +sub setRootPassword { my ($o, $clicked) = @_; my $sup = $o->{superuser} ||= {}; $sup->{password2} ||= $sup->{password} ||= ""; @@ -639,7 +644,7 @@ _("Use NIS") => { val => \$o->{authentication}{NIS}, type => 'bool', text => _(" #------------------------------------------------------------------------------ #-addUser #------------------------------------------------------------------------------ -sub addUser($) { +sub addUser { my ($o, $clicked) = @_; my $u = $o->{user} ||= $o->{security} < 1 ? { name => "mandrake", password => "mandrake", realname => "default" } : {}; $u->{password2} ||= $u->{password} ||= ""; diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index bc14df244..e4c2579e1 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -136,7 +136,7 @@ sub extractHeaders($$$) { foreach (@$pkgs) { my $f = "$prefix/tmp/headers/". packageHeaderFile($_); local *H; - open H, $f or die "unable to open header file $f: $!"; + open H, $f or log::l("unable to open header file $f: $!"), next; $_->{header} = c::headerRead(fileno H, 1) or log::l("unable to read header of package ". packageHeaderFile($_)); } @$pkgs = grep { $_->{header} } @$pkgs; @@ -181,6 +181,10 @@ sub selectPackage($$;$$$) { #- do not select in such case. packageFlagInstalled($pkg) and return; + #- check for medium selection, if the medium has not been + #- selected, the package cannot be selected. + $pkg->{medium}{selected} or return; + #- avoid infinite recursion (mainly against badly generated depslist.ordered). $check_recursion ||= {}; exists $check_recursion->{$pkg->{file}} and return; $check_recursion->{$pkg->{file}} = undef; @@ -292,12 +296,13 @@ sub psUsingHdlists { my $f = install_any::getFile($hdlist) or die "no $hdlist found"; my $fakemedium = $method . ($medium || 1); - $packages[2]{$medium} = { hdlist => $hdlist, - medium => $medium, #- default medium is ''. - descr => $descr, #- default value is '' too. + $packages[2]{$medium} = { hdlist => $hdlist, + medium => $medium, #- default medium is ''. + descr => $descr, #- default value is '' too. fakemedium => $fakemedium, - min => scalar keys %{$packages[0]}, - max => -1, #- will be updated after reading current hdlist. + min => scalar keys %{$packages[0]}, + max => -1, #- will be updated after reading current hdlist. + selected => !$medium, #- default value is only CD1, it is really the minimal. }; #- copy hdlist file directly to $prefix/var/lib/urpmi, this will be used @@ -474,7 +479,7 @@ sub readCompssUsers { sub setSelectedFromCompssList { my ($compssListLevels, $packages, $min_level, $max_size, $install_class) = @_; my $ind = $compssListLevels->{$install_class}; defined $ind or log::l("unknown install class $install_class in compssList"), return; - + my $nb = selectedSize($packages); my @packages = allPackages($packages); my @places = do { #- special case for /^k/ aka kde stuff @@ -486,17 +491,23 @@ sub setSelectedFromCompssList { next if packageFlagSkip($p); last if $p->{values}[$ind] < $min_level; - selectPackage($packages, $p); + #- determine the packages that will be selected when + #- selecting $p. the packages are not selected. + my %newSelection; + selectPackage($packages, $p, \%newSelection); - my $nb = 0; foreach (@packages) { - $nb += packageSize($_) if packageFlagSelected($_); + #- this enable an incremental total size. + foreach (values %newSelection) { + $nb += packageSize($_); } if ($max_size && $nb > $max_size) { - unselectPackage($packages, $p); $min_level = $p->{values}[$ind]; log::l("setSelectedFromCompssList: up to indice $min_level (reached size $max_size)"); last; } + + #- at this point the package can safely be selected. + selectPackage($packages, $p); } $ind, $min_level; } @@ -664,7 +675,7 @@ sub selectPackagesToUpgrade($$$;$$) { #- TODO foreach (values %{$packages->[0]}) { my $p = $_; - unless ($p->{selected}) { + unless (packageFlagSelected($p)) { my $toSelect = 0; if (my $list = $filelist{packageName($p)}) { my @commonparts = map { /^=(.*)/ ? ($1) : () } @$list; -- cgit v1.2.1