summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/main.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-02 23:18:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-02 23:18:47 +0000
commitad9f5530fc680a154f87283652a676a259c62935 (patch)
treed7cebc05c3c9028c402efa9627d52072d85d59de /perl-install/printer/main.pm
parent58a833eef06f5ebac63dbc025c6b0dd00753bb2d (diff)
downloaddrakx-ad9f5530fc680a154f87283652a676a259c62935.tar
drakx-ad9f5530fc680a154f87283652a676a259c62935.tar.gz
drakx-ad9f5530fc680a154f87283652a676a259c62935.tar.bz2
drakx-ad9f5530fc680a154f87283652a676a259c62935.tar.xz
drakx-ad9f5530fc680a154f87283652a676a259c62935.zip
simplify
Diffstat (limited to 'perl-install/printer/main.pm')
-rw-r--r--perl-install/printer/main.pm54
1 files changed, 25 insertions, 29 deletions
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index d66b41385..757cf35f9 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -1542,24 +1542,19 @@ sub config_sane {
sub config_photocard {
# Add definitions for the drives p:. q:, r:, and s: to /etc/mtools.conf
- my $mtoolsconf = join("", cat_("$::prefix/etc/mtools.conf"));
- return if $mtoolsconf =~ m/^\s*drive\s+p:/m;
- my $mtoolsconf_append = "
+ cat_("$::prefix/etc/mtools.conf") !~ m/^\s*drive\s+p:/m or return;
+
+ append_to_file("$::prefix/etc/mtools.conf", <<'EOF');
# Drive definitions added for the photo card readers in HP multi-function
# devices driven by HPOJ
-drive p: file=\":0\" remote
-drive q: file=\":1\" remote
-drive r: file=\":2\" remote
-drive s: file=\":3\" remote
+drive p: file=":0" remote
+drive q: file=":1" remote
+drive r: file=":2" remote
+drive s: file=":3" remote
# This turns off some file system integrity checks of mtools, it is needed
# for some photo cards.
mtools_skip_check=1
-";
- local *F;
- open F, ">> $::prefix/etc/mtools.conf" or
- die "can't write mtools config in /etc/mtools.conf: $!";
- print F $mtoolsconf_append;
- close F;
+EOF
# Generate a config file for the graphical mtools frontend MToolsFM or
# modify the existing one
@@ -1574,22 +1569,23 @@ mtools_skip_check=1
$mtoolsfmconf =~ s/^\s*DRIVES\s*=\s*\"[A-Za-z ]*\"/DRIVES=\"$alloweddrives\"/m;
$mtoolsfmconf =~ s/^\s*LEFTDRIVE\s*=\s*\"[^\"]*\"/LEFTDRIVE=\"p\"/m;
} else {
- $mtoolsfmconf = "\# MToolsFM config file. comments start with a hash sign.
-\#
-\# This variable sets the allowed driveletters (all lowercase). Example:
-\# DRIVES=\"ab\"
-DRIVES=\"apqrs\"
-\#
-\# This variable sets the driveletter upon startup in the left window.
-\# An empty string or space is for the hardisk. Example:
-\# LEFTDRIVE=\"a\"
-LEFTDRIVE=\"p\"
-\#
-\# This variable sets the driveletter upon startup in the right window.
-\# An empty string or space is for the hardisk. Example:
-\# RIGHTDRIVE=\"a\"
-RIGHTDRIVE=\" \"
-";
+ $mtoolsfmconf = <<'EOF';
+# MToolsFM config file. comments start with a hash sign.
+#
+# This variable sets the allowed driveletters (all lowercase). Example:
+# DRIVES="ab"
+DRIVES="apqrs"
+#
+# This variable sets the driveletter upon startup in the left window.
+# An empty string or space is for the hardisk. Example:
+# LEFTDRIVE="a"
+LEFTDRIVE="p"
+#
+# This variable sets the driveletter upon startup in the right window.
+# An empty string or space is for the hardisk. Example:
+# RIGHTDRIVE="a"
+RIGHTDRIVE=" "
+EOF
}
output("$::prefix/etc/mtoolsfm.conf", $mtoolsfmconf);
}