[subversion-commit] SVN tetex commit + diffs: r146 -
tetex-bin/trunk/debian
Frank Küster
frank at costa.debian.org
Fri Aug 19 12:25:20 UTC 2005
Author: frank
Date: 2005-08-19 12:25:19 +0000 (Fri, 19 Aug 2005)
New Revision: 146
Modified:
tetex-bin/trunk/debian/postinst.functions
Log:
fixed syntax error (sed wouldn't understand $insertedtext; perl had to be adapted), and fixed one thinko (TEXMFSYSVAR->VARTEXMF) I found while looking at the code
Modified: tetex-bin/trunk/debian/postinst.functions
===================================================================
--- tetex-bin/trunk/debian/postinst.functions 2005-08-17 17:28:58 UTC (rev 145)
+++ tetex-bin/trunk/debian/postinst.functions 2005-08-19 12:25:19 UTC (rev 146)
@@ -6,14 +6,13 @@
# sanitize /etc/texmf/texmf.cnf
#
# First the setting of TEXMFSYSVAR
- insertedtext="
-% TEXMFSYSVAR *must* be set to /var/lib/texmf in Debian; the old
-% name VARTEXMF is no longer used
-%
-% This variable was forcibly introduced by the postinst script.
-TEXMFSYSVAR = /var/lib/texmf'
-
-
+ insertedtext="% TEXMFSYSVAR *must* be set to /var/lib/texmf in Debian; the old \\
+% name VARTEXMF is no longer used \\
+% \\
+% This variable was forcibly introduced by the postinst script.\\
+TEXMFSYSVAR = /var/lib/texmf \\
+\\
+\\
"
if ! grep '^[[:space:]]*TEXMFSYSVAR' $TEXMFCNF >/dev/null; then
# the needed entry is missing, we have to edit - therefore create a tempfile
@@ -26,22 +25,24 @@
# the setting line). We put the new setting after the paragraph in
# which TEXMFSYSVAR first occurs.
perl -e "
-open(MYFILE,qq($TEXMFCNF));
-my (\$found, \$written) = (0,0);
-while (<MYFILE>){
-print;
-if (! \$found && /TEXMFSYSVAR/){\$found=1}
-if (\$found && ! \$written && /^\$/){
-\$written=1;
-print qq($insertedtext);
-}
-}" > $tempfile
+my \$insertedtext=qq($insertedtext);
+\$insertedtext=~s/\\$/\n/;
+open(MYFILE,qq($TEXMFCNF));
+my (\$found, \$written) = (0,0);
+while (<MYFILE>){
+print;
+if (! \$found && /TEXMFSYSVAR/){\$found=1}
+if (\$found && ! \$written && /^\$/){
+\$written=1;
+print qq(\$insertedtext);
+}
+}" > $tempfile
savemove $tempfile $TEXMFCNF
else
# there is no mention of TEXMFSYSVAR at all (Strange). Is VARTEXMF set?
if grep '^[[:space:]]*VARTEXMF' $TEXMFCNF >/dev/null; then
# yes, we replace it
- sed -e "/^[[:space:]]*TEXMFSYSVAR/{i\
+ sed -e "/^[[:space:]]*VARTEXMF/{i\
$insertedtext
;d}" texmf.d/05TeXMF.cnf > $tempfile
else
@@ -49,6 +50,8 @@
if grep VARTEXMF $TEXMFCNF >/dev/null; then
# we put the new entry after that paragraph
perl -e "
+my \$insertedtext=qq($insertedtext);
+\$insertedtext=~s/\\$/\n/;
open(MYFILE,qq($TEXMFCNF));
my (\$found, \$written) = (0,0);
while (<MYFILE>){
@@ -56,7 +59,7 @@
if (! \$found && /VARTEXMF/){\$found=1}
if (\$found && ! \$written && /^\$/){
\$written=1;
-print qq($insertedtext);
+print qq(\$insertedtext);
}
}" > $tempfile
savemove $tempfile $TEXMFCNF
@@ -65,6 +68,8 @@
# at the beginning of the part that comes from 05TeXMF.cnf, which
# must always be there
perl -e "
+my \$insertedtext=qq($insertedtext);
+\$insertedtext=~s/\\$/\n/;
open(MYFILE,qq($TEXMFCNF));
my (\$found, \$written) = (0,0);
while (<MYFILE>){
@@ -72,7 +77,7 @@
if (! \$found && /^%%% From file: /etc/texmf/texmf.d/05TeXMF.cnf/){\$found=1}
if (\$found && ! \$written && /^\$/){
\$written=1;
-print qq($insertedtext);
+print qq(\$insertedtext);
}
}" > $tempfile
savemove $tempfile $TEXMFCNF
More information about the Pkg-tetex-commits
mailing list