summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-09-12 16:41:50 +0000
committerFrancois Pons <fpons@mandriva.com>2000-09-12 16:41:50 +0000
commit863a98bef672dae191ab3c107ac26558954cf389 (patch)
tree62941c6178cb44d459bcdee0b937ec38de113e6c /perl-install
parentdff746444b3fc778dbf9f818cc3247161548cebe (diff)
downloaddrakx-backup-do-not-use-863a98bef672dae191ab3c107ac26558954cf389.tar
drakx-backup-do-not-use-863a98bef672dae191ab3c107ac26558954cf389.tar.gz
drakx-backup-do-not-use-863a98bef672dae191ab3c107ac26558954cf389.tar.bz2
drakx-backup-do-not-use-863a98bef672dae191ab3c107ac26558954cf389.tar.xz
drakx-backup-do-not-use-863a98bef672dae191ab3c107ac26558954cf389.zip
*** empty log message ***
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install2.pm3
-rw-r--r--perl-install/printer.pm24
-rw-r--r--perl-install/printerdrake.pm54
3 files changed, 50 insertions, 31 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index b3545e3b1..90e711388 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -496,6 +496,7 @@ sub main {
method => sub { $o->{method} = $v },
pcmcia => sub { $o->{pcmcia} = $v },
vga16 => sub { $o->{vga16} = $v },
+ vga => sub { $o->{vga} = $v },
step => sub { $o->{steps}{first} = $v },
expert => sub { $::expert = 1; $::beginner = 0 },
beginner => sub { $::beginner = $v },
@@ -523,7 +524,7 @@ sub main {
g_auto_install => sub { $::testing = $::g_auto_install = 1; $o->{partitioning}{auto_allocate} = 1 },
nomouseprobe => sub { $o->{nomouseprobe} = $v },
}}{lc $n}; &$f if $f;
- } %cmdline;
+ } %cmdline;
undef $::auto_install if $cfg;
if ($::g_auto_install) {
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 173939656..f524c33cd 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -16,12 +16,14 @@ my $PRINTER_DB_FILE = "/usr/lib/rhs/rhs-printfilters/printerdb";
my $PRINTER_FILTER_DIR = "/usr/lib/rhs/rhs-printfilters";
%printer_type = (
- __("Local printer") => "LOCAL",
- __("Network printer (lpd)") => "REMOTE",
- __("SMB/Windows 95/98/NT") => "SMB",
- __("NetWare") => "NCP",
- __("Socket") => "SOCKET",
- __("Printer Device URI") => "URI",
+ __("Local printer") => "LOCAL",
+ __("Remote printer") => "REMOTE",
+ __("Remote cups server") => "CUPS",
+ __("Remote lpd server") => "LPD",
+ __("Network printer (socket)") => "SOCKET",
+ __("SMB/Windows 95/98/NT") => "SMB",
+ __("NetWare") => "NCP",
+ __("Printer Device URI") => "URI",
);
%printer_type_inv = reverse %printer_type;
@@ -44,8 +46,8 @@ sub default_spooldir($) { "/var/spool/lpd/" . default_queue($_[0]) }
sub default_printer_type($) { "LOCAL" }
sub printer_type($) {
for ($_[0]{mode}) {
- /cups/ && return @printer_type_inv{qw(LOCAL REMOTE SMB), $::expert ? qw(SOCKET URI) : ()};
- /lpr/ && return @printer_type_inv{qw(LOCAL REMOTE SMB NCP)};
+ /cups/ && return @printer_type_inv{qw(LOCAL REMOTE SMB), $::expert ? qw(URI) : ()};
+ /lpr/ && return @printer_type_inv{qw(LOCAL LPD SMB NCP)};
}
}
@@ -335,7 +337,7 @@ sub read_printers_conf {
sub get_direct_uri {
#- get the local printer to access via a Device URI.
my @direct_uri;
- local *F; open F, "chroot $prefix/ /usr/sbin/lpinfo -v |";
+ local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/sbin/lpinfo -v |";
foreach (<F>) {
/^(direct|usb|serial)\s+(\S*)/ and push @direct_uri, $2;
}
@@ -367,7 +369,7 @@ sub poll_ppd_base {
run_program::rooted($prefix, "/etc/rc.d/init.d/cups start");
foreach (1..10) {
- local *PPDS; open PPDS, "chroot $prefix/ /usr/bin/poll_ppd_base -a |";
+ local *PPDS; open PPDS, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/poll_ppd_base -a |";
foreach (<PPDS>) {
chomp;
my ($ppd, $mf, $descr, $lang) = split /\|/;
@@ -641,7 +643,7 @@ sub print_pages($@) {
run_program::rooted($prefix, $lpr, "-P$queue", $_);
}
sleep 5; #- allow lpr to send pages.
- local *F; open F, "chroot $prefix/ $lpq -P$queue |";
+ local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "$lpq -P$queue |";
my @lpq_output = grep { !/^no entries/ && !(/^Rank\s+Owner/ .. /^\s*$/) } <F>;
close F;
@lpq_output;
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index e99c69f1b..b53285957 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -373,16 +373,26 @@ You can add some more or change the existing ones."),
while ($continue) {
$printer::printer_type_inv{$printer->{TYPE}} or $printer->{TYPE} = printer::default_printer_type($printer);
$printer->{str_type} = $printer::printer_type_inv{$printer->{TYPE}};
- if ($::beginner) {
- $printer->{str_type} =
- $in->ask_from_list_(_("Select Printer Connection"),
- _("How is the printer connected?"),
- [ printer::printer_type($printer) ],
- $printer->{str_type},
- );
- } else {
- if ($printer->{mode} eq 'cups') {
- $in->ask_from_entries_refH([_("Select Printer Connection"), _("Ok"), $::beginner ? () : _("Remove queue")],
+ if ($printer->{mode} eq 'cups') {
+ $printer->{str_type} = $in->ask_from_list_(_("Select Printer Connection"),
+ _("How is the printer connected?"),
+ [ printer::printer_type($printer) ],
+ $printer->{str_type},
+ );
+ $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
+ if ($printer->{TYPE} eq 'REMOTE') {
+ $printer->{str_type} = $printer::printer_type_inv{CUPS};
+ $printer->{str_type} = $in->ask_from_list_(_("Select Remote Printer Connection"),
+_("With a remote CUPS server, you do not have to configure
+any printer here; printers will be automatically detected.
+In case of doubt, select \"Remote cups server\"."),
+ [ @printer::printer_type_inv{qw(CUPS LPD SOCKET)} ],
+ $printer->{str_type},
+ );
+ $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
+ }
+ $printer->{TYPE} eq 'CUPS' and return; #- exit printer configuration.
+ $in->ask_from_entries_refH([_("Select Printer Connection"), _("Ok"), $::beginner ? () : _("Remove queue")],
_("Every printer need a name (for example lp).
Other parameters such as the description of the printer or its location
can be defined. What name should be used for this printer and
@@ -390,9 +400,15 @@ how is the printer connected?"), [
_("Name of printer") => { val => \$printer->{QUEUE} },
_("Description") => { val => \$printer->{Info} },
_("Location") => { val => \$printer->{Location} },
-_("Printer Connection") => { val => \$printer->{str_type}, list => [ printer::printer_type($printer) ] },
],
- ) or printer::remove_queue($printer), $continue = 1, last;
+ ) or printer::remove_queue($printer), $continue = 1, last;
+ } else {
+ if ($::beginner) {
+ $printer->{str_type} = $in->ask_from_list_(_("Select Printer Connection"),
+ _("How is the printer connected?"),
+ [ printer::printer_type($printer) ],
+ $printer->{str_type},
+ );
} else {
$in->ask_from_entries_refH([_("Select Printer Connection"), _("Ok"), $::beginner ? () : _("Remove queue")],
_("Every print queue (which print jobs are directed to) needs a
@@ -402,21 +418,21 @@ _("Name of queue") => { val => \$printer->{QUEUE} },
_("Spool directory") => { val => \$printer->{SPOOLDIR} },
_("Printer Connection") => { val => \$printer->{str_type}, list => [ printer::printer_type($printer) ] },
],
- changed => sub {
- $printer->{SPOOLDIR} = printer::default_spooldir($printer) unless $_[0];
- }
- ) or printer::remove_queue($printer), $continue = 1, last;
+ changed => sub {
+ $printer->{SPOOLDIR} = printer::default_spooldir($printer) unless $_[0];
+ }
+ ) or printer::remove_queue($printer), $continue = 1, last;
}
+ $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
}
- $printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
$continue = 0;
for ($printer->{TYPE}) {
/LOCAL/ and setup_local ($printer, $in, $install) and last;
- /REMOTE/ and setup_remote ($printer, $in, $install) and last;
+ /LPD/ and setup_remote ($printer, $in, $install) and last;
+ /SOCKET/ and setup_socket ($printer, $in, $install) and last;
/SMB/ and setup_smb ($printer, $in, $install) and last;
/NCP/ and setup_ncp ($printer, $in, $install) and last;
- /SOCKET/ and setup_socket ($printer, $in, $install) and last;
/URI/ and setup_uri ($printer, $in, $install) and last;
$continue = 1; last;
}