2
texk/tetex/texconfig | 106 +++++++++++++++++++++++++++++++++++++--------------
3
1 file changed, 77 insertions(+), 29 deletions(-)
5
Index: texlive-bin-2009/texk/tetex/texconfig
6
===================================================================
7
--- texlive-bin-2009.orig/texk/tetex/texconfig 2011-07-09 22:49:45.000000000 +0200
8
+++ texlive-bin-2009/texk/tetex/texconfig 2011-07-09 22:49:57.000000000 +0200
10
fmgrConfigReplaceChanged=false
16
- --*) moreArgs="$moreArgs $1 $2";;
22
+ moreArgs="$moreArgs $1 $2"
27
- do shift; shift; done
31
fmgrConfigReplaceFile=$1
32
fmgrConfigReplaceRegex=$2
33
fmgrConfigReplaceValue=$3
36
fmgrConfigReplaceID=$1; fmgrConfigReplaceCfgFile=$3; fmgrConfigReplaceOrigFile=$4
37
configReplace "$fmgrConfigReplaceCfgFile" "$fmgrConfigReplaceRegex" "$fmgrConfigReplaceValue"
38
- ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$fmgrConfigReplaceID"`
39
- if test $? != 0; then
40
- echo "$progname: fmgrConfigReplace ci failed for \`$fmgrConfigReplaceFile'" >&2
46
- fmgrConfigReplaceChanged=true;;
47
- *) echo "$progname: updated configuration saved as file \`$ci'" >&2
48
- fmgrConfigReplaceChanged=true
49
- lastUpdatedFile=$ci;;
52
+ if [ $use_ucf = true ]; then
53
+ # use ucf in Debian. Since we just copied the file and made only
54
+ # one change, there shouldn't be any need for prompting. But since
55
+ # texconfig might be called by a maintainer script with debconf
56
+ # running, pass the option, if only to prevent it from nagging.
57
+ if ! $(diff $fmgrConfigReplaceCfgFile $fmgrConfigReplaceOrigFile >/dev/null); then
58
+ fmgrConfigReplaceChanged=true
60
+ ucf --debconf-ok $fmgrConfigReplaceCfgFile $fmgrConfigReplaceOrigFile
61
+ # here is a bug: We should somehow check whether the file had been
62
+ # changed, in order to be able to recreate formats etc.
63
+ if test $? != 0; then
64
+ echo "$progname: fmgrConfigReplace failed to call ucf for \`$fmgrConfigReplaceOrigFile'" >&2
68
+ ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$fmgrConfigReplaceID"`
69
+ if test $? != 0; then
70
+ echo "$progname: fmgrConfigReplace ci failed for \`$fmgrConfigReplaceFile'" >&2
76
+ fmgrConfigReplaceChanged=true;;
77
+ *) echo "$progname: updated configuration saved as file \`$ci'" >&2
78
+ fmgrConfigReplaceChanged=true
79
+ lastUpdatedFile=$ci;;
89
- ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$setupDvipsPaperID"`
90
+ # use ucf in Debian. Since we just copied the file and made only
91
+ # one change, there shouldn't be any need for prompting. But since
92
+ # texconfig might be called by a maintainer script with debconf
93
+ # running, pass the option, if only to prevent it from nagging.
94
+ ucf --debconf-ok $setupDvipsPaperCfgFile $setupDvipsPaperOrigFile
96
- echo "$progname: setupDvipsPaper ci failed for \`$setupDvipsPaperFile'" >&2
97
+ echo "$progname: fmgrConfigReplace failed to call ucf for \`$fmgrConfigReplaceOrigFile'" >&2
100
+ # ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$fmgrConfigReplaceID"`
101
+ # if test $? != 0; then
102
+ # echo "$progname: fmgrConfigReplace ci failed for \`$fmgrConfigReplaceFile'" >&2
103
+ # (exit 1); return 1
109
papername=$(echo $papername | \
110
sed 's/11x17//;s/statement//;s/a4size//;s/letterSize//;s/flse//;s/[[:space:]]//g' \
121
pdfPaperHelp="Usage: $progname pdftex paper PAPER"
125
+ if [ -n "$2" ] && [ "$2" = "no-recreate-formats" ]; then skipFormats=true; fi
127
if [ -z $pdfPaperName ]; then
129
@@ -675,12 +713,18 @@
130
pdfPaperWidth=$( echo $PaperWidth | sed 's/mm/ true mm/;s/in/ true in/')
133
- fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$pdfPaperWidth"
134
+ fmgrConfigReplace --ucf pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$pdfPaperWidth"
135
wChanged=$fmgrConfigReplaceChanged
136
- fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$pdfPaperHeight"
138
+ # don't tell again about replacing pdftexconfig
139
+ fmgrConfigReplace --ucf pdftexconfig.tex pdfpageheight '\pdfpageheight='"$pdfPaperHeight" 2>/dev/null
141
+ fmgrConfigReplace --ucf pdftexconfig.tex pdfpageheight '\pdfpageheight='"$pdfPaperHeight"
143
+ if $skipFormats; then return 0; fi
144
if $wChanged || $fmgrConfigReplaceChanged; then
145
echo "pdftex paper size has changed, refreshing formats"
147
+ fmtutil --byengine pdftex 2>&1 | grep "^fmtutil"
152
# get paper for dvipdfmx
153
###############################################################################
155
- fmgrConfigShow dvipdfmx.cfg '/^p/ {s/^p //;p}'
156
+ fmgrConfigShow dvipdfmx.cfg '/^p/ {s/^p[[:space:]]*//;p}'
159
###############################################################################
163
letter|legal|ledger|tabloid|a4|a3)
164
- fmgrConfigReplace config '^p' "p $3";;
165
+ fmgrConfigReplace --ucf config '^p' "p $3";;
166
"") echo "$help" >&2; rc=1;;
168
echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfm paper'" >&2
172
letter|legal|ledger|tabloid|a4|a3)
173
- fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";;
174
+ fmgrConfigReplace --ucf dvipdfmx.cfg '^p' "p $3";;
175
"") echo "$help" >&2; rc=1;;
177
echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfmx paper'" >&2
178
@@ -1422,9 +1466,13 @@
179
if checkForBinary dvips >/dev/null && tcfmgr --cmd find --file config.ps >/dev/null 2>&1; then
180
tcBatch dvips paper $p
182
- if checkForBinary dvipdfm >/dev/null && tcfmgr --cmd find --file config >/dev/null 2>&1; then
183
- tcBatch dvipdfm paper $p
185
+ # dvipdfm is now only a symlink to dvipdfmx. Changing the old
186
+ # config file doesn't make sense. moreover, it is not under ucf
187
+ # control in Debian, so running the command from the libpaper
188
+ # hook would give false ucf questions
189
+ # if checkForBinary dvipdfm >/dev/null && tcfmgr --cmd find --file config >/dev/null 2>&1; then
190
+ # tcBatch dvipdfm paper $p
192
if checkForBinary dvipdfmx >/dev/null && tcfmgr --cmd find --file dvipdfmx.cfg >/dev/null 2>&1; then
193
tcBatch dvipdfmx paper $p
195
@@ -1595,7 +1643,7 @@
197
# 20100125: added paper sizes found in xdvi.c, version.h says 22.84.16 in TeXLive 2010
198
a0|a1|a1r|a2|a2r|a3|a3r|a4|a4r|a5|a5r|a6|a6r|a7|a7r|a8|a8r|a9|a9r|a10|a10r|b0|b0r|b1|b1r|b2|b2r|b3|b3r|b4|b4r|b5|b5r|b6|b6r|b7|b7r|b8|b8r|b9|b9r|b10|b10r|c0|c0r|c1|c1r|c2|c2r|c3|c3r|c4|c4r|c5|c5r|c6|c6r|c7|c7r|c8|c8r|c9|c9r|c10|c10r|foolscap|foolscapr|legal|legalr|us|usr|letter|ledger|tabloid)
199
- fmgrConfigReplace XDvi paper: "*paper: $3"
200
+ fmgrConfigReplace --ucf XDvi paper: "*paper: $3"
202
"") echo "$help" >&2; rc=1;;