summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-04-25 16:12:35 +0000
committerFrancois Pons <fpons@mandriva.com>2000-04-25 16:12:35 +0000
commit25946f2b1829f207aab844f3464ce515a50f15cc (patch)
treea6141f24a052d20499f34fb6ea92738273eacd79
parent4a62fb92b80fad9ba61cf0b4dd74fc5b03dcd94d (diff)
downloaddrakx-25946f2b1829f207aab844f3464ce515a50f15cc.tar
drakx-25946f2b1829f207aab844f3464ce515a50f15cc.tar.gz
drakx-25946f2b1829f207aab844f3464ce515a50f15cc.tar.bz2
drakx-25946f2b1829f207aab844f3464ce515a50f15cc.tar.xz
drakx-25946f2b1829f207aab844f3464ce515a50f15cc.zip
*** empty log message ***
-rw-r--r--perl-install/ChangeLog10
-rw-r--r--perl-install/install_any.pm4
-rw-r--r--perl-install/install_steps.pm22
-rw-r--r--perl-install/install_steps_interactive.pm27
-rw-r--r--perl-install/network.pm5
-rw-r--r--perl-install/pkgs.pm2
-rw-r--r--perl-install/printer.pm4
-rw-r--r--perl-install/printerdrake.pm9
8 files changed, 67 insertions, 16 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 774747810..28e9a770c 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,3 +1,13 @@
+2000-04-25 Fran�ois Pons <fpons@mandrakesoft.com>
+
+ * printerdrake.pm: added support for PPA more easily, allow
+ printers entry using ppa driver event if pnm2ppa not installed,
+ install it if neccessary after.
+ * network.pm, install_steps.pm, install_steps_interactive.pm:
+ added support for stoping a network interface, usefull for ppp0 to
+ avoid using it too long.
+ * install_steps.pm: fixed missing local on pap_secrets file.
+
2000-04-25 Pixel <pixel@mandrakesoft.com>
* lilo.pm (suggest): moved the generation of the keytable here. It
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index cfeadf928..103e1dd73 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -33,8 +33,8 @@ use log;
@needToCopy = qw(
XFree86-8514 XFree86-AGX XFree86-Mach32 XFree86-Mach64 XFree86-Mach8 XFree86-Mono
XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128
-XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs XFree86-FBDev
-XFree86 dhcpxd pump ppp ypbind rhs-printfilters samba ncpfs kernel-fb
+XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs XFree86-FBDev XFree86-server
+XFree86 dhcpxd pump ppp ypbind rhs-printfilters pnm2ppa samba ncpfs kernel-fb
);
#-######################################################################################
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 6ba1ebb13..363149d52 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -477,9 +477,11 @@ sub pppConfig {
do { $replaced ||= 1
if s/^\s*$toreplace{login}\s+ppp0\s+(\S+)/$toreplace{login} ppp0 $toreplace{passwd}/; } foreach @l;
if ($replaced) {
+ local *F;
open F, ">$o->{prefix}/etc/ppp/pap-secrets" or die "Can't open $o->{prefix}/etc/ppp/pap-secrets $!";
print F @l;
} else {
+ local *F;
open F, ">>$o->{prefix}/etc/ppp/pap-secrets" or die "Can't open $o->{prefix}/etc/ppp/pap-secrets $!";
print F "$toreplace{login} ppp0 $toreplace{passwd}\n";
}
@@ -843,12 +845,12 @@ sub generateAutoInstFloppy($) {
#------------------------------------------------------------------------------
sub upNetwork {
- my ($o) = @_;
+ my ($o, $pppAvoided) = @_;
modules::write_conf("$o->{prefix}/etc/conf.modules");
if ($o->{intf} && $o->{netc}{NETWORKING} ne 'false') {
network::up_it($o->{prefix}, $o->{intf});
- } elsif ($o->{modem} && !$o->{modem}{isUp}) {
+ } elsif (!$pppAvoided && $o->{modem} && !$o->{modem}{isUp}) {
run_program::rooted($o->{prefix}, "ifup", "ppp0");
$o->{modem}{isUp} = 1;
} else {
@@ -858,6 +860,22 @@ sub upNetwork {
}
#------------------------------------------------------------------------------
+sub downNetwork {
+ my ($o, $pppOnly) = @_;
+
+ modules::write_conf("$o->{prefix}/etc/conf.modules");
+ if (!$pppOnly && $o->{intf} && $o->{netc}{NETWORKING} ne 'false') {
+ network::down_it($o->{prefix}, $o->{intf});
+ } elsif ($o->{modem} && $o->{modem}{isUp}) {
+ run_program::rooted($o->{prefix}, "ifup", "ppp0");
+ $o->{modem}{isUp} = 0;
+ } else {
+ $::testing or return;
+ }
+ 1;
+}
+
+#------------------------------------------------------------------------------
sub cleanIfFailedUpgrade($) {
my ($o) = @_;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index dad9f29f7..c79b8aed6 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -474,7 +474,7 @@ Your host name should be a fully-qualified host name,
such as ``mybox.mylab.myco.com''.
You may also enter the IP address of the gateway if you have one"),
[_("Host name:"), _("DNS server:"), _("Gateway:"), $::expert ? _("Gateway device:") : ()],
- [(map { \$netc->{$_}} qw(HOSTNAME dnsServer GATEWAY)),
+ [(map { \$netc->{$_} } qw(HOSTNAME dnsServer GATEWAY)),
{val => \$netc->{GATEWAYDEV}, list => \@devices}]
);
@@ -497,7 +497,8 @@ sub pppConfig {
$m->{device} ||= $o->set_help('selectSerialPort') &&
mouse::serial_ports_names2dev(
$o->ask_from_list('', _("Please choose which serial port your modem is connected to."),
- [ mouse::serial_ports_names ]));
+ [ grep { my $avoidDevice = mouse::serial_ports_name2dev($_);
+ $o->{mouse}{device} !~ /$avoidDevice/ } mouse::serial_ports_names ]));
$o->set_help('configureNetworkISP');
install_steps::pppConfig($o) if $o->ask_from_entries_refH('',
@@ -558,7 +559,8 @@ USA")) || return;
};
return if $@;
- $o->upNetwork;
+ #- bring all interface up for installing crypto packages.
+ $o->upNetwork();
my @packages = do {
my $w = $o->wait_message('', _("Contacting the mirror to get the list of available packages"));
@@ -569,6 +571,9 @@ USA")) || return;
\@packages, [ map { \$h{$_} } @packages ]) or return;
$u->{packages} = [ grep { $h{$_} } @packages ];
install_steps::installCrypto($o);
+
+ #- stop interface using ppp only.
+ $o->downNetwork('pppOnly');
}
#------------------------------------------------------------------------------
@@ -597,8 +602,13 @@ sub printerConfig {
require printerdrake;
if ($::beginner && !$clicked) {
- printerdrake::auto_detect($o) or return;
+ printerdrake::auto_detect($o) or return;
}
+
+ #- bring interface up for installing ethernet packages but avoid ppp by default,
+ #- else the guy know what he is doing...
+ $o->upNetwork('pppAvoided');
+
eval { add2hash($o->{printer} ||= {}, printer::getinfo($o->{prefix})) };
printerdrake::main($o->{printer}, $o, sub { $o->pkg_install($_[0]) });
}
@@ -1163,9 +1173,14 @@ sub setup_thiskind {
}
sub upNetwork {
- my ($o) = @_;
+ my ($o, $pppAvoided) = @_;
my $w = $o->wait_message('', _("Bringing up the network"));
- install_steps::upNetwork($o);
+ install_steps::upNetwork($o, $pppAvoided);
+}
+sub downNetwork {
+ my ($o, $pppOnly) = @_;
+ my $w = $o->wait_message('', _("Bringing down the network"));
+ install_steps::downNetwork($o, $pppOnly);
}
diff --git a/perl-install/network.pm b/perl-install/network.pm
index deb092992..ac0610c21 100644
--- a/perl-install/network.pm
+++ b/perl-install/network.pm
@@ -55,6 +55,11 @@ sub up_it {
run_program::rooted($prefix, "/etc/rc.d/init.d/network", "start");
$_->{isUp} = 1 foreach @$intfs;
}
+sub down_it {
+ my ($prefix, $intfs) = @_;
+ run_program::rooted($prefix, "/etc/rc.d/init.d/network", "stop");
+ $_->{isUp} = 1 foreach @$intfs;
+}
sub write_conf {
my ($file, $netc) = @_;
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 5357c92e5..eb6b88050 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -202,7 +202,7 @@ sub packagesOfMedium {
}
sub packagesToInstall {
my ($packages) = @_;
- grep { pkgs::packageFlagSelected($_) && !pkgs::packageFlagInstalled($_) } values %{$packages->[0]};
+ grep { $_->{medium}{selected} && packageFlagSelected($_) && !packageFlagInstalled($_) } values %{$packages->[0]};
}
sub allMediums {
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 69a8db954..13f5a3f50 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -328,7 +328,7 @@ sub getinfo($) {
sub read_printer_db(;$) {
my $dbpath = $prefix . ($_[0] || $PRINTER_DB_FILE);
- scalar(keys %thedb) > 3 and return; #- try reparse if using only ppa, POSTSCRIPT, TEXT.
+ scalar(keys %thedb) > 4 and return; #- try reparse if using only ppa, POSTSCRIPT, TEXT.
my %available_devices; #- keep only available devices in our database.
local *AVAIL; open AVAIL, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/gs --help |";
@@ -338,7 +338,7 @@ sub read_printer_db(;$) {
}
}
close AVAIL;
- $available_devices{ppa} = undef if -x "$prefix/usr/bin/pbm2ppa" && -x "$prefix/usr/bin/pnm2ppa";
+ $available_devices{ppa} = undef; #- if -x "$prefix/usr/bin/pbm2ppa" && -x "$prefix/usr/bin/pnm2ppa";
delete $available_devices{''};
@available_devices{qw/POSTSCRIPT TEXT/} = (); #- these are always available.
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 162ec798c..3ae4bba8f 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -112,8 +112,8 @@ _("Password") => {val => \$printer->{NCPPASSWD}, hidden => 1} ],
1;
}
-sub setup_gsdriver($$) {
- my ($printer, $in) = @_;
+sub setup_gsdriver($$$) {
+ my ($printer, $in, $install) = @_;
my $action;
my @action = qw(ascii ps both done);
my %action = (
@@ -137,6 +137,9 @@ sub setup_gsdriver($$) {
my %db_entry = %{$printer::thedb{$printer->{DBENTRY}}};
+ #- specific printer driver to install.
+ &$install('pnm2ppa') if $db_entry{GSDRIVER} eq 'ppa';
+
my @list_res = @{$db_entry{RESOLUTION} || []};
my @res = map { "$_->{XDPI}x$_->{YDPI}" } @list_res;
my @list_col = @{$db_entry{BITSPERPIXEL} || []};
@@ -290,7 +293,7 @@ _("Printer Connection") => { val => \$printer->{str_type}, not_edit => 1, list =
}
#- configure ghostscript driver to be used.
- if (!$continue && setup_gsdriver($printer, $in)) {
+ if (!$continue && setup_gsdriver($printer, $in, $install)) {
delete $printer->{OLD_QUEUE}
if $printer->{QUEUE} ne $printer->{OLD_QUEUE} && $printer->{configured}{$printer->{QUEUE}};
$continue = !$::beginner;