summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/cups.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2004-03-05 03:11:09 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2004-03-05 03:11:09 +0000
commit91fa5771511a58bc1dbc33f3a5d65174ec76470c (patch)
tree374395d49b03c8207dcde9aef975903179322968 /perl-install/printer/cups.pm
parent166751791f0845b41a7a27d3bf20d0222f820369 (diff)
downloaddrakx-91fa5771511a58bc1dbc33f3a5d65174ec76470c.tar
drakx-91fa5771511a58bc1dbc33f3a5d65174ec76470c.tar.gz
drakx-91fa5771511a58bc1dbc33f3a5d65174ec76470c.tar.bz2
drakx-91fa5771511a58bc1dbc33f3a5d65174ec76470c.tar.xz
drakx-91fa5771511a58bc1dbc33f3a5d65174ec76470c.zip
Let URIs listed by "lpinfo -v" be shown in the dialog for entering a URI manually.
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