summaryrefslogtreecommitdiffstats
path: root/perl-install/printer
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
commitc2f200920f04dba0874c054038770a91a71fbba5 (patch)
tree7448485cea94afcd511535b592b1f061c543f3b9 /perl-install/printer
parent0a813b0ea3c7c30ca81e79b6303f5141e95fee4b (diff)
downloaddrakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar.gz
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar.bz2
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar.xz
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.zip
use "if any" instead of "if grep", and various other occurences of "any", "every", "partition"
Diffstat (limited to 'perl-install/printer')
-rw-r--r--perl-install/printer/main.pm4
-rw-r--r--perl-install/printer/printerdrake.pm4
2 files changed, 3 insertions, 5 deletions
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index fe7c03cfa..cbc73d529 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -611,7 +611,7 @@ sub set_cups_special_options {
# If nothing is already configured, set text file borders of half an inch
# and decrease the font size a little bit, so nothing of the text gets
# cut off by unprintable borders.
- if (!grep { /$queue.*\s(page-(top|bottom|left|right)|lpi|cpi)=/ } @lpoptions) {
+ if (!any { /$queue.*\s(page-(top|bottom|left|right)|lpi|cpi)=/ } @lpoptions) {
run_program::rooted($::prefix, "lpoptions",
"-p", $queue,
"-o", "page-top=36", "-o", "page-bottom=36",
@@ -619,7 +619,7 @@ sub set_cups_special_options {
"-o", "cpi=12", "-o", "lpi=7", "-o", "wrap");
}
# Let images fill the whole page by default
- if (!grep { /$queue.*\s(scaling|natural-scaling|ppi)=/ } @lpoptions) {
+ if (!any { /$queue.*\s(scaling|natural-scaling|ppi)=/ } @lpoptions) {
run_program::rooted($::prefix, "lpoptions",
"-p", $queue,
"-o", "scaling=100");
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 55e44ffed..f15b9d03e 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -2882,9 +2882,7 @@ sub main {
$cursorpos =
$printer->{configured}{$printer->{DEFAULT}}{queuedata}{menuentry} . N(" (Default)");
} elsif ($printer->{SPOOLER} eq "cups") {
- ($cursorpos) =
- grep { /!$printer->{DEFAULT}:[^!]*$/ }
- printer::cups::get_formatted_remote_queues($printer);
+ $cursorpos = find { /!$printer->{DEFAULT}:[^!]*$/ } printer::cups::get_formatted_remote_queues($printer);
}
}
# Generate the list of available printers