summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2002-09-13 21:21:23 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2002-09-13 21:21:23 +0000
commit5048eb000b43e5d0692e5fbc3112600ff3011bfa (patch)
treed905595de1628ec24c70c69af8f42f4ea59db1f1 /perl-install/printer.pm
parent964066f83f8bc531d5af0e546dca71af41c87003 (diff)
downloaddrakx-5048eb000b43e5d0692e5fbc3112600ff3011bfa.tar
drakx-5048eb000b43e5d0692e5fbc3112600ff3011bfa.tar.gz
drakx-5048eb000b43e5d0692e5fbc3112600ff3011bfa.tar.bz2
drakx-5048eb000b43e5d0692e5fbc3112600ff3011bfa.tar.xz
drakx-5048eb000b43e5d0692e5fbc3112600ff3011bfa.zip
Do not insist on "curl" to download PPDs from a CUPS server (for Star Office/OpenOffice.org/GIMP), take the one from "curl" and "wget" which is there. Install "webfetch" when none is there.
Let "cups-drivers" be installed when switching from normal to expert mode.
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm83
1 files changed, 60 insertions, 23 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index ccb42a65e..80a1073c8 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -2286,15 +2286,23 @@ sub configurestaroffice {
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
if (0 && ($printer->{SPOOLER} eq "cups") &&
- (-x "$prefix/usr/bin/curl")) {
+ ((-x "$prefix/usr/bin/curl") || (-x "$prefix/usr/bin/wget"))) {
my @printerlist = getcupsremotequeues();
for my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
my $queue = $1;
my $server = $2;
- eval(run_program::rooted
- ($prefix, "curl", "-o", "/etc/foomatic/$queue.ppd",
- "http://$server:631/printers/$queue.ppd"));
+ if (-x "$prefix/usr/bin/wget") {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/wget", "-O",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$queue.ppd"));
+ } else {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/curl", "-o",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$queue.ppd"));
+ }
if (-r "$prefix/etc/foomatic/$queue.ppd") {
$configfilecontent =
makestarofficeprinterentry($printer, $queue,
@@ -2351,15 +2359,23 @@ sub configureopenoffice {
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
if (0 && ($printer->{SPOOLER} eq "cups") &&
- (-x "$prefix/usr/bin/curl")) {
+ ((-x "$prefix/usr/bin/curl") || (-x "$prefix/usr/bin/wget"))) {
my @printerlist = getcupsremotequeues();
for my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
my $queue = $1;
my $server = $2;
- eval(run_program::rooted
- ($prefix, "curl", "-o", "/etc/foomatic/$queue.ppd",
- "http://$server:631/printers/$queue.ppd"));
+ if (-x "$prefix/usr/bin/wget") {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/wget", "-O",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$queue.ppd"));
+ } else {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/curl", "-o",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$queue.ppd"));
+ }
if (-r "$prefix/etc/foomatic/$queue.ppd") {
$configfilecontent =
makeopenofficeprinterentry($printer, $queue,
@@ -2416,7 +2432,7 @@ sub addcupsremotetostaroffice {
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
if (($printer->{SPOOLER} eq "cups") &&
- (-x "$prefix/usr/bin/curl")) {
+ ((-x "$prefix/usr/bin/curl") || (-x "$prefix/usr/bin/wget"))) {
my @printerlist = getcupsremotequeues();
for my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
@@ -2425,10 +2441,17 @@ sub addcupsremotetostaroffice {
my $server = $2;
# Remove server name from queue name
$q =~ s/^([^@]*)@.*$/$1/;
- eval(run_program::rooted
- ($prefix, "/usr/bin/curl", "-o",
- "/etc/foomatic/$queue.ppd",
- "http://$server:631/printers/$q.ppd"));
+ if (-x "$prefix/usr/bin/wget") {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/wget", "-O",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$q.ppd"));
+ } else {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/curl", "-o",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$q.ppd"));
+ }
# Does the file exist and is it not an error message?
if ((-r "$prefix/etc/foomatic/$queue.ppd") &&
(cat_("$prefix/etc/foomatic/$queue.ppd") =~
@@ -2459,7 +2482,7 @@ sub addcupsremotetoopenoffice {
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
if (($printer->{SPOOLER} eq "cups") &&
- (-x "$prefix/usr/bin/curl")) {
+ ((-x "$prefix/usr/bin/curl") || (-x "$prefix/usr/bin/wget"))) {
my @printerlist = getcupsremotequeues();
for my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
@@ -2468,10 +2491,17 @@ sub addcupsremotetoopenoffice {
my $server = $2;
# Remove server name from queue name
$q =~ s/^([^@]*)@.*$/$1/;
- eval(run_program::rooted
- ($prefix, "/usr/bin/curl", "-o",
- "/etc/foomatic/$queue.ppd",
- "http://$server:631/printers/$q.ppd"));
+ if (-x "$prefix/usr/bin/wget") {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/wget", "-O",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$q.ppd"));
+ } else {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/curl", "-o",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$q.ppd"));
+ }
# Does the file exist and is it not an error message?
if ((-r "$prefix/etc/foomatic/$queue.ppd") &&
(cat_("$prefix/etc/foomatic/$queue.ppd") =~
@@ -2965,7 +2995,7 @@ sub addcupsremotetogimp {
my @printerlist = getcupsremotequeues();
my $ppdfile = "";
if (($printer->{SPOOLER} eq "cups") &&
- (-x "$prefix/usr/bin/curl")) {
+ ((-x "$prefix/usr/bin/curl") || (-x "$prefix/usr/bin/wget"))) {
for my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
my $q = $1;
@@ -2973,10 +3003,17 @@ sub addcupsremotetogimp {
my $server = $2;
# Remove server name from queue name
$q =~ s/^([^@]*)@.*$/$1/;
- eval(run_program::rooted
- ($prefix, "/usr/bin/curl", "-o",
- "/etc/foomatic/$queue.ppd",
- "http://$server:631/printers/$q.ppd"));
+ if (-x "$prefix/usr/bin/wget") {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/wget", "-O",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$q.ppd"));
+ } else {
+ eval(run_program::rooted
+ ($prefix, "/usr/bin/curl", "-o",
+ "/etc/foomatic/$queue.ppd",
+ "http://$server:631/printers/$q.ppd"));
+ }
# Does the file exist and is it not an error message?
if ((-r "$prefix/etc/foomatic/$queue.ppd") &&
(cat_("$prefix/etc/foomatic/$queue.ppd") =~