diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-08 17:14:43 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-08 17:14:43 +0000 |
commit | 366f9dc700925177976108ca8730cb433312d34d (patch) | |
tree | c6e0a6926dc43aaf5993214a976550cecbd923d2 | |
parent | ad33ed3c54d386eb5360195f88a9bf33359979d4 (diff) | |
download | drakx-366f9dc700925177976108ca8730cb433312d34d.tar drakx-366f9dc700925177976108ca8730cb433312d34d.tar.gz drakx-366f9dc700925177976108ca8730cb433312d34d.tar.bz2 drakx-366f9dc700925177976108ca8730cb433312d34d.tar.xz drakx-366f9dc700925177976108ca8730cb433312d34d.zip |
change to do_pkgs
-rw-r--r-- | perl-install/install_steps_interactive.pm | 3 | ||||
-rw-r--r-- | perl-install/printer.pm | 5 | ||||
-rw-r--r-- | perl-install/printerdrake.pm | 78 | ||||
-rwxr-xr-x | perl-install/standalone/printerdrake | 2 |
4 files changed, 41 insertions, 47 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 4bd4210ad..f9e0ffd6d 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -930,8 +930,7 @@ sub configurePrinter { } $printer->{PAPERSIZE} = $o->{lang} eq 'en' ? 'letter' : 'a4'; - printerdrake::main($printer, $o, $ask_multiple_printer, - sub { $o->pkg_install(@_) }, sub { install_interactive::upNetwork($o, 'pppAvoided') }); + printerdrake::main($printer, $o, $ask_multiple_printer, sub { install_interactive::upNetwork($o, 'pppAvoided') }); if (!is_empty_hash_ref($printer->{configured}) || pkgs::packageFlagInstalled(pkgs::packageByName($o->{packages}, 'cups'))) { $o->pkg_install_if_requires_satisfied('Mesa-common', 'xpp', 'libqtcups2', 'qtcups', 'kups') diff --git a/perl-install/printer.pm b/perl-install/printer.pm index 1e4b11d0c..91e11bdf3 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -100,11 +100,6 @@ sub stop_service ($) { || die "Could not stop $service!"; } -sub remove_package ($) { - my ($package) = @_; - run_program::rooted($prefix, "rpm -e --nodeps $package") || do {}; -} - sub installed ($) { my ($package) = @_; open RPMCHECK, "rpm -qa --root $prefix/ | grep $package |" || diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index 9204cc2c4..ea763dc7c 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -32,7 +32,7 @@ sub auto_detect { sub setup_local($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; my $queue = $printer->{OLD_QUEUE}; my @port = (); @@ -90,7 +90,7 @@ complete => sub { } sub setup_lpd($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; my $uri; my $remotehost; @@ -131,13 +131,13 @@ complete => sub { #- 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');} + if ($printer->{SPOOLER} eq 'lpd') {$in->do_pkgs->install('rlpr');} 1; } sub setup_smb($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; my $uri; my $smbuser = ""; @@ -220,13 +220,13 @@ complete => sub { ($smbpassword && ":$smbpassword") . "@")), ($workgroup && ("$workgroup/")), ($smbserver || $smbserverip), "/$smbshare"); - &$install('samba-client'); + $in->do_pkgs->install('samba-client'); $printer->{SPOOLER} eq 'cups' and printer::restart_queue($printer); 1; } sub setup_ncp($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; my $uri; my $ncpuser = ""; @@ -290,12 +290,12 @@ complete => sub { ($ncppassword && ":$ncppassword") . "@")), "$ncpserver/$ncpqueue"); - &$install('ncpfs'); + $in->do_pkgs->install('ncpfs'); 1; } sub setup_socket($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; my ($hostname, $port); my $uri; @@ -337,13 +337,13 @@ complete => sub { #- LPD and LPRng need netcat ('nc') to access to socket printers if (($printer->{SPOOLER} eq 'lpd') || - ($printer->{SPOOLER} eq 'lprng')) {&$install('nc');} + ($printer->{SPOOLER} eq 'lprng')) {$in->do_pkgs->install('nc');} 1; } sub setup_uri($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; return if !$in->ask_from_entries_refH(_("Printer Device URI"), __("You can specify directly the URI to access the printer. The URI must fulfill either the CUPS or the Foomatic specifications. Not that not all URI types are supported by all the spoolers."), [ @@ -368,18 +368,18 @@ complete => sub { } ); if ($printer->{currentqueue}{'connect'} =~ /^smb:/) { - &$install('samba-client'); + $in->do_pkgs->install('samba-client'); printer::restart_queue($printer); } if ($printer->{currentqueue}{'connect'} =~ /^ncp:/) { - &$install('ncpfs'); + $in->do_pkgs->install('ncpfs'); printer::restart_queue($printer); } 1; } sub setup_postpipe($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; my $uri; my $commandline; @@ -413,7 +413,7 @@ complete => sub { } sub setup_gsdriver($$$;$) { - my ($printer, $in, $install, $upNetwork) = @_; + my ($printer, $in, $upNetwork) = @_; #- Read the printer driver database if necessary if ((keys %printer::thedb) == 0) { printer::read_printer_db($printer->{SPOOLER}); @@ -683,7 +683,7 @@ Does it work properly?"), 1) and last; } sub setup_default_spooler ($$$) { - my ($printer, $in, $install) = @_; + my ($printer, $in) = @_; $printer->{SPOOLER} ||= 'cups'; my $str_spooler = $in->ask_from_list_(__("Select Printer Spooler"), @@ -693,7 +693,7 @@ sub setup_default_spooler ($$$) { ) or return; $printer->{SPOOLER} = $printer::spooler{$str_spooler}; # Install the spooler if not done yet - install_spooler($printer, $install); + install_spooler($printer); # Get the queues of this spooler printer::read_configured_queues($printer); return $printer->{SPOOLER}; @@ -705,44 +705,44 @@ sub install_spooler ($$) { # Turn off /etc/printcap writing in CUPS when LPD or # LPRng is used (perhaps better to be done in CUPS/LPD/LPRng # start-up scripts?) - my ($printer, $install) = @_; + my ($printer) = @_; if (!$::testing) { if ($printer->{SPOOLER} eq "cups") { - &$install(('cups', 'xpp', 'qtcups', 'kups', + $in->do_pkgs->install(('cups', 'xpp', 'qtcups', 'kups', ($::expert ? 'cups-drivers' : ()))); - if ($::expert) {&$install('cups-drivers');} + if ($::expert) {$in->do_pkgs->install('cups-drivers');} # Start daemon printer::start_service("cups"); sleep 1; } elsif ($printer->{SPOOLER} eq "lpd") { # "lpr" conflicts with "LPRng", remove "LPRng" - printer::remove_package("LPRng"); - &$install('lpr'); + $in->do_pkgs->remove('LPRng'); + $in->do_pkgs->install('lpr'); # Start daemon printer::start_service("lpd"); sleep 1; } elsif ($printer->{SPOOLER} eq "lprng") { # "LPRng" conflicts with "lpr", remove "lpr" - printer::remove_package("lpr"); - &$install('LPRng'); + $in->do_pkgs->remove('lpr'); + $in->do_pkgs->install('LPRng'); # Start daemon printer::start_service("lpd"); sleep 1; } elsif ($printer->{SPOOLER} eq "pdq") { - &$install('pdq'); + $in->do_pkgs->install('pdq'); # PDQ has no daemon } } } #- Program entry point for configuration with lpr or cups (stored in $mode). -sub main($$$$;$) { - my ($printer, $in, $ask_multiple_printer, $install, $upNetwork) = @_; +sub main { + my ($printer, $in, $ask_multiple_printer, $upNetwork) = @_; # printerdrake does not work without foomatic, and for more convenience # we install some more stuff if (!$::testing) { - &$install(('foomatic', 'printer-utils', 'printer-testpages', + $in->do_pkgs->install(('foomatic', 'printer-utils', 'printer-testpages', (printer::installed("gimp") ? 'gimpprint' : ()))); } @@ -751,7 +751,7 @@ sub main($$$$;$) { # If we have chosen a spooler, install it. if (($printer->{SPOOLER}) && ($printer->{SPOOLER} ne '')) { - install_spooler($printer, $install); + install_spooler($printer); } my ($queue, $continue) = ('', 1); @@ -763,13 +763,13 @@ sub main($$$$;$) { 0) ? 'lp' : __("Done"); if ($queue ne __("Done")) { $printer->{SPOOLER} ||= - setup_default_spooler ($printer, $in, $install) || + setup_default_spooler ($printer, $in) || return; } } else { # Ask for a spooler when none is defined $printer->{SPOOLER} ||= - setup_default_spooler ($printer, $in, $install) || + setup_default_spooler ($printer, $in) || return; # Show a queue list window when there is at least one queue # or when we are in expert mode @@ -803,7 +803,7 @@ sub main($$$$;$) { } if ($queue =~ /^Spooler: /) { $printer->{SPOOLER} = - setup_default_spooler ($printer, $in, $install) || + setup_default_spooler ($printer, $in) || $printer->{SPOOLER}; next; } @@ -948,18 +948,18 @@ to be filled in. They are comments for the users.") }, $printer->{QUEUE} = $printer->{currentqueue}{'queue'}; $continue = 0; for ($printer->{TYPE}) { - /LOCAL/ and setup_local ($printer, $in, $install) and last; - /LPD/ and setup_lpd ($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; - /URI/ and setup_uri ($printer, $in, $install) and last; - /POSTPIPE/ and setup_postpipe ($printer, $in, $install) and last; + /LOCAL/ and setup_local ($printer, $in) and last; + /LPD/ and setup_lpd ($printer, $in) and last; + /SOCKET/ and setup_socket ($printer, $in) and last; + /SMB/ and setup_smb ($printer, $in) and last; + /NCP/ and setup_ncp ($printer, $in) and last; + /URI/ and setup_uri ($printer, $in) and last; + /POSTPIPE/ and setup_postpipe ($printer, $in) and last; $continue = 1; last; } } #- configure the printer driver - if (!$continue && setup_gsdriver($printer, $in, $install, $printer->{TYPE} !~ /LOCAL/ && $upNetwork)) { + if (!$continue && setup_gsdriver($printer, $in, $printer->{TYPE} !~ /LOCAL/ && $upNetwork)) { if (lc($printer->{QUEUE}) ne lc($printer->{OLD_QUEUE})) { printer::remove_queue($printer, $printer->{OLD_QUEUE}); } diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index 5f9277f12..de72bc178 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -59,7 +59,7 @@ my $in = vnew interactive('printer', 'su'); begin: $::isEmbedded and kill USR2, $::CCPID; -printerdrake::main($printer, $in, 1, sub { $in->standalone::pkgs_install(@_) }); +printerdrake::main($printer, $in, 1); $::isEmbedded ? kill(USR1, $::CCPID) : $in->exit(0); goto begin; |