summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-09-05 17:27:21 +0000
committerFrancois Pons <fpons@mandriva.com>2000-09-05 17:27:21 +0000
commitd64b6f87d1421b55779b24944c40b7e5df519b73 (patch)
tree89579a3bf81af8b56e700346936b9ef19d17a6e3 /perl-install/printer.pm
parenta1c87ddf72bd3657d680940da5786e3a6cc84b08 (diff)
downloaddrakx-backup-do-not-use-d64b6f87d1421b55779b24944c40b7e5df519b73.tar
drakx-backup-do-not-use-d64b6f87d1421b55779b24944c40b7e5df519b73.tar.gz
drakx-backup-do-not-use-d64b6f87d1421b55779b24944c40b7e5df519b73.tar.bz2
drakx-backup-do-not-use-d64b6f87d1421b55779b24944c40b7e5df519b73.tar.xz
drakx-backup-do-not-use-d64b6f87d1421b55779b24944c40b7e5df519b73.zip
*** empty log message ***
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 4338afed8..6bb78c031 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -17,11 +17,11 @@ my $PRINTER_FILTER_DIR = "/usr/lib/rhs/rhs-printfilters";
%printer_type = (
__("Local printer") => "LOCAL",
- __("Remote lpd") => "REMOTE",
+ __("Network priner (lpd)") => "REMOTE",
__("SMB/Windows 95/98/NT") => "SMB",
__("NetWare") => "NCP",
- __("URI for Local printer") => "URI_LOCAL",
- __("URI for Network printer") => "URI_NET",
+ __("Socket") => "SOCKET",
+ __("Printer Device URI") => "URI",
);
%printer_type_inv = reverse %printer_type;
@@ -41,10 +41,10 @@ sub set_prefix($) { $prefix = $_[0]; }
sub default_queue($) { (split '\|', $_[0]{QUEUE})[0] }
sub default_spooldir($) { "/var/spool/lpd/" . default_queue($_[0]) }
-sub default_printer_type($) { ($_[0]{mode} eq /cups/ && "URI_") . "LOCAL" }
+sub default_printer_type($) { "LOCAL" }
sub printer_type($) {
for ($_[0]{mode}) {
- /cups/ && return @printer_type_inv{qw(URI_LOCAL URI_NET REMOTE SMB)};
+ /cups/ && return @printer_type_inv{qw(LOCAL REMOTE SMB SOCKET), $::expert ? qw(URI) : ()};
/lpr/ && return @printer_type_inv{qw(LOCAL REMOTE SMB NCP)};
}
}
@@ -363,6 +363,7 @@ sub poll_ppd_base {
#- the file /etc/cups/ppds.dat is no more modified.
#- if cups continue to modify it (because it reads the ppd files available), the
#- poll_ppd_base program simply cores :-)
+ run_program::rooted($prefix, "ifup lo"); #- else cups will not be happy!
run_program::rooted($prefix, "/etc/rc.d/init.d/cups start");
foreach (1..10) {
@@ -376,6 +377,10 @@ sub poll_ppd_base {
scalar(keys %descr_to_ppd) > 5 and last;
sleep 1; #- we have to try again running the program, wait here a little before.
}
+ #- just in case, poll_ppd_base may produce core if not connected immediately.
+ unlink "$prefix/core";
+
+ scalar(keys %descr_to_ppd) > 5 or die "unable to connect to cups server";
}
#-******************************************************************************