diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2001-08-07 22:56:55 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2001-08-07 22:56:55 +0000 |
commit | 8a41cf834dda0b87aa1b155c1c6919b7eff8449a (patch) | |
tree | e06fae38864204ff540b6e13328fdd6fff38f998 | |
parent | 9c0685c5dc4a29e204bffe91cb875b91f60170fa (diff) | |
download | drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar.gz drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar.bz2 drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar.xz drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.zip |
Automatic installation of all needed packages
-rw-r--r-- | perl-install/printer.pm | 15 | ||||
-rw-r--r-- | perl-install/printerdrake.pm | 36 |
2 files changed, 41 insertions, 10 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm index bf98ddc3d..dda9dccea 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -105,6 +105,21 @@ sub remove_package ($) { run_program::rooted($prefix, "rpm -e --nodeps $package") || do {}; } +sub installed ($) { + my ($package) = @_; + open RPMCHECK, "rpm -qa | grep $package |" || + die "Could not run rpm!"; + my $found = 0; + while (<RPMCHECK>) { + if ($_ =~ m/^$package\-.+\-.+mdk/) { + $found = 1; + last; + } + } + close RPMCHECK; + return $found; +} + sub copy_printer_params($$) { my ($from, $to) = @_; map { $to->{$_} = $from->{$_} } grep { $_ ne 'configured' } keys %$from; diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index 8ee8c1c85..dc52e51c2 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -128,6 +128,11 @@ complete => sub { #- make the DeviceURI from user input. $printer->{currentqueue}{'connect'} = "lpd://$remotehost/$remotequeue"; + + #- LPD does not support filtered queues to a remote LPD server by itself + #- It needs an additional program as "rlpr" + if ($printer->{SPOOLER} eq 'lpd') {&$install('rlpr');} + } sub setup_smb($$$) { @@ -329,6 +334,11 @@ complete => sub { $printer->{currentqueue}{'connect'} = join '', ("socket://$remotehost", $remoteport ? (":$remoteport") : ()); 1; + + #- LPD and LPRng need netcat ('nc') to access to socket printers + if (($printer->{SPOOLER} eq 'lpd') || + ($printer->{SPOOLER} eq 'lprng')) {&$install('nc');} + } sub setup_uri($$$) { @@ -407,7 +417,7 @@ sub setup_gsdriver($$$;$) { if ((keys %printer::thedb) == 0) { printer::read_printer_db($printer->{SPOOLER}); } - my $testpage = "/usr/share/cups/data/testprint.ps"; + my $testpage = "/usr/share/printer-testpages/testprint.ps"; my $queue = $printer->{OLD_QUEUE}; $in->set_help('configurePrinterType') if $::isInstall; while (1) { @@ -571,14 +581,14 @@ sub setup_gsdriver($$$;$) { # Show the options dialog. The call-back function does a # range check of the numerical options. my $windowtitle; -# if ($::expert) { + if ($::expert) { $windowtitle = $printer->{DBENTRY}; $windowtitle =~ s/\|/ /; $windowtitle =~ s/\|/, /; -# } else { -# $windowtitle = "$printer->{currentqueue}{'make'} " . -# "$printer->{currentqueue}{'model'}" -# } + } else { + $windowtitle = "$printer->{currentqueue}{'make'} " . + "$printer->{currentqueue}{'model'}" + } return if !$in->ask_from_entries_refH ($windowtitle, _("Printer options"), \@widgets, @@ -740,10 +750,12 @@ sub install_spooler ($$) { my ($printer, $install) = @_; if (!$::testing) { if ($printer->{SPOOLER} eq "cups") { - &$install('cups'); + &$install(('cups', 'xpp', 'qtcups', 'kups', + ($::expert ? 'cups-drivers' : ()))); + if ($::expert) {&$install('cups-drivers');} # Restart daemon printer::start_service("cups"); - sleep 5; + sleep 1; } elsif ($printer->{SPOOLER} eq "lpd") { # "lpr" conflicts with "LPRng", remove "LPRng" printer::remove_package("LPRng"); @@ -769,8 +781,12 @@ sub install_spooler ($$) { sub main($$$$;$) { my ($printer, $in, $ask_multiple_printer, $install, $upNetwork) = @_; - # printerdrake does not work without foomatic - &$install('foomatic') unless $::testing; + # printerdrake does not work without foomatic, and for more convenience + # we install some more stuff + if (!$::testing) { + &$install(('foomatic', 'printer-utils', 'printer-testpages', + (printer::installed("gimp") ? 'gimpprint' : ()))); + } !$::expert && ($printer->{SPOOLER} ||= 'cups'); # only experts should be asked # for the spooler |