From e38950a33c3505db7e79547622aa5946cfe88d5c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 25 Sep 2000 22:00:16 +0000 Subject: no_comment --- perl-install/ChangeLog | 30 ++++++++++++++++++++++++++++++ perl-install/Xconfigurator.pm | 2 +- perl-install/common.pm | 5 +++++ perl-install/fs.pm | 1 + perl-install/install2.pm | 8 +++++--- perl-install/install_any.pm | 11 ++++++----- perl-install/install_gtk.pm | 2 +- perl-install/install_steps.pm | 15 ++++++++------- perl-install/install_steps_gtk.pm | 2 +- perl-install/install_steps_interactive.pm | 30 +++++++++++++++--------------- perl-install/interactive.pm | 2 +- perl-install/interactive_gtk.pm | 6 +++--- perl-install/my_gtk.pm | 4 ---- perl-install/pkgs.pm | 11 ++++++----- perl-install/share/compssUsers | 16 ++++++++-------- 15 files changed, 91 insertions(+), 54 deletions(-) diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index a117edcce..c7b1148ff 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -1,3 +1,33 @@ +2000-09-25 Pixel + + * share/MonitorsDB: merge with latest redhat MonitorsDB + + * pci_probing/pcitable: major merge with latest redhat pcitable + + * share/Cards+: added "Intel 815", renamed "Rage 128 (generic)" to + "Rage 128", added "Rage 128 Mobility" + + * install_any.pm (getAvailableSpace): keep 10% of free space on + big partitions + + * Xconfigurator.pm (readMonitorsDB): don't translate Generic + (otherwise, only a part is translated, see MonitorsDB for the + non-translated part) + + * interactive.pm (ask_many_from_list): fix sorting + + * install_gtk.pm (test_mouse): smaller box to fit in 640x480 + + * install_steps.pm (afterInstallPackages, beforeInstallPackages): + RPM-GPG-KEYS is copied before installing packages + + * pkgs.pm (readCompssUsers): handle icons in compssUsers + + * common.pm (truncate_list): ensure the list is not too big + + * install_steps_gtk.pm (choosePackagesTree): restrict the list to + 20 elements if it is too big (use truncate_list) + 2000-09-25 François Pons * bootloader.pm: add Video mode for entry. diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index b63985024..f8ad163f0 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -120,7 +120,7 @@ sub readMonitorsDB { $monitors{"$l{vendor}|$l{type}"} = \%l; } while (my ($k, $v) = each %standard_monitors) { - $monitors{_("Generic") . "|" . translate($k)} = + $monitors{"Generic|" . translate($k)} = { hsyncrange => $v->[1], vsyncrange => $v->[2] }; } } diff --git a/perl-install/common.pm b/perl-install/common.pm index 47cc2586f..bac1d5129 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -586,6 +586,11 @@ sub removeXiBSuffix($) { $_; } +sub truncate_list { + my $nb = shift; + @_ <= $nb ? @_ : (@_[0..$nb-1], '...'); +} + sub formatTime { my ($s, $m, $h) = gmtime($_[0]); if ($h) { diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 8a0f78ef3..638ffe5e7 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -62,6 +62,7 @@ sub check_mounted($) { sub get_mntpoints_from_fstab { my ($fstab, $prefix, $uniq) = @_; + log::l("reading fstab"); foreach (read_fstab("$prefix/etc/fstab")) { next if $uniq && fsedit::mntpoint2part($_->{mntpoint}, $fstab); diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 94b11e9fa..2069f01be 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -209,6 +209,7 @@ sub selectLanguage { #------------------------------------------------------------------------------ sub selectMouse { + require pkgs; my ($first_time) = $_[1] == 1; add2hash($o->{mouse} ||= {}, mouse::read($o->{prefix})) if $o->{isUpgrade} && $first_time; @@ -278,7 +279,7 @@ sub formatPartitions { mkdir "$o->{prefix}/$_", 0755 foreach qw(dev etc etc/profile.d etc/sysconfig etc/sysconfig/console etc/sysconfig/network-scripts home mnt tmp var var/tmp var/lib var/lib/rpm var/lib/urpmi); - mkdir "$o->{prefix}/$_", 0700 foreach qw(root); + mkdir "$o->{prefix}/$_", 0700 foreach qw(root root/tmp); require raid; raid::prepare_prefixed($o->{raid}, $o->{prefix}); @@ -314,8 +315,7 @@ sub choosePackages { # $o->{compssUsersChoice}{KDE} = 0 if $o->{lang} =~ /ja|el|ko|th|vi|zh/; #- gnome handles much this fonts much better } - $o->choosePackages($o->{packages}, $o->{compss}, - $o->{compssUsers}, $o->{compssUsersSorted}, $_[1] == 1); + $o->choosePackages($o->{packages}, $o->{compss}, $o->{compssUsers}, $_[1] == 1); my $pkg = pkgs::packageByName($o->{packages}, 'kdesu'); pkgs::unselectPackage($o->{packages}, $pkg) if $pkg && $o->{security} > 3; @@ -629,6 +629,8 @@ sub main { $o->{compssListLevel} = 50; push @auto, 'selectInstallClass', 'selectMouse', 'doPartitionDisks', 'choosePackages', 'configureTimezone', 'exitInstall'; } + + foreach (@auto) { eval "undef *" . (!/::/ && "install_steps_interactive::") . $_; my $s = $o->{steps}{/::(.*)/ ? $1 : $_} or next; diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 4fc28d345..e919ec395 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -245,9 +245,9 @@ sub getAvailableSpace { #- 50mb may be a good choice to avoid almost all problem of insuficient space left... my $minAvailableSize = 50 * sqr(1024); - int ((!$::testing && - getAvailableSpace_mounted($o->{prefix}) || - getAvailableSpace_raw($o->{fstab}) * 512 / 1.07) - $minAvailableSize); + my $n = !$::testing && getAvailableSpace_mounted($o->{prefix}) || + getAvailableSpace_raw($o->{fstab}) * 512 / 1.07; + $n - max(0.1 * $n, $minAvailableSize); } sub getAvailableSpace_mounted { @@ -301,7 +301,8 @@ sub setPackages($) { $o->{compss} = pkgs::readCompss($o->{prefix}, $o->{packages}); #- must be done after getProvides $o->{compssListLevels} = pkgs::readCompssList($o->{packages}, lang::get_langs()); - ($o->{compssUsers}, $o->{compssUsersSorted}) = pkgs::readCompssUsers($o->{packages}, $o->{compss}); + ($o->{compssUsers}, $o->{compssUsersSorted}, $o->{compssUsersIcons}) = + pkgs::readCompssUsers($o->{packages}, $o->{compss}); my @l = (); push @l, "kapm", "kcmlaptop", "DrakProfile", "DrakSync" if $o->{pcmcia}; @@ -618,7 +619,7 @@ sub suggest_mount_points { $part->{mntpoint} = $mnt; delete $part->{unsafeMntpoint}; #- try to find other mount points via fstab - fs::get_mntpoints_from_fstab([ fsedit::get_fstab(@$hds) ], $d, $uniq) if $mnt eq '/' && $uniq; + fs::get_mntpoints_from_fstab([ fsedit::get_fstab(@$hds) ], $d, $uniq) if $mnt eq '/'; } #- $_->{mntpoint} || fsedit::suggest_part($_, $hds) foreach @parts; diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm index 0cb9e8b67..29463c051 100644 --- a/perl-install/install_gtk.pm +++ b/perl-install/install_gtk.pm @@ -366,7 +366,7 @@ sub test_mouse { my ($mouse) = @_; my $w = my_gtk->new; - my ($width, $height, $offset) = (210, 300, 25); + my ($width, $height, $offset) = (210, round_up($::windowheight - 150, 6), 25); my ($bw, $bh) = ($width / 3, $height / 3); gtkadd($w->{window}, diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 39b67f512..48501982d 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -245,7 +245,7 @@ sub selectPackagesToUpgrade { } sub choosePackages { - my ($o, $packages, $compss, $compssUsers, $compssUsersSorted, $first_time) = @_; + my ($o, $packages, $compss, $compssUsers, $first_time) = @_; #- now for upgrade, package that must be upgraded are #- selected first, after is used the same scheme as install. @@ -287,6 +287,9 @@ sub beforeInstallPackages { } } + #- copy RPM-GPG *before* installing packages (otherwise may be the CD2) + install_any::getAndSaveFile('RPM-GPG-KEYS', "$o->{prefix}/root/tmp/RPM-GPG-KEYS"); + log::l("before install packages, after copy"); #- some packages need such files for proper installation. any::writeandclean_ldsoconf($o->{prefix}); @@ -437,12 +440,10 @@ Consoles 1,3,4,7 may also contain interesting information"; install_any::install_urpmi($o->{prefix}, $o->{method}, $o->{packages}[2]); substInFile { s/^urpmi\n//; $_ .= "urpmi\n" if eof } "$msec/group.conf" if -d $msec; } - { - my $f = "$o->{prefix}/root/tmp/RPM-GPG-KEYS"; - install_any::getAndSaveFile('RPM-GPG-KEYS', $f); - run_program::rooted($o->{prefix}, qw(gpg --import --homedir /etc/rpm /root/tmp/RPM-GPG-KEYS)); - unlink $f; - } + + #- RPM-GPG-KEYS is copied earlier to ensure we have it + run_program::rooted($o->{prefix}, qw(gpg --import --homedir /etc/rpm /root/tmp/RPM-GPG-KEYS)); + unlink "$o->{prefix}/root/tmp/RPM-GPG-KEYS"; # #- update language and icons for KDE. # update_userkderc($o->{prefix}, 'Locale', Language => ""); diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index d46a7e289..a82e84d60 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -383,7 +383,7 @@ sub choosePackagesTree { @l > @_ && !$auto_deps and $o->ask_okcancel('', [ $isSelection ? _("The following packages are going to be installed") : _("The following packages are going to be removed"), - join(", ", sort @l) ], 1) || return; + join(", ", common::truncate_list(20, sort @l)) ], 1) || return; $isSelection ? pkgs::selectPackage($packages, $_) : pkgs::unselectPackage($packages, $_) foreach @_; foreach (@l) { my $p = $packages->[0]{$_}; diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index c0dfe4308..8a2c9ea71 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -206,13 +206,12 @@ sub ask_mntpoint_s { die _("no available partitions") if @fstab == 0; + install_any::suggest_mount_points($o->{hds}, $o->{prefix}, 'uniq'); + log::l("default mntpoint $_->{mntpoint} $_->{device}") foreach @fstab; + if (@fstab == 1) { $fstab[0]{mntpoint} = '/'; } else { - install_any::suggest_mount_points($o->{hds}, $o->{prefix}, 'uniq'); - - log::l("default mntpoint $_->{mntpoint} $_->{device}") foreach @fstab; - $o->ask_from_entries_refH('', _("Choose the mount points"), [ map { partition_table_raw::description($_) => @@ -335,7 +334,7 @@ sub selectPackagesToUpgrade { } #------------------------------------------------------------------------------ sub choosePackages { - my ($o, $packages, $compss, $compssUsers, $compssUsersSorted, $first_time) = @_; + my ($o, $packages, $compss, $compssUsers, $first_time) = @_; #- this is done at the very beginning to take into account #- selection of CD by user if using a cdrom. @@ -349,7 +348,7 @@ sub choosePackages { my $min_size = pkgs::selectedSize($packages); $min_size < $availableC or die _("Your system has not enough space left for installation or upgrade (%d > %d)", $min_size, $availableC); - $o->chooseGroups($packages, $compssUsers, $compssUsersSorted, \$individual) unless $::beginner || $::corporate; + $o->chooseGroups($packages, $compssUsers, \$individual) unless $::beginner || $::corporate; #- avoid reselection of package if individual selection is requested and this is not the first time. if (1 || $first_time || !$individual) { @@ -384,7 +383,7 @@ sub choosePackages { } }); if (!$size2install) { #- special case for desktop - $o->chooseGroups($packages, $compssUsers, $compssUsersSorted); + $o->chooseGroups($packages, $compssUsers); } ($o->{packages_}{ind}) = pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, $size2install, $o->{installClass}); @@ -400,38 +399,39 @@ sub chooseSizeToInstall { sub choosePackagesTree {} sub chooseGroups { - my ($o, $packages, $compssUsers, $compssUsersSorted, $individual) = @_; + my ($o, $packages, $compssUsers, $individual) = @_; my %size; my $base = pkgs::selectedSize($packages); - foreach (@$compssUsersSorted) { + foreach (@{$o->{compssUsersSorted}}) { my $b = pkgs::saveSelected($packages); pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}}; $size{$_} = pkgs::selectedSize($packages) - $base; pkgs::restoreSelected($b); } - my @groups = (@$compssUsersSorted, $o->{meta_class} eq 'desktop' ? () : __("Miscellaneous")); + my @groups = (@{$o->{compssUsersSorted}}, $o->{meta_class} eq 'desktop' ? () : __("Miscellaneous")); my $all; $o->ask_many_from_list('', _("Package Group Selection"), { list => \@groups, ref => sub { \$o->{compssUsersChoice}{$_} }, - label => sub { $size{$_} ? sprintf "$_ (%d%s)", round_down($size{$_} / sqr(1024), 10), _("MB") : translate($_) }, + icon2f => sub { "/usr/share/icons/" . ($o->{compssUsersIcons}{$_} || 'default') . "_section.xpm" }, + label => sub { $size{$_} ? sprintf "$_ (%d%s)", round_down($size{$_} / sqr(1024), 10), _("MB") : translate($_) }, }, $o->{meta_class} eq 'desktop' ? { list => [ _("All") ], ref => sub { \$all }, shadow => 0 } : (), $individual ? { list => [ _("Individual package selection") ], ref => sub { $individual } } : (), ) or goto &chooseGroups; if ($all) { - $o->{compssUsersChoice}{$_} = 1 foreach @$compssUsersSorted, "Miscellaneous"; + $o->{compssUsersChoice}{$_} = 1 foreach @{$o->{compssUsersSorted}}, "Miscellaneous"; } unless ($o->{compssUsersChoice}{Miscellaneous}) { my %l; - $l{@{$compssUsers->{$_}}} = () foreach @$compssUsersSorted; + $l{@{$compssUsers->{$_}}} = () foreach @{$o->{compssUsersSorted}}; exists $l{$_} or pkgs::packageSetFlagSkip($_, 1) foreach values %{$packages->[0]}; } - foreach (@$compssUsersSorted) { + foreach (@{$o->{compssUsersSorted}}) { $o->{compssUsersChoice}{$_} or pkgs::skipSetWithProvides($packages, @{$compssUsers->{$_}}); } - foreach (@$compssUsersSorted) { + foreach (@{$o->{compssUsersSorted}}) { $o->{compssUsersChoice}{$_} or next; foreach (@{$compssUsers->{$_}}) { pkgs::packageSetFlagUnskip($_, 1); diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index ecaa8f095..e78eb2e8a 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -188,7 +188,7 @@ sub ask_many_from_list { $h->{labels} ||= [ map { $h->{label} ? $h->{label}->($_) : $_ } @{$h->{list}} ]; if ($h->{sort}) { - my @places = sort { $h->{labels}[$b] <=> $h->{labels}[$a] } 0 .. $#{$h->{labels}}; + my @places = sort { $h->{labels}[$a] cmp $h->{labels}[$b] } 0 .. $#{$h->{labels}}; $h->{labels} = [ map { $h->{labels}[$_] } @places ]; $h->{list} = [ map { $h->{list}[$_] } @places ]; } diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index eae43f1f3..ff1e48292 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -210,7 +210,7 @@ sub ask_many_from_listW { my $tips = new Gtk::Tooltips; my @boxes; @boxes = map { my $l = $_; - my $box = gtkpack(new Gtk::VBox(0,0), + my $box = gtkpack(new Gtk::VBox(0, @{$l->{icons}} ? 10 : 0), map_index { my $i = $::i; @@ -223,9 +223,9 @@ sub ask_many_from_listW { }); my $f = $l->{icons}[$i]; - -e $f ? gtkpack_(new Gtk::HBox(0,0), 0, new Gtk::Pixmap(gtkcreate_xpm($w->{window}, $f)), 1, $o) : $o; + -e $f ? gtkpack_(new Gtk::HBox(0,10), 0, new Gtk::Pixmap(gtkcreate_xpm($w->{window}, $f)), 1, $o) : $o; } @{$l->{labels}}); - @{$l->{labels}} > 11 ? gtkset_usize(createScrolledWindow($box), 0, 250) : $box; + @{$l->{labels}} > 11 ? gtkset_usize(createScrolledWindow($box), @{$l->{icons}} ? 350 : 0, $::windowheight - 200) : $box; } @l; gtkadd($w->{window}, gtkpack_(create_box_with_title($w, @$messages), diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 5939585fd..9040f002d 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -76,10 +76,6 @@ sub sync($) { sub flush { Gtk->main_iteration while Gtk->events_pending; } -sub bigsize($) { - $_[0]{rwindow}->set_usize(600,400); -} - sub gtkshow($) { $_[0]->show; $_[0] } sub gtkdestroy($) { $_[0] and $_[0]->destroy } diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index bb1e66ba7..5f81d914d 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -663,7 +663,7 @@ sub readCompssList { sub readCompssUsers { my ($packages, $compss) = @_; - my (%compssUsers, @sorted, $l); + my (%compssUsers, %compssUsersIcons, @sorted, $l); my (%compss); foreach (@$compss) { local ($_, $a) = m|(.*)/(.*)|; @@ -672,7 +672,7 @@ sub readCompssUsers { my $map = sub { $l or return; - $_ = $packages->[0]{$_} or log::l("unknown package $1 (in compssUsers)") foreach @$l; + $_ = $packages->[0]{$_} or log::l("unknown package $_ (in compssUsers)") foreach @$l; }; my $f = install_any::getFile('Mandrake/base/compssUsers') or die "can't find compssUsers"; foreach (<$f>) { @@ -681,8 +681,9 @@ sub readCompssUsers { if (/^(\S.*)/) { &$map; - push @sorted, $1; - $compssUsers{$1} = $l = []; + /^(.*?)\s*\[icon=(.*?)\]/ and $_ = $1, $compssUsersIcons{$_} = $2; + push @sorted, $_; + $compssUsers{$_} = $l = []; } elsif (/\s+\+(\S+)/) { push @$l, $1; } elsif (/^\s+(.*?)\s*$/) { @@ -690,7 +691,7 @@ sub readCompssUsers { } } &$map; - \%compssUsers, \@sorted; + \%compssUsers, \@sorted, \%compssUsersIcons; } sub setSelectedFromCompssList { diff --git a/perl-install/share/compssUsers b/perl-install/share/compssUsers index 66eca1e2e..0d1f5fcb2 100644 --- a/perl-install/share/compssUsers +++ b/perl-install/share/compssUsers @@ -1,4 +1,4 @@ -Graphics Manipulation +Graphics Manipulation [icon=graphics] Graphics KDE @@ -28,7 +28,7 @@ Gnome +XFree86-75dpi-fonts +fonts-ttf-west_european -Other window managers +Other window managers [icon=windowmanager] Graphical desktop/Window Maker Graphical desktop/Enlightenment Graphical desktop/FVWM based @@ -37,30 +37,30 @@ Other window managers +XFree86 +XFree86-75dpi-fonts -Mail/WWW/News Tools +Mail/WWW/News Tools [icon=networking] Networking/WWW Networking/Mail Networking/News -Communication facilities +Communication facilities [icon=chat] Communications Networking/Chat Networking/File transfer Networking/IRC -Office +Office [icon=office] Office -Multimedia Support +Multimedia Support [icon=multimedia] Sound Video Applications/Multimedia -Games +Games [icon=amusement] Games Amusements/Games -Documentation +Documentation [icon=documentation] Books Databases -- cgit v1.2.1