summaryrefslogtreecommitdiffstats
path: root/perl-install
ModeNameSize
-rw-r--r--.cvsignore54logstatsplain
-rw-r--r--.perl_checker189logstatsplain
-rw-r--r--ChangeLog2267515logstatsplain
-rw-r--r--Makefile9971logstatsplain
-rw-r--r--Makefile.config1462logstatsplain
-rw-r--r--Makefile.drakxtools3215logstatsplain
d---------Newt304logstatsplain
d---------Xconfig454logstatsplain
-rw-r--r--any.pm38779logstatsplain
-rw-r--r--authentication.pm18372logstatsplain
-rw-r--r--bootloader.pm42274logstatsplain
-rw-r--r--c.pm352logstatsplain
d---------c431logstatsplain
-rw-r--r--class_discard.pm189logstatsplain
-rwxr-xr-xcommands394logstatsplain
-rw-r--r--commands.pm13946logstatsplain
-rw-r--r--common.pm8166logstatsplain
-rw-r--r--crypto.pm5687logstatsplain
-rw-r--r--detect_devices.pm28790logstatsplain
-rw-r--r--devices.pm7053logstatsplain
d---------diskdrake278logstatsplain
-rw-r--r--do_pkgs.pm6530logstatsplain
-rw-r--r--drakxtools.spec172293logstatsplain
-rw-r--r--fs.pm19212logstatsplain
d---------fs150logstatsplain
-rw-r--r--fsedit.pm21877logstatsplain
-rw-r--r--ftp.pm2204logstatsplain
-rw-r--r--handle_configs.pm4192logstatsplain
d---------harddrake216logstatsplain
-rw-r--r--help.pm42338logstatsplain
-rw-r--r--http.pm1296logstatsplain
-rwxr-xr-xinstall21205logstatsplain
-rw-r--r--install2.pm26409logstatsplain
-rw-r--r--install_any.pm49677logstatsplain
-rw-r--r--install_gtk.pm9251logstatsplain
-rw-r--r--install_interactive.pm11496logstatsplain
-rw-r--r--install_messages.pm6989logstatsplain
-rw-r--r--install_steps.pm37556logstatsplain
-rw-r--r--install_steps_auto_install.pm3305logstatsplain
-rw-r--r--install_steps_gtk.pm25013logstatsplain
-rw-r--r--install_steps_interactive.pm48360logstatsplain
-rw-r--r--install_steps_newt.pm1356logstatsplain
-rw-r--r--install_steps_stdio.pm667logstatsplain
-rw-r--r--interactive.pm17577logstatsplain
d---------interactive140logstatsplain
-rw-r--r--keyboard.pm24345logstatsplain
-rw-r--r--lang.pm57850logstatsplain
-rw-r--r--list.sparc2771logstatsplain
-rw-r--r--log.pm1368logstatsplain
-rw-r--r--loopback.pm3393logstatsplain
-rw-r--r--lvm.pm4545logstatsplain
-rw-r--r--modules.pm8854logstatsplain
d---------modules209logstatsplain
-rw-r--r--mouse.pm21131logstatsplain
d---------network568logstatsplain
-rw-r--r--partition_table.pm20096logstatsplain
d---------partition_table277logstatsplain
d---------patch506logstatsplain
-rwxr-xr-xperl2etags154logstatsplain
d---------pixmaps2388logstatsplain
-rw-r--r--pkgs.pm43496logstatsplain
d---------printer333logstatsplain
-rw-r--r--raid.pm6322logstatsplain
d---------resize_fat531logstatsplain
-rw-r--r--run_program.pm3991logstatsplain
d---------sbus_probing35logstatsplain
-rwxr-xr-xscanner.pm20071logstatsplain
d---------security179logstatsplain
-rw-r--r--services.pm17027logstatsplain
d---------share1765logstatsplain
-rw-r--r--standalone.pm10334logstatsplain
d---------standalone2018logstatsplain
-rw-r--r--steps.pm2356logstatsplain
-rw-r--r--timezone.pm7885logstatsplain
-rw-r--r--ugtk2.pm60638logstatsplain
d---------unused288logstatsplain
-rwxr-xr-xverify_c303logstatsplain
-rw-r--r--wizards.pm8205logstatsplain
d---------xf86misc183logstatsplain
"$dir/$prog"; } if (/FB/) { !$o->{vga16} && $o->{allowFB} or next; $o->{allowFB} = &$launchX($prog) #- keep in mind FB is used. and goto OK; } else { $o->{vga16} = 1 if /VGA16/; &$launchX($prog) and goto OK; } } return undef; } } OK: @themes = @themes_vga16 if $o->{simple_themes} || $o->{vga16}; init_sizes(); install_theme($o); create_logo_window($o); $my_gtk::force_center = [ $::rootwidth - $::windowwidth, $::logoheight, $::windowwidth, $::windowheight ]; (bless {}, ref $type || $type)->SUPER::new($o); } sub enteringStep { my ($o, $step) = @_; print _("Entering step `%s'\n", translate($o->{steps}{$step}{text})); $o->SUPER::enteringStep($step); create_steps_window($o); create_help_window($o); } sub leavingStep { my ($o, $step) = @_; $o->SUPER::leavingStep($step); } #-###################################################################################### #- Steps Functions #-###################################################################################### sub selectLanguage { my ($o) = @_; $o->SUPER::selectLanguage; Gtk->set_locale; install_theme($o); } #------------------------------------------------------------------------------ sub selectInstallClass1 { my ($o, $verif, $l, $def, $l2, $def2) = @_; my $w = my_gtk->new(''); my ($radio, $focused); gtkadd($w->{window}, gtkpack($o->create_box_with_title(_("Please, choose one of the following classes of installation:")), (my @radios = map { $radio = new Gtk::RadioButton($_, $radio ? $radio : ()); $radio->set_active($_ eq $def); $radio } @$l), gtkadd(create_hbox(), map { my $v = $_; my $b = new Gtk::Button(translate($_)); $focused = $b if $_ eq $def2; gtksignal_connect($b, "clicked" => sub { $w->{retval} = $v; Gtk->main_quit }); } @$l2) )); $focused->grab_focus if $focused; $w->main; mapn { $verif->($_[1]) if $_[0]->active } \@radios, $l; create_steps_window($o); $w->{retval}; } #------------------------------------------------------------------------------ sub selectMouse { my ($o, $force) = @_; my $old_dev = $o->{mouse}{device}; $o->SUPER::selectMouse($force); my $dev = $o->{mouse}{device}; if ($old_dev ne $dev && $dev =~ /ttyS/ && !$::testing) { log::l("telling X server to use another mouse"); eval { commands::modprobe("serial") }; symlinkf($dev, "/dev/mouse"); c::setMouseMicrosoft($ENV{DISPLAY}); } } #------------------------------------------------------------------------------ sub doPartitionDisks { my ($o, $hds, $raid) = @_; if ($o->{lnx4win}) { eval { install_steps::doPartitionDisks(@_) }; if ($@ =~ /no fat/) { $o->ask_warn('', _("You don't have any windows partitions!")); } elsif ($@ =~ /not enough room/) { $o->ask_warn('', _("You don't have any enough room for Lnx4win")); } else { return } delete $o->{lnx4win}; } if ($::beginner && fsedit::is_one_big_fat($hds)) { #- wizard my $min_linux = 600 << 11; my $max_linux = 1500 << 11; my $min_freewin = 300 << 11; my ($part) = fsedit::get_fstab(@{$o->{hds}}); my $w = $o->wait_message(_("Resizing"), _("Computing FAT filesystem bounds")); my $resize_fat = eval { resize_fat::main->new($part->{device}, devices::make($part->{device})) }; $@ and goto diskdrake; my $min_win = $resize_fat->min_size; if (!$@ && $part->{size} > $min_linux + $min_freewin + $min_win && $o->ask_okcancel('', _("WARNING! DrakX now needs to resize your Windows partition. Be careful: this operation is dangerous. If you have not already done so, you should first exit the installation, run scandisk under Windows (and optionally run defrag), then restart the installation. You should also backup your data. When sure, press Ok."))) { my $hd = $hds->[0]; my $oldsize = $part->{size}; $hd->{isDirty} = $hd->{needKernelReread} = 1; $part->{size} -= min($max_linux, $part->{size} - $min_win); $hd->adjustEnd($part); partition_table::adjust_local_extended($hd, $part); partition_table::adjust_main_extended($hd); local *log::l = sub { $w->set(join(' ', @_)) }; eval { $resize_fat->resize($part->{size}) }; if ($@) { $part->{size} = $oldsize; $o->ask_warn('', _("Automatic resizing failed")); } else { $part->{isFormatted} = 1; eval { fsedit::auto_allocate($hds, $o->{partitions}) }; if (!$@) { partition_table::write($hd) unless $::testing; return; } } } } diskdrake: while (1) { diskdrake::main($hds, $raid, interactive_gtk->new, $o->{partitions}); if (!grep { isSwap($_) } fsedit::get_fstab(@{$o->{hds}})) { if ($::beginner) { $o->ask_warn('', _("You must have a swap partition")); } elsif (!$::expert) { $o->ask_okcancel('', _("You don't have a swap partition\n\nContinue anyway?")) and last; } else { last } } else { last } } } sub doPartitionDisksLnx4winDev { my ($o, $l) = @_; return if $::beginner; my ($dev) = $o->ask_from_list('', _("Which partition do you want to use to put Linux4Win?"), [ map { sprintf "%s (%s) [%dMB]", $_->{device_windobe}, $_->{device}, $_->{size} >> 11 } @$l ] ) =~ /\((\S+)\)/; $_->{device} eq $dev and return $_ foreach @$l; } sub doPartitionDisksLnx4winSize { my ($o, $root_size, $swap_size, $max_root_size, $max_swap_size) = @_; return if $::beginner; my $w = my_gtk->new(''); my $root_adj = create_adjustment($max_root_size >> 11, 1, $$root_size >> 11); my $swap_adj = create_adjustment($max_swap_size >> 11, 1, $$swap_size >> 11); my $root_spin = new Gtk::SpinButton($root_adj, 0, 0); my $swap_spin = new Gtk::SpinButton($swap_adj, 0, 0); gtkadd($w->{window}, gtkpack(new Gtk::VBox(0,20), _("Choose the sizes"), create_packtable({}, [ _("Root partition size in MB: "), $root_spin ], [ undef, new Gtk::HScrollbar($root_adj) ], [ _("Swap partition size in MB: "), $swap_spin ], [ undef, new Gtk::HScrollbar($swap_adj) ], ), create_okcancel($w) ), ); $w->{ok}->grab_focus; $w->main(sub { $$root_size = $root_spin->get_value_as_int << 11; $$swap_size = $swap_spin->get_value_as_int << 11; }); } #------------------------------------------------------------------------------ sub chooseSizeToInstall { my ($o, $packages, $min_size, $max_size_, $availableC, $individual) = @_; my $max_size = min($max_size_, $availableC); my $enough = $max_size == $max_size_; my $percentage = int 100 * $max_size / $max_size_; #- don't ask anything if the difference between min and max is too small return $max_size if $min_size && $max_size / $min_size < 1.05; log::l("choosing size to install between $min_size and $max_size"); my $w = my_gtk->new(''); my $adj = create_adjustment($percentage, $min_size * 100 / $max_size_, $percentage); my $spin = gtkset_usize(new Gtk::SpinButton($adj, 0, 0), 20, 0); my $val; gtkadd($w->{window}, gtkpack(new Gtk::VBox(0,20), _("The total size for the groups you have selected is approximately %d MB.\n", pkgs::correctSize($max_size_ / sqr(1024))) . ($enough ? _("If you wish to install less than this size, select the percentage of packages that you want to install. A low percentage will install only the most important packages; a percentage of 100%% will install all selected packages.") : _("You have space on your disk for only %d%% of these packages. If you wish to install less than this, select the percentage of packages that you want to install. A low percentage will install only the most important packages; a percentage of %d%% will install as many packages as possible.", $percentage, $percentage)) . ($individual ? "\n\n" . _("You will be able to choose them more specifically in the next step.") : ''), create_packtable({}, [ _("Percentage of packages to install") . ' ', $spin, "%", my $mb = new Gtk::Label ], [ undef, new Gtk::HScrollbar($adj) ], ), create_okcancel($w) ) ); $spin->signal_connect(changed => my $changed = sub { $val = $spin->get_value_as_int / 100 * $max_size_; $mb->set(sprintf("(%dMB)", pkgs::correctSize($val / sqr(1024)))); }); &$changed(); $spin->signal_connect(activate => sub { $w->{retval} = 1; Gtk->main_quit }); $spin->grab_focus(); $w->main and $val; } sub choosePackagesTree { my ($o, $packages, $compss) = @_; my ($curr, $info_widget, $w_size, $go, $idle, $flat, $auto_deps); my (%wtree, %ptree); my $w = my_gtk->new(''); my $details = new Gtk::VBox(0,0); my $tree = Gtk::CTree->new(3, 0); $tree->set_selection_mode('browse'); $tree->set_column_width(0, 200); $tree->set_column_auto_resize($_, 1) foreach 1..2; gtkadd($w->{window}, gtkpack_(new Gtk::VBox(0,5), 0, _("Choose the packages you want to install"), 1, gtkpack(new Gtk::HBox(0,0), createScrolledWindow($tree), gtkadd(gtkset_usize(new Gtk::Frame(_("Info")), 150, 0), createScrolledWindow($info_widget = new Gtk::Text), )), 0, my $l = new Gtk::HBox(0,15), 0, gtkpack(new Gtk::HBox(0,10), $go = gtksignal_connect(new Gtk::Button(_("Install")), "clicked" => sub { $w->{retval} = 1; Gtk->main_quit }), ) )); gtkpack__($l, my $toolbar = new Gtk::Toolbar('horizontal', 'icons')); gtkpack__($l, gtksignal_connect(new Gtk::CheckButton(_("Automatic dependencies")), clicked => sub { invbool \$auto_deps })); $l->pack_end($w_size = new Gtk::Label(''), 0, 1, 20); $w->{window}->set_usize(map { $_ - 2 * $my_gtk::border - 4 } $::windowwidth, $::windowheight); $go->grab_focus; $w->{rwindow}->show_all; my $pix_base = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-base.xpm") ]; my $pix_selected = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-selected.xpm") ]; my $pix_unselect = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-unselected.xpm") ]; my $pix_installed= [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-installed.xpm") ]; my $parent; $parent = sub { if (my $w = $wtree{$_[0]}) { return $w } my $s; foreach (split '/', $_[0]) { $wtree{"$s/$_"} ||= $tree->insert_node($s ? $parent->($s) : undef, undef, [$_, '', ''], 5, (undef) x 4, 0, 0); $s = "$s/$_"; } $wtree{$s}; }; my $add_node = sub { my ($leaf, $root) = @_; my $node = $tree->insert_node($parent->($root), undef, [$leaf, '', ''], 5, (undef) x 4, 1, 0); my $p = $packages->[0]{$leaf} or return; $p->{medium}{selected} or return; my $pix = pkgs::packageFlagBase($p) ? $pix_base : pkgs::packageFlagSelected($p) ? $pix_selected : pkgs::packageFlagInstalled($p) ? $pix_installed : $pix_unselect; $tree->node_set_pixmap($node, 1, $pix->[0], $pix->[1]); push @{$ptree{$leaf}}, $node; }; my $add_nodes = sub { %ptree = %wtree = (); $tree->freeze; while (1) { $tree->remove_node($tree->node_nth(0) || last) } my ($root, $leaf); if ($flat = $_[0]) { $add_node->($_, undef) foreach sort grep { my $pkg = pkgs::packageByName($packages, $_); $pkg->{medium}{selected} } keys %{$packages->[0]}; } else { foreach (sort @$compss) {