summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-07-16 14:03:47 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-07-16 14:03:47 +0000
commit9f8734e27c9a88137a2933970b7a5962e37789da (patch)
tree973e9a5518a38231812f2af8047ca93be420a083 /perl-install
parente4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999 (diff)
downloaddrakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar
drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.gz
drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.bz2
drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.xz
drakx-9f8734e27c9a88137a2933970b7a5962e37789da.zip
*** empty log message ***
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Makefile10
-rw-r--r--perl-install/install2.pm100
-rw-r--r--perl-install/install_steps.pm11
-rw-r--r--perl-install/install_steps_stdio.pm30
-rw-r--r--perl-install/my_gtk.pm10
-rw-r--r--perl-install/pkgs.pm4
6 files changed, 98 insertions, 67 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile
index 220488b25..3773961d1 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -4,6 +4,7 @@ DEST = /tmp/t/Mandrake/instimage
DESTREP4PMS = $(DEST)/usr/bin/perl-install
PERL = perl
LOCALFILES = $(PERL) mouseconfig fr.map
+EXCLUDE = $(LOCALFILES) boot-hd.img
.PHONY: all tags install clean verify_c
@@ -14,11 +15,11 @@ tags:
clean:
test ! -e c/Makefile || $(MAKE) -C c clean
- rm -f c/c.xs
+ rm -f c/c.xs install1_hd
find . -name "*~" -o -name "TAGS" -o -name "*.old" | xargs rm -f
tar: clean
- cd .. ; tar cfy perl-install.tar.bz2 $(LOCALFILES:%=--exclude %) perl-install
+ cd .. ; tar cfy perl-install.tar.bz2 $(EXCLUDE:%=--exclude %) perl-install
tar-diskdrake: clean
cd .. ; rm -rf diskdrake ; cp -af perl-install diskdrake
@@ -112,13 +113,14 @@ as_root:
full_stage2:
rm -rf $(DEST)
- mkdir $(DEST)
+ mkdir -p $(DEST)
$(MAKE) get_needed_files
$(MAKE) stage2
stage2:
$(MAKE) install_pms
- cd $(DEST) ; tar cfz $(DEST).tgz [^M]* ; mv $(DEST).tgz /tmp/t.tgz
+ cd /tmp/t ; tar cfz /tmp/instimage-full.tgz Mandrake
+ cd /tmp/t ; tar cfz /tmp/instimage-light.tgz Mandrake/instimage/usr/[bl]*
@#rm -rf /mnt/initrd/*
@#cp -a $(DEST)/* /mnt/initrd
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 4ae7c89b8..859e46e30 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -21,47 +21,53 @@ use partition_table qw(:types);
use detect_devices;
use smp;
-$testing = $ENV{PERL_INSTALL_TEST};
+$testing = 1;#$ENV{PERL_INSTALL_TEST};
$INSTALL_VERSION = 0;
-my @installStepsFields = qw(text skipOnCancel skipOnLocal prev next);
+my @installStepsFields = qw(text help skipOnCancel skipOnLocal prev next);
my @installSteps = (
- selectInstallClass => [ "Select installation class", 0, 0 ],
- setupSCSI => [ "Setup SCSI", 0, 1 ],
- partitionDisks => [ "Setup filesystems", 0, 1 ],
- findInstallFiles => [ "Find installation files", 1, 0 ],
- choosePackages => [ "Choose packages to install", 0, 0 ],
- doInstallStep => [ "Install system", 0, 0 ],
-# configureMouse => [ "Configure mouse", 0, 0 ],
- finishNetworking => [ "Configure networking", 0, 0 ],
-# configureTimezone => [ "Configure timezone", 0, 0 ],
-# configureServices => [ "Configure services", 0, 0 ],
-# configurePrinter => [ "Configure printer", 0, 0 ],
- setRootPassword => [ "Set root password", 0, 0 ],
- addUser => [ "Add a user", 0, 0 ],
- createBootdisk => [ "Create bootdisk", 0, 1 ],
- setupBootloader => [ "Install bootloader", 0, 1 ],
-# configureX => [ "Configure X", 0, 0 ],
- exitInstall => [ "Exit install", 0, 0, undef, 'done' ],
+ selectLanguage => [ "Choose your language", "aide", 0, 0 ],
+ selectPath => [ "Choose install or upgrade", "aide", 0, 0 ],
+ selectInstallClass => [ "Select installation class", "aide", 0, 0 ],
+ setupSCSI => [ "Setup SCSI", "aide", 0, 1 ],
+ partitionDisks => [ "Setup filesystems", "aide", 0, 1 ],
+ findInstallFiles => [ "Find installation files", "aide", 1, 0 ],
+ choosePackages => [ "Choose packages to install", "aide", 0, 0 ],
+ doInstallStep => [ "Install system", "aide", 0, 0 ],
+# configureMouse => [ "Configure mouse", "aide", 0, 0 ],
+ finishNetworking => [ "Configure networking", "aide", 0, 0 ],
+# configureTimezone => [ "Configure timezone", "aide", 0, 0 ],
+# configureServices => [ "Configure services", "aide", 0, 0 ],
+# configurePrinter => [ "Configure printer", "aide", 0, 0 ],
+ setRootPassword => [ "Set root password", "aide", 0, 0 ],
+ addUser => [ "Add a user", "aide", 0, 0 ],
+ createBootdisk => [ "Create bootdisk", "aide", 0, 1 ],
+ setupBootloader => [ "Install bootloader", "aide", 0, 1 ],
+# configureX => [ "Configure X", "aide", 0, 0 ],
+ exitInstall => [ "Exit install", "aide", 0, 0, undef, 'done' ],
);
# this table is translated at run time
my @upgradeSteps = (
- setupSCSI => [ "Setup SCSI", 0, 0 ],
- upgrFindInstall => [ "Find current installation", 0, 0 ],
- findInstallFiles => [ "Find installation files", 1, 0 ],
- upgrChoosePackages => [ "Choose packages to upgrade", 0, 0 ],
- doInstallStep => [ "Upgrade system", 0, 0 ],
- createBootdisk => [ "Create bootdisk", 0, 0 , 'none' ],
- setupBootloader => [ "Install bootloader", 0, 0 ],
- exitInstall => [ "Exit install", 0, 0 , undef, 'done' ],
+ selectLanguage => [ "Choose your language", "aide", 0, 0 ],
+ selectPath => [ "Choose install or upgrade", "aide", 0, 0 ],
+ selectInstallClass => [ "Select installation class", "aide", 0, 0 ],
+ setupSCSI => [ "Setup SCSI", "aide", 0, 0 ],
+ upgrFindInstall => [ "Find current installation", "aide", 0, 0 ],
+ findInstallFiles => [ "Find installation files", "aide", 1, 0 ],
+ upgrChoosePackages => [ "Choose packages to upgrade", "aide", 0, 0 ],
+ doInstallStep => [ "Upgrade system", "aide", 0, 0 ],
+ createBootdisk => [ "Create bootdisk", "aide", 0, 0 , 'none' ],
+ setupBootloader => [ "Install bootloader", "aide", 0, 0 ],
+ exitInstall => [ "Exit install", "aide", 0, 0 , undef, 'done' ],
);
-my (%installSteps, %upgradeSteps);
+my (%installSteps, %upgradeSteps, @orderedInstallSteps, @orderedUpgradeSteps);
for (my $i = 0; $i < @installSteps; $i += 2) {
my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };
$h{prev} ||= $installSteps[$i - 2];
$h{next} ||= $installSteps[$i + 2];
$installSteps{ $installSteps[$i] } = \%h;
+ push @orderedInstallSteps, $installSteps[$i];
}
$installSteps{first} = $installSteps[0];
for (my $i = 0; $i < @upgradeSteps; $i += 2) {
@@ -69,6 +75,7 @@ for (my $i = 0; $i < @upgradeSteps; $i += 2) {
$h{prev} ||= $upgradeSteps[$i - 2];
$h{next} ||= $upgradeSteps[$i + 2];
$upgradeSteps{ $upgradeSteps[$i] } = \%h;
+ push @orderedUpgradeSteps, $installSteps[$i];
}
$upgradeSteps{first} = $upgradeSteps[0];
@@ -103,12 +110,17 @@ my $default = {
],
shells => [ map { "/bin/$_" } qw(bash tcsh zsh ash) ],
};
-$o = { default => $default };
+$o = { default => $default, steps => \%installSteps, orderedSteps => \@orderedInstallSteps };
+sub selectLanguage {
+ $o->{lang} = $o->chooseLanguage;
+}
+
sub selectPath {
$o->{isUpgrade} = $o->selectInstallOrUpgrade;
- $o->{steps} = $o->{isUpgrade} ? \%upgradeSteps : \%installSteps;
+ $o->{steps} = $o->{isUpgrade} ? \%upgradeSteps : \%installSteps;
+ $o->{orderedSteps} = $o->{isUpgrade} ? \@orderedUpgradeSteps : \@orderedInstallSteps;
}
sub selectInstallClass {
@@ -170,9 +182,15 @@ sub findInstallFiles {
$o->{comps} = $o->{method}->getComponentSet($o->{packages});
}
-sub choosePackages {
+sub choosePackages {
+ # remove Base from comps so that it's hidden
+ my $base = $o->{comps}->{Base};
+ delete $o->{comps}->{Base};
+
$o->choosePackages($o->{packages}, $o->{comps});
+ #restore Base
+ $o->{comps}->{Base} = $base;
$o->{comps}->{Base}->{selected} = 1;
foreach (grep { $_->{selected} } values %{$o->{comps}}) {
@@ -208,7 +226,15 @@ sub setupBootloader {
sub configureX { $o->setupXfree; }
-sub exitInstall { $o->exitInstall }
+sub exitInstall {
+ $o->warn(
+"Congratulations, installation is complete.
+Remove the boot media and press return to reboot.
+For information on fixes which are available for this release of Linux Mandrake,
+consult the Errata available from http://www.linux-mandrake.com/.
+Information on configuring your system is available in the post
+install chapter of the Official Linux Mandrake User's Guide.");
+}
sub main {
$SIG{__DIE__} = sub { chomp $_[0]; log::l("ERROR: $_[0]") };
@@ -235,8 +261,6 @@ sub main {
$o = install_steps_graphical->new($o);
- $o->{lang} = $o->chooseLanguage;
-
$o->{netc} = net::readNetConfig("/tmp");
if (my ($file) = glob_('/tmp/ifcfg-*')) {
log::l("found network config file $file");
@@ -252,12 +276,10 @@ sub main {
$o->{keyboard} = eval { keyboard::read("/tmp/keyboard") } || $default->{keyboard};
- selectPath();
-
for (my $step = $o->{steps}->{first}; $step ne 'done'; $step = getNextStep($step)) {
- log::l("entering step $step");
- &{$main::{$step}}() and $o->{steps}->{completed} = 1;
- log::l("step $step finished");
+ $o->enteringStep($step);
+ &{$main::{$step}}() and $o->{steps}->{$step}->{completed} = 1;
+ $o->leavingStep($step);
}
killCardServices();
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 779a3bbc4..b64952370 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -22,12 +22,23 @@ my $o;
1;
+sub warn {}
+
sub new($$) {
my ($type, $o_) = @_;
$o = bless $o_, ref $type || $type;
}
+sub enteringStep($$) {
+ my ($o, $step) = @_;
+ log::l("starting step `$step'");
+}
+sub leavingStep($$) {
+ my ($o, $step) = @_;
+ log::l("step `$step' finished");
+}
+
sub chooseLanguage($) {
# eval { run_program::run('loadkeys', "/tmp/$o->{default}->{lang}) }; $@ and log::l("loadkeys failed");
$o->{default}->{lang};
diff --git a/perl-install/install_steps_stdio.pm b/perl-install/install_steps_stdio.pm
index c752e62df..44de0dd60 100644
--- a/perl-install/install_steps_stdio.pm
+++ b/perl-install/install_steps_stdio.pm
@@ -18,6 +18,15 @@ use log;
1;
+sub enteringStep($$$) {
+ my ($o, $step) = @_;
+ print "Starting step `$o->{steps}->{$step}->{text}'\n";
+}
+sub leavingStep {
+ my ($o) = @_;
+ print "--------\n";
+}
+
sub chooseLanguage($) {
my $lang = ask_from_list('Language', 'Which language do you want?', [ lang::list() ]);
run_program::run('xmodmap', "/usr/bin/$lang.map");
@@ -120,18 +129,6 @@ the Mandrake rescue image, making it much easier to recover from severe system
failures. Would you like to create a bootdisk for your system?");
}
-sub exitInstall {
- ask_warn('',
-"Congratulations, installation is complete.
-Remove the boot media and press return to reboot.
-For information on fixes which are available for this release of Linux Mandrake,
-consult the Errata available from http://www.linux-mandrake.com/.
-Information on configuring your system is available in the post
-install chapter of the Official Linux Mandrake User's Guide.");
-}
-
-
-
sub readln {
my $l = <STDIN>;
chomp $l;
@@ -140,13 +137,12 @@ sub readln {
sub ask_warn {
my ($title, @msgs) = @_;
- print "----------\n", map { "$_\n" } @_;
- print "Press enter"; readln();
+ warn(@msgs);
}
sub ask_yesorno {
my ($title, @msgs) = @_;
- print "----------\n", join("\n", @_);
+ print join("\n", @_);
print " (yes/No) "; readln() =~ /y/i;
}
@@ -159,7 +155,7 @@ sub check_it {
sub ask_from_list {
my ($title, @msgs) = @_;
my $list = pop @msgs;
- print "----------\n", map { "$_\n" } @msgs;
+ print map { "$_\n" } @msgs;
my $n = 0; foreach (@$list) { $n++; print "$n: $_\n"; }
my $i;
do {
@@ -175,7 +171,7 @@ sub ask_many_from_list {
my $default = pop @msgs;
my $list = pop @msgs;
my @defaults;
- print "----------\n", map { "$_\n" } @msgs;
+ print map { "$_\n" } @msgs;
my $n = 0; foreach (@$list) {
$n++;
print "$n: $_\n";
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 99636cf21..778cf53cb 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -204,6 +204,7 @@ sub _create_window($$) {
$o->{window}->set_title($title);
$o->{window}->signal_connect("expose_event" => sub { c::XSetInputFocus($o->{window}->window->XWINDOW) }) if $my_gtk::force_focus;
$o->{window}->signal_connect("delete_event" => sub { $o->{retval} = undef; Gtk->main_quit });
+ $o->{window}->set_uposition(@$my_gtk::force_position) if $my_gtk::force_position;
$o->{window}
}
@@ -241,16 +242,13 @@ sub _ask_from_entry($$@) {
sub _ask_from_list($$$@) {
my ($o, $l, @msgs) = @_;
my $list = new Gtk::List;
+ my @sorted = sort @$l;
$list->signal_connect(select_child => sub {
- $o->{retval} = $l->[$list->child_position($_[1])];
+ $o->{retval} = $sorted[$list->child_position($_[1])];
Gtk->main_quit;
});
- gtkadd($list, map { new Gtk::ListItem($_) } @$l);
+ gtkadd($list, map { new Gtk::ListItem($_) } @sorted);
-# myadd($o->{window},
-# mypack_(myset_usize(new Gtk::VBox(0,0), 0, 200),
-# 0, $o->create_box_with_title(@msgs),
-# 1, createScrolledWindow(mypack(new Gtk::VBox(0,0), @l))));
gtkadd($o->{window}, gtkpack($o->create_box_with_title(@msgs), $list));
}
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 103af1ec3..d512c7c5a 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -21,7 +21,9 @@ sub skipThisPackage { member($_[0], @skipThesesPackages) }
sub addInfosFromHeader($$) {
my ($packages, $header) = @_;
- $packages->{c::headerGetEntry($header, 'name')} = {
+ my $name = c::headerGetEntry($header, 'name');
+ $packages->{$name} = {
+ name => $name,
header => $header, size => c::headerGetEntry($header, 'size'),
group => c::headerGetEntry($header, 'group') || "(unknown group)",
};