diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-09-04 16:54:19 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-09-04 16:54:19 +0000 |
commit | 68c3c1cd6e89d6a0f91f6c86510ec661864da336 (patch) | |
tree | 13b7ddd23376813d75e546241bcd09a8c8edd8a9 /perl-install | |
parent | d1e96894b39e141a9c0fa6ef999eb751ef87ebf4 (diff) | |
download | drakx-backup-do-not-use-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar drakx-backup-do-not-use-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar.gz drakx-backup-do-not-use-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar.bz2 drakx-backup-do-not-use-68c3c1cd6e89d6a0f91f6c86510ec661864da336.tar.xz drakx-backup-do-not-use-68c3c1cd6e89d6a0f91f6c86510ec661864da336.zip |
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/detect_devices.pm | 10 | ||||
-rw-r--r-- | perl-install/install2.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 4 | ||||
-rw-r--r-- | perl-install/modules.pm | 13 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 5 |
6 files changed, 21 insertions, 15 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index c0cdb221d..47220af91 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -31,7 +31,9 @@ sub get { sub hds() { grep { $_->{type} eq 'hd' } get(); } sub cdroms() { grep { $_->{type} eq 'cdrom' } get(); } sub floppies() { - (grep { tryOpen($_) } qw(fd0 fd1)), + (grep { + my $fd = tryOpen(); + } qw(fd0 fd1)), (grep { $_->{type} eq 'fd' } get()); } @@ -160,12 +162,12 @@ sub hasNetDevice($) { c::hasNetDevice($_[0]) } sub tryOpen($) { local *F; - sysopen F, devices::make($_[0]), c::O_NONBLOCK(); + sysopen F, devices::make($_[0]), c::O_NONBLOCK() and \*F; } sub syslog { my $file = "/var/log/dmesg"; -r $file or $file = "/tmp/syslog"; - cat_($file); - `dmesg`; + my @l = cat_($file); + @l ? @l : `dmesg`; } diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 0823b977a..ffa55fd36 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -414,7 +414,7 @@ sub formatPartitions { fs::mount_all([ grep { isExt2($_) || isSwap($_) } @{$o->{fstab}} ], $o->{prefix}); } mkdir "$o->{prefix}/$_", 0755 foreach qw(dev etc etc/sysconfig etc/sysconfig/network-scripts - home mnt tmp var var/tmp var/lib var/lib/rpm); + home mnt root tmp var var/tmp var/lib var/lib/rpm); } #------------------------------------------------------------------------------ diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 5d51e4ead..1b1c59f5f 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -144,7 +144,7 @@ sub installPackages($$) { sub afterInstallPackages($) { my ($o) = @_; - # why not? + # why not? cuz weather is nice today :-) [pixel] sync(); sync(); # configPCMCIA($o->{rootPath}, $o->{pcmcia}); diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index b0bdaf675..f823b1398 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -187,8 +187,8 @@ sub printerConfig($) { my @port = (); foreach ("lp0", "lp1", "lp2") { local *LP; - push @port, "/dev/$_" if open LP, ">/dev/$_" - } + push @port, "/dev/$_" if open LP, ">/dev/$_"; + } eval { modules::unload("lp") }; my $string = _("What device is your printer connected to diff --git a/perl-install/modules.pm b/perl-install/modules.pm index f8bacd5cd..f24a844bf 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -308,7 +308,10 @@ sub read_conf { # cheating here: not handling aliases of aliases while (my ($k, $v) = each %c) { $c{scsi} ||= $v->{scsi_hostadapter}; - add2hash($c{$v->{alias}} ||= {}, $v) if $v->{alias}; + if (my $a = $v->{alias}) { + local $c{$a}{alias}; + add2hash($c{$a}, $v); + } } %c; } @@ -328,7 +331,7 @@ sub write_conf { print "#" if $scsi; $scsi ||= 1; } - print F "$type $mod $v2\n"; + print F "$type $mod $v2\n" unless $type eq "loaded"; } } } @@ -336,9 +339,9 @@ sub write_conf { sub get_stage1_conf { %conf = read_conf($_[0]); - $conf{alias}{parport_lowlevel} ||= "parport_pc"; - $conf{"pre-install"}{pcmcia_core} ||= "/etc/rc.d/init.d/pcmcia start"; - $conf{"pre-install"}{plip} ||= "modprobe parport_pc ; echo 7 > /proc/parport/0/irq"; + $conf{parport_lowlevel}{alias} ||= "parport_pc"; + $conf{pcmcia_core}{"pre-install"} ||= "/etc/rc.d/init.d/pcmcia start"; + $conf{plip}{"pre-install"} ||= "modprobe parport_pc ; echo 7 > /proc/parport/0/irq"; } sub load_thiskind($;&) { diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index a7e983c46..4b07450a3 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -23,6 +23,7 @@ sub Package { sub select($$;$) { my ($packages, $p, $base) = @_; + $p->{base} ||= $base; $p->{selected} = -1; # selected by user my @l = @{$p->{deps} || die "missing deps file"}; while (@l) { @@ -226,12 +227,12 @@ sub setSelectedFromCompssList($$$$$) { sub init_db { my ($prefix, $isUpgrade) = @_; - my $f = "$prefix/tmp/" . ($isUpgrade ? "upgrade" : "install") . ".log"; + my $f = "$prefix/root/" . ($isUpgrade ? "upgrade" : "install") . ".log"; open(F, "> $f") ? log::l("opened $f") : log::l("Failed to open $f. No install log will be kept."); $fd = fileno(F) || log::fd() || 2; c::rpmErrorSetCallback($fd); # c::rpmSetVeryVerbose(); - + log::l("reading /usr/lib/rpm/rpmrc"); c::rpmReadConfigFiles() or die "can't read rpm config files"; log::l("\tdone"); |