diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-12 12:05:40 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-12 12:05:40 +0000 |
commit | 046406ab6b13659f4be843d3d2d5639efaf425fe (patch) | |
tree | 2304d9911b495ea5262815f2b3cca305f53d83f4 /perl-install/printer/cups.pm | |
parent | 57582cf77904240eee6c29874866b9d62e4a9951 (diff) | |
download | drakx-backup-do-not-use-046406ab6b13659f4be843d3d2d5639efaf425fe.tar drakx-backup-do-not-use-046406ab6b13659f4be843d3d2d5639efaf425fe.tar.gz drakx-backup-do-not-use-046406ab6b13659f4be843d3d2d5639efaf425fe.tar.bz2 drakx-backup-do-not-use-046406ab6b13659f4be843d3d2d5639efaf425fe.tar.xz drakx-backup-do-not-use-046406ab6b13659f4be843d3d2d5639efaf425fe.zip |
printer related modules cleaning :
- create the printer/ hierarchy
- split services related stuff into services.pm & printer::services,
- move things that've nothing to do with printers into common.pm
(alternatives, permissions, ...)
- move eveything related to cups, gimp-print, detection,
{star,open}office to the corresponding splited printer:: module
- big consolidation of printer::office (it was obvious there were tons
of duplication between staroffice and openoffice managment)
- move other stuff into printer::main, printer::common,
status : print.pm has been heavily splited (now one can begin to
understand the little bits).
printerdrake still needs to be splited/cleaned and eventually removed
since printer/printerdrake modules separation is not understandable by
other people
till, in printer::gimp, $lprcommand is neither declared nor setted
nowhere. idem in mdk9.0 ...
Diffstat (limited to 'perl-install/printer/cups.pm')
-rw-r--r-- | perl-install/printer/cups.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/perl-install/printer/cups.pm b/perl-install/printer/cups.pm new file mode 100644 index 000000000..1de54edf2 --- /dev/null +++ b/perl-install/printer/cups.pm @@ -0,0 +1,30 @@ +package printer::cups; + +use strict; +use printer::data; + +sub get_remote_queues { + my ($printer) = $_[0]; + # The following code reads in a list of all remote printers which the + # local CUPS daemon knows due to broadcasting of remote servers or + # "BrowsePoll" entries in the local /etc/cups/cupsd.conf + local *F; + open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . + "lpstat -v |" or return (); + my @printerlist; + my $line; + while ($line = <F>) { + if ($line =~ m/^\s*device\s+for\s+([^:\s]+):\s*(\S+)\s*$/) { + my $queuename = $1; + if (($2 =~ m!^ipp://([^/:]+)[:/]!) && + (!$printer->{configured}{$queuename})) { + my $server = $1; + push (@printerlist, "$queuename|$server"); + } + } + } + close F; + return @printerlist; +} + +1; |