summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/cups.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/printer/cups.pm')
-rw-r--r--perl-install/printer/cups.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/perl-install/printer/cups.pm b/perl-install/printer/cups.pm
index 468625d65..ab9e28b21 100644
--- a/perl-install/printer/cups.pm
+++ b/perl-install/printer/cups.pm
@@ -77,6 +77,22 @@ sub lpstat_v() {
} run_program::rooted_get_stdout($::prefix, 'lpstat', '-v');
}
+sub lpinfo_v() {
+ map {
+ if (my ($type, $uri) = m/^\s*(\S+)\s+(\S+)\b/) {
+ if ($uri =~ m!:/!) {
+ $uri;
+ } elsif ($type =~ m/network/i) {
+ "$uri://";
+ } else {
+ "$uri:/";
+ }
+ } else {
+ ();
+ }
+ } run_program::rooted_get_stdout($::prefix, 'lpinfo', '-v');
+}
+
sub read_printer_list {
my ($printer) = @_;
# This function reads in a list of all printers which the local CUPS