summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2005-03-17 18:29:04 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2005-03-17 18:29:04 +0000
commitf5a429dfab1af81bd8d6989825383cb8d94d7fc9 (patch)
treebc34847334832d934cfba18a0f7a9a5040038f4c
parentcb82cae6ae6aab39d025937d6fd02b3bddd5f185 (diff)
downloaddrakx-f5a429dfab1af81bd8d6989825383cb8d94d7fc9.tar
drakx-f5a429dfab1af81bd8d6989825383cb8d94d7fc9.tar.gz
drakx-f5a429dfab1af81bd8d6989825383cb8d94d7fc9.tar.bz2
drakx-f5a429dfab1af81bd8d6989825383cb8d94d7fc9.tar.xz
drakx-f5a429dfab1af81bd8d6989825383cb8d94d7fc9.zip
- Fixed queue name auto-generation, it sometimes hanged in an endless loop
(bugs #14426, #14525, #14563).
-rw-r--r--perl-install/printer/printerdrake.pm19
1 files changed, 10 insertions, 9 deletions
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 8389262aa..700ea6ce2 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -963,7 +963,8 @@ sub generate_queuename {
# characters.
last if ((length($queue) <= $ml) ||
($_ !~ /[a-zA-Z]{2,}$/) ||
- (length($parts{'make'}) <= 3));
+ (($part eq 'make') &&
+ (length($parts{'make'}) <= 3)));
}
$parts{$part} = join('', @words);
$queue = "$parts{'make'} $parts{'model'}";
@@ -976,7 +977,7 @@ sub generate_queuename {
(length($parts{'model'}) > 3)) {
# Queue name too long? Remove last words from model name.
$parts{'model'} =~
- s/(?<=[a-zA-Z0-9])[^a-zA-Z0-9]+[a-zA-Z0-9]*$//;
+ s/[^a-zA-Z0-9]+[a-zA-Z0-9]*$// || last;
$queue = "$parts{'make'} $parts{'model'}";
$queue =~ s/\s+//g;
}
@@ -3207,13 +3208,13 @@ sub get_printer_info {
# Set device permissions
if ($printer->{currentqueue}{connect} =~
/^\s*(file|parallel|usb):(\S*)\s*$/) {
- if ($printer->{SPOOLER} eq 'cups') {
- set_permissions($2, '660', 'lp', 'sys');
- } elsif ($printer->{SPOOLER} eq 'pdq') {
- set_permissions($2, '666');
- } else {
- set_permissions($2, '660', 'lp', 'lp');
- }
+ if ($printer->{SPOOLER} eq 'cups') {
+ set_permissions($2, '660', 'lp', 'sys');
+ } elsif ($printer->{SPOOLER} eq 'pdq') {
+ set_permissions($2, '666');
+ } else {
+ set_permissions($2, '660', 'lp', 'lp');
+ }
}
# This is needed to have the device not blocked by the
# spooler backend.