summaryrefslogtreecommitdiffstats
path: root/perl-install/printer
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-01-07 12:17:33 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-01-07 12:17:33 +0000
commit0d57018d039ab38a6d992bfa7dab7ff64b51cd44 (patch)
tree9aa2cbc3482b3c02c3248456de4abfbf1d94f988 /perl-install/printer
parent7a5e867a269fb9b30f3ea5d348d33c4cbfac043e (diff)
downloaddrakx-0d57018d039ab38a6d992bfa7dab7ff64b51cd44.tar
drakx-0d57018d039ab38a6d992bfa7dab7ff64b51cd44.tar.gz
drakx-0d57018d039ab38a6d992bfa7dab7ff64b51cd44.tar.bz2
drakx-0d57018d039ab38a6d992bfa7dab7ff64b51cd44.tar.xz
drakx-0d57018d039ab38a6d992bfa7dab7ff64b51cd44.zip
fixes
Diffstat (limited to 'perl-install/printer')
-rw-r--r--perl-install/printer/gimp.pm18
1 files changed, 12 insertions, 6 deletions
diff --git a/perl-install/printer/gimp.pm b/perl-install/printer/gimp.pm
index 95116cf53..a6bf28bbf 100644
--- a/perl-install/printer/gimp.pm
+++ b/perl-install/printer/gimp.pm
@@ -265,6 +265,7 @@ sub addentry {
$sectionfound = 1 if /^\s*Printer\s*:\s*($section)\s*$/;
} else {
if (!/^\s*$/ && !/^\s*;/) {
+ $_ = "$entry\n$_";
$entryinserted = 1;
last;
}
@@ -289,15 +290,17 @@ sub removeentry {
my $sectionfound;
my @lines = split("\n", $filecontent);
foreach (@lines) {
- $_ = "$_\n";
if (!$sectionfound) {
$sectionfound = /^\s*Printer\s*:\s*($section)\s*$/;
} else {
last if /^\s*Printer\s*:\s*.*\s*$/; # Next section
- last if /^\s*$entry/;
+ if (/^\s*$entry/) {
+ $_ = "";
+ last;
+ }
}
}
- return join "", @lines;
+ return join "\n", @lines;
}
sub removeprinter {
@@ -305,14 +308,17 @@ sub removeprinter {
my $sectionfound;
my @lines = split("\n", $filecontent);
foreach (@lines) {
- $_ = "$_\n";
if (!$sectionfound) {
- $sectionfound = /^\s*Printer\s*:\s*($section)\s*$/;
+ if (/^\s*Printer\s*:\s*($section)\s*$/) {
+ $_ = "";
+ $sectionfound = 1;
+ }
} else {
last if /^\s*Printer\s*:\s*.*\s*$/; # Next section
+ $_ = "";
}
}
- return join "", @lines;
+ return join "\n", @lines;
}
sub isprinterconfigured {