summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Makefile2
-rw-r--r--perl-install/commands.pm2
-rw-r--r--perl-install/common.pm2
-rw-r--r--perl-install/fs.pm4
-rw-r--r--perl-install/install2.pm5
-rw-r--r--perl-install/install_steps_stdio.pm6
-rw-r--r--perl-install/modules.pm2
-rw-r--r--perl-install/my_gtk.pm40
-rw-r--r--perl-install/partition_table.pm6
-rw-r--r--perl-install/pkgs.pm8
10 files changed, 38 insertions, 39 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile
index bfc8a9622..5381b1391 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -134,7 +134,7 @@ full_stage2:
stage2:
$(MAKE) install_pms
cd $(ROOTDEST) ; tar cfz /tmp/instimage-full.tgz Mandrake
- cd $(ROOTDEST) ; tar cfz /tmp/instimage-light.tgz Mandrake/instimage/usr/[bl]*
+ cd $(ROOTDEST) ; tar cfz /tmp/instimage-light.tgz Mandrake/base/depslist Mandrake/instimage/usr/[bl]*
@#rm -rf /mnt/initrd/*
@#cp -a $(DEST)/* /mnt/initrd
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index 17f4b2580..9b06743fa 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -77,7 +77,7 @@ sub mkdir_ {
}
mkdir $_[0], 0755 or die "mkdir: error creating directory $_: $!\n";
};
- foreach (@_) { &$mkdir($_); }
+ &$mkdir($_) foreach @_;
}
diff --git a/perl-install/common.pm b/perl-install/common.pm
index feec2e844..429a18d35 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -20,7 +20,7 @@ $SECTORSIZE = 512;
1;
-sub _ { my $s = shift; sprintf translate($s), @_ }
+sub _ { my $s = shift @_; sprintf translate($s), @_ }
sub __ { $_[0] }
sub min { my $min = shift; grep { $_ < $min and $min = $_; } @_; $min }
sub max { my $max = shift; grep { $_ > $max and $max = $_; } @_; $max }
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 024ceb5e6..0b08c0775 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -239,7 +239,5 @@ sub write_fstab($;$$) {
exists $new{$a} || exists $new{$b} and next;
print F $_;
}
- foreach (@to_add) {
- print F join(" ", @$_), "\n";
- }
+ print F join(" ", @$_), "\n" foreach @to_add;
}
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 049331533..0ba4ae3b0 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -107,7 +107,7 @@ my $default = {
[ 0, __('Games') => qw(xbill xboard xboing xfishtank xgammon xjewel xpat2 xpilot xpuzzles xtrojka xkobo freeciv) ],
],
packages => [ qw() ],
- partitionning => { clearall => 0, eraseBadPartitions => 1, autoformat => 1 },
+ partitionning => { clearall => $::testing, eraseBadPartitions => 1, autoformat => 1 },
partitions => [
{ mntpoint => "/boot", size => 16 << 11, type => 0x83 },
{ mntpoint => "/", size => 300 << 11, type => 0x83 },
@@ -282,7 +282,8 @@ sub main {
for (my $step = $o->{steps}->{first}; $step ne 'done'; $step = getNextStep($step)) {
$o->enteringStep($step);
- &{$install2::{$step}}() and $o->{steps}->{$step}->{completed} = 1;
+ eval { &{$install2::{$step}}() };
+ $@ and $o->warn($@);
$o->leavingStep($step);
}
killCardServices();
diff --git a/perl-install/install_steps_stdio.pm b/perl-install/install_steps_stdio.pm
index 9db9b2f9f..4c4c74c84 100644
--- a/perl-install/install_steps_stdio.pm
+++ b/perl-install/install_steps_stdio.pm
@@ -64,15 +64,13 @@ sub choosePackages($$$) {
[ map { $_->{selected} } @$comps ]);
for (my $i = 0; $i < @$comps; $i++) {
- $comps[$i]->{selected} = $r[$i];
+ $comps->[$i]->{selected} = $r[$i];
}
}
sub installPackages {
my $o = shift;
- $::testing and exit 0;
-
my $old = \&log::ld;
local *log::ld = sub {
my $m = shift;
@@ -187,7 +185,7 @@ sub ask_many_from_list {
foreach (@t) { check_it($_, $n) or goto TRY_AGAIN }
my @rr = (0) x @$list;
- foreach (@t) { $rr[$_ - 1] = 1; }
+ $rr[$_ - 1] = 1 foreach @t;
@rr;
}
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 8ccf611ca..6f6f5976e 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -206,7 +206,7 @@ sub load($;$$) {
$type or ($type, $minor) = @{$drivers{$name}}[3,4];
- foreach (@{$deps{$name}}) { load($_, 'prereq', $minor) }
+ load($_, 'prereq', $minor) foreach @{$deps{$name}};
load_raw($name, $type, $minor);
}
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index c2f0166bf..b432e706b 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -33,7 +33,9 @@ sub new {
sub main($;$) {
my ($o, $f) = @_;
$o->show;
+ $o->{window}->grab_add;
do { Gtk->main } while ($o->{retval} && $f && !&$f());
+ $o->{window}->grab_remove;
$o->destroy;
$o->{retval}
}
@@ -253,31 +255,33 @@ sub _ask_from_list($$$@) {
for (my $i = 0; $i < @sorted; $i++) {
my $focused = $i;
my $w = new Gtk::ListItem($sorted[$i]);
- $w->signal_connect(key_press_event => sub {
+ my $id = $w->signal_connect(key_press_event => sub {
my ($w, $e)= @_;
my $c = chr $e->{keyval};
-
+
Gtk->timeout_remove($timeout) if $timeout; $timeout = '';
-
+
if ($e->{keyval} >= 0x100) {
- if ($c eq "\r" || $c eq "\x8d") {
- $list->select_item($focused);
- }
- $starting_word = '';
+ if ($c eq "\r" || $c eq "\x8d") {
+ $list->select_item($focused);
+ }
+ $starting_word = '';
} else {
- my $curr = $focused + bool($starting_word eq '' || $starting_word eq $c);
- $starting_word .= $c unless $starting_word eq $c;
-
- my $j; for ($j = 0; $j < @sorted; $j++) {
- $sorted[($j + $curr) % @sorted] =~ /^$starting_word/i and last;
- }
- $j == @sorted ?
- $starting_word = '' :
- $widgets[($j + $curr) % @sorted]->grab_focus;
-
- $timeout = Gtk->timeout_add($forgetTime, sub { $timeout = $starting_word = ''; 0 } );
+ my $curr = $focused + bool($starting_word eq '' || $starting_word eq $c);
+ $starting_word .= $c unless $starting_word eq $c;
+
+ my $j; for ($j = 0; $j < @sorted; $j++) {
+ $sorted[($j + $curr) % @sorted] =~ /^$starting_word/i and last;
+ }
+ $j == @sorted ?
+ $starting_word = '' :
+ $widgets[($j + $curr) % @sorted]->grab_focus;
+
+ $w->{timeout} = $timeout = Gtk->timeout_add($forgetTime, sub { $timeout = $starting_word = ''; 0 } );
}
+ 1;
});
+ push @::ask_from_list_widgets, $w; # hack!! to not get SIGSEGV
push @widgets, $w;
}
gtkadd($list, @widgets);
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 3f46e7ea7..0ad949a53 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -156,9 +156,7 @@ sub read_one($$) {
@extended > 1 and die "more than one extended partition";
- foreach (@normal, @extended) {
- $_->{rootDevice} = $hd->{device};
- }
+ $_->{rootDevice} = $hd->{device} foreach @normal, @extended;
{ raw => $pt, extended => $extended[0], normal => \@normal };
}
@@ -236,7 +234,7 @@ sub write($) {
sub active($$) {
my ($hd, $part) = @_;
- foreach (@{$hd->{primary}->{normal}}) { $_->{active} = 0; }
+ $_->{active} = 0 foreach @{$hd->{primary}->{normal}};
$part->{active} = 0x80;
}
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index bb485e767..5407cd045 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -181,10 +181,10 @@ sub install {
my ($total, $nb);
foreach my $p (@$toInstall) {
- $p->{file} ||=
- install_any::imageGetFile(sprintf "%s-%s-%s.%s.rpm",
- map { c::headerGetEntry($p->{header}, $_) }
- qw(name version release arch));
+ local *F;
+ open F, $p->{file} or die "error opening package $p->{name} (file $p->{file})";
+ $p->{header} = c::rpmReadPackageHeader(fileno F);
+
c::rpmtransAddPackage($trans, $p->{header}, $p->{file}, $isUpgrade);
$nb++;
$total += $p->{size};