~ubuntu-branches/ubuntu/precise/texlive-bin/precise

« back to all changes in this revision

Viewing changes to debian/patches/58_texconfig_papersizes_use_ucf

  • Committer: Bazaar Package Importer
  • Author(s): Frank Küster, Hilmar Preuße
  • Date: 2011-08-15 21:48:13 UTC
  • mfrom: (4.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20110815214813-obz0457i0hmxm281
Tags: 2009-11
[ Hilmar Preuße ]
* disable the LFS support provided by upstream again, it is
  really broken (Reopens: #618033). It:
  - breaks pdflatex on big endian platforms (Closes: #637667)
  - introduced an ABI change on 32-bit platforms (Closes: #637720)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
---
 
2
 texk/tetex/texconfig |  106 +++++++++++++++++++++++++++++++++++++--------------
 
3
 1 file changed, 77 insertions(+), 29 deletions(-)
 
4
 
 
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
 
9
@@ -355,12 +355,22 @@
 
10
   fmgrConfigReplaceChanged=false
 
11
 
 
12
   moreArgs=""
 
13
+  use_ucf=false
 
14
   while
 
15
     case $1 in
 
16
-      --*) moreArgs="$moreArgs $1 $2";;
 
17
+      --ucf)
 
18
+       use_ucf=true
 
19
+       shift
 
20
+       ;;
 
21
+      --*)
 
22
+       moreArgs="$moreArgs $1 $2"
 
23
+       shift; shift
 
24
+       ;;
 
25
       *) break;;
 
26
     esac
 
27
-  do shift; shift; done
 
28
+  do
 
29
+    :
 
30
+  done
 
31
   fmgrConfigReplaceFile=$1
 
32
   fmgrConfigReplaceRegex=$2
 
33
   fmgrConfigReplaceValue=$3
 
34
@@ -374,19 +384,37 @@
 
35
   set x $co; shift
 
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
 
41
-    (exit 1); return 1
 
42
-  fi
 
43
-  case $ci in
 
44
-    "") :;;
 
45
-    $lastUpdatedFile)
 
46
-      fmgrConfigReplaceChanged=true;;
 
47
-    *) echo "$progname: updated configuration saved as file \`$ci'" >&2
 
48
-       fmgrConfigReplaceChanged=true
 
49
-       lastUpdatedFile=$ci;;
 
50
-  esac
 
51
+
 
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
 
59
+    fi
 
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
 
65
+      (exit 1); return 1
 
66
+    fi
 
67
+  else
 
68
+    ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$fmgrConfigReplaceID"`
 
69
+    if test $? != 0; then
 
70
+      echo "$progname: fmgrConfigReplace ci failed for \`$fmgrConfigReplaceFile'" >&2
 
71
+      (exit 1); return 1
 
72
+    fi
 
73
+      case $ci in
 
74
+        "") :;;
 
75
+        $lastUpdatedFile)
 
76
+          fmgrConfigReplaceChanged=true;;
 
77
+        *) echo "$progname: updated configuration saved as file \`$ci'" >&2
 
78
+           fmgrConfigReplaceChanged=true
 
79
+           lastUpdatedFile=$ci;;
 
80
+      esac
 
81
+      fi
 
82
   (exit 0); return 0
 
83
 }
 
84
 
 
85
@@ -420,11 +448,20 @@
 
86
        q
 
87
 eof
 
88
 
 
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
 
95
   if test $? != 0; then
 
96
-    echo "$progname: setupDvipsPaper ci failed for \`$setupDvipsPaperFile'" >&2
 
97
+    echo "$progname: fmgrConfigReplace failed to call ucf for \`$fmgrConfigReplaceOrigFile'" >&2
 
98
     (exit 1); return 1
 
99
   fi
 
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
 
104
+  # fi
 
105
   case $ci in
 
106
     "") :;;
 
107
     $lastUpdatedFile)
 
108
@@ -600,9 +637,8 @@
 
109
          papername=$(echo $papername | \
 
110
            sed 's/11x17//;s/statement//;s/a4size//;s/letterSize//;s/flse//;s/[[:space:]]//g' \
 
111
            )
 
112
-         echo $papername
 
113
        fi
 
114
-       :
 
115
+       echo $papername
 
116
       fi
 
117
       ;;
 
118
   esac
 
119
@@ -659,7 +695,9 @@
 
120
 {
 
121
   pdfPaperHelp="Usage: $progname pdftex paper PAPER"
 
122
 
 
123
+  skipFormats=false
 
124
   pdfPaperName="$1"
 
125
+  if [ -n "$2" ] && [ "$2" = "no-recreate-formats" ]; then skipFormats=true; fi
 
126
 
 
127
   if [ -z $pdfPaperName ]; then
 
128
     echo "$help" >&2
 
129
@@ -675,12 +713,18 @@
 
130
   pdfPaperWidth=$( echo $PaperWidth  | sed 's/mm/ true mm/;s/in/ true in/')
 
131
 
 
132
   setupTmpDir
 
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"
 
137
+  if $wChanged; then
 
138
+    # don't tell again about replacing pdftexconfig
 
139
+    fmgrConfigReplace --ucf pdftexconfig.tex pdfpageheight '\pdfpageheight='"$pdfPaperHeight" 2>/dev/null
 
140
+  else
 
141
+    fmgrConfigReplace --ucf pdftexconfig.tex pdfpageheight '\pdfpageheight='"$pdfPaperHeight"
 
142
+  fi
 
143
+  if $skipFormats; then return 0; fi
 
144
   if $wChanged || $fmgrConfigReplaceChanged; then
 
145
     echo "pdftex paper size has changed, refreshing formats"
 
146
-    fmtutil --refresh
 
147
+    fmtutil --byengine pdftex 2>&1 | grep "^fmtutil"
 
148
   fi
 
149
 }
 
150
 
 
151
@@ -709,7 +753,7 @@
 
152
 #   get paper for dvipdfmx
 
153
 ###############################################################################
 
154
 dvipdfmxPaperConf(){
 
155
-  fmgrConfigShow dvipdfmx.cfg '/^p/ {s/^p //;p}'
 
156
+  fmgrConfigShow dvipdfmx.cfg '/^p/ {s/^p[[:space:]]*//;p}'
 
157
 }
 
158
 
 
159
 ###############################################################################
 
160
@@ -828,7 +872,7 @@
 
161
         paper)
 
162
           case $3 in
 
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;;
 
167
             *)
 
168
              echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfm paper'" >&2
 
169
@@ -864,7 +908,7 @@
 
170
         paper)
 
171
           case $3 in
 
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;;
 
176
             *)
 
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
 
181
       fi
 
182
-      if checkForBinary dvipdfm >/dev/null && tcfmgr --cmd find --file config >/dev/null 2>&1; then
 
183
-        tcBatch dvipdfm paper $p
 
184
-      fi
 
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
 
191
+      # fi
 
192
       if checkForBinary dvipdfmx >/dev/null && tcfmgr --cmd find --file dvipdfmx.cfg >/dev/null 2>&1; then
 
193
         tcBatch dvipdfmx paper $p
 
194
       fi
 
195
@@ -1595,7 +1643,7 @@
 
196
           case $3 in
 
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"
 
201
               ;;
 
202
             "") echo "$help" >&2; rc=1;;
 
203
             *)