[SCM] Debian packaging of texlive-nonbin) branch, master, updated. debian/all-2012.20121123-1-2-g63becf1
The following commit has been merged in the master branch:
commit f779dcc5e05129b30f36f7a2d7e397b5f109d57c
Author: Norbert Preining <preining@debian.org>
Date: Sat Nov 24 22:13:07 2012 +0900
carry over patches from texlive-bin to texlive-base, as the scripts
have moved, too, and are now installed from texlive-base
diff --git a/texlive-base/debian/patches/debian-fmtutil-adaptions b/texlive-base/debian/patches/debian-fmtutil-adaptions
new file mode 100644
index 0000000..9a3df98
--- /dev/null
+++ b/texlive-base/debian/patches/debian-fmtutil-adaptions
@@ -0,0 +1,93 @@
+---
+ texmf/doc/man/man1/fmtutil.1 | 7 +++++--
+ texmf/scripts/tetex/fmtutil.sh | 28 +++++++++-------------------
+ 2 files changed, 14 insertions(+), 21 deletions(-)
+
+--- texlive-base-2012.20121123.orig/texmf/doc/man/man1/fmtutil.1
++++ texlive-base-2012.20121123/texmf/doc/man/man1/fmtutil.1
+@@ -45,7 +45,7 @@
+ no-op in TeX Live
+ .TP
+ .BI --enablefmt \ formatname
+-ensable
++enable
+ .I formatname
+ in config file
+ .TP
+@@ -100,8 +100,11 @@
+ .TP
+ .I fmtutil\&.cnf
+ default configuration file
++.IP "\fI/etc/texmf/fmt.d/\fP"
++Debian-specific directory for configuration file snippets
+ .SH "SEE ALSO"
+-.BR kpsewhich (1)
++.BR kpsewhich (1),
++\fBupdate-fmtutil\fP(1)
+ .SH "BUGS"
+ None known, but report any bugs found to <tex-k@tug.org> (mailing list).
+ .SH "AUTHOR"
+--- texlive-base-2012.20121123.orig/texmf/scripts/tetex/fmtutil.sh
++++ texlive-base-2012.20121123/texmf/scripts/tetex/fmtutil.sh
+@@ -542,9 +542,11 @@
+ grep -v '^ *#' "$cnf_file" | sed 's@^ *@@; s@ *$@@' | grep . | sort
+ cleanup $? ;;
+ edit)
+- echo "$0: fmtutil --edit is disabled in TeX Live;" >&2
+- echo "$0: use a file fmtutil-local.cnf instead." >&2
+- echo "$0: See tlmgr --help or http://tug.org/texlive/doc/tlmgr.html." >&2
++ # defined by debianize-fmtutil
++ debianEditWarnAndShow
++ #echo "$0: fmtutil --edit is disabled in TeX Live;" >&2
++ #echo "$0: use a file fmtutil-local.cnf instead." >&2
++ #echo "$0: See tlmgr --help or http://tug.org/texlive/doc/tlmgr.html." >&2
+ cleanup 0 ;;
+ enablefmt|disablefmt)
+ $cmd $arg ;; # does not return
+@@ -556,22 +558,6 @@
+ cleanup $? ;;
+ esac
+
+- if test -n "$cfgmaint"; then
+- if test -z "$cfgparam"; then
+- ci=`tcfmgr --tmp $tmpdir --cmd ci --id $id`
+- if test $? = 0; then
+- if test -n "$ci"; then
+- verboseMsg "$progname: configuration file updated: \`$ci'"
+- else
+- verboseMsg "$progname: configuration file unchanged."
+- fi
+- else
+- abort "failed to update configuration file."
+- fi
+- fi
+- cleanup $?
+- fi
+-
+ # set up destdir:
+ if test -z "$destdir"; then
+ : ${MT_TEXMFVAR=`kpsewhich -var-value=TEXMFVAR`}
+@@ -985,6 +971,7 @@
+ ###############################################################################
+ # disablefmt(format)
+ # disables format in configuration file
++# [ redefined by debianize-fmtutil ]
+ ###############################################################################
+ disablefmt()
+ {
+@@ -1001,6 +988,7 @@
+ ###############################################################################
+ # enablefmt(format)
+ # enables format in configuration file
++# [ redefined by debianize-fmtutil ]
+ ###############################################################################
+ enablefmt()
+ {
+@@ -1013,5 +1001,7 @@
+ (exit 0); return 0
+ }
+
++. /usr/share/texlive/debian/debianize-fmtutil
++
+ main ${1+"$@"}
+ cleanup 0
diff --git a/texlive-base/debian/patches/debian-texconfig-adaptions b/texlive-base/debian/patches/debian-texconfig-adaptions
new file mode 100644
index 0000000..5fe15d7
--- /dev/null
+++ b/texlive-base/debian/patches/debian-texconfig-adaptions
@@ -0,0 +1,300 @@
+---
+ texmf/doc/man/man1/texconfig.1 | 28 +++++++++
+ texmf/scripts/tetex/texconfig.sh | 110 +++++++++++----------------------------
+ 2 files changed, 60 insertions(+), 78 deletions(-)
+
+--- texlive-base-2012.20121123.orig/texmf/doc/man/man1/texconfig.1
++++ texlive-base-2012.20121123/texmf/doc/man/man1/texconfig.1
+@@ -46,6 +46,20 @@
+ .IR TEXMFSYSCONFIG .
+ (You may need to be root to do this.)
+ .PP
++Note that on a Debian system, changes to formats, font setup,
++hyphenation for different languages, etc. should not be done with
++texconfig, because
++.B fmtutil.cnf(5), updmap.cfg(5), texmf.cnf
++and
++.B language.dat
++are generated files in Debian. See
++.I TeX-on-Debian.pdf, TeX-on-Debian.txt.gz
++or
++.I TeX-on-Debian.html/index.html
++in
++.I /usr/share/doc/tex-common/
++for alternatives.
++.PP
+ .I texconfig
+ also offers a non-interactive batch mode which can be accessed with
+ the following commands
+@@ -128,11 +142,23 @@
+ (and their answers).
+ .TP
+ .B font vardir DIR, font ro, font rw
++These options should not be used on a Debian system unless you really
++know what you are doing. For details, look at the output of
++.B texconfig fonts
++and read section 2.5, font caching, in the TeX-on-Debian documentation
++in
++.I /usr/share/doc/tex-common/.
+ .TP
+ .B formats
+ This command allows to edit
+ .B fmtutil.cnf(5)
+-and (re)creates any new or changed formats afterwards.
++and (re)creates any new or changed formats afterwards. It should not
++be used on Debian systems, unless you want to temporarily create and
++test a specific format, because
++.B fmtutil.cnf(5)
++is a generated file in Debian, and changes will be overwritten. See
++.B update-fmtutil
++for details.
+ .TP
+ .B hyphen FORMAT
+ This command allows to edit the hyphenation configuration file for
+--- texlive-base-2012.20121123.orig/texmf/scripts/tetex/texconfig.sh
++++ texlive-base-2012.20121123/texmf/scripts/tetex/texconfig.sh
+@@ -52,6 +52,7 @@
+ FMT=fmt
+ test ! -x /bin/fmt && test ! -f /usr/bin/fmt &&
+ { test -x /bin/adjust || test -x /usr/bin/adjust; } && FMT=adjust
++ :
+ ;;
+ *)
+ return
+@@ -444,7 +445,7 @@
+ {
+ case $configPsFile in
+ "")
+- configPsFile=`tcfmgr --cmd find --file config.ps`
++ configPsFile=`kpsewhich -format='dvips config' config-paper.ps`
+ ;;
+ *)
+ return
+@@ -567,7 +568,7 @@
+ $progname help (or --help; show this help)
+ $progname hyphen FORMAT (edit hyphenation config for FORMAT)
+ $progname init [FORMAT]... (rebuild FORMATs, or all formats
+- plus run texlinks and updmap)
++ plus run updmap)
+ $progname mode MODE (set Metafont MODE)
+ $progname paper PAPER (set default paper size to PAPER)
+ $progname pdftex [OPTION]... (pdftex options)
+@@ -620,7 +621,7 @@
+
+ # texconfig dvipdfm
+ dvipdfm)
+- help="Usage: $progname dvipdfm paper PAPER
++ help="Usage: $progname dvipdfm [paperconf|paper-list] PAPER
+
+ Valid PAPER settings:
+ letter legal ledger tabloid a4 a3"
+@@ -632,6 +633,8 @@
+ paper)
+ case $3 in
+ letter|legal|ledger|tabloid|a4|a3)
++ echo "WARNING: On Debian, this change will NOT be persistent"
++ echo "upon upgrades or changes to the libpaper settings!"
+ fmgrConfigReplace config '^p' "p $3";;
+ "") echo "$help" >&2; rc=1;;
+ *)
+@@ -653,7 +656,7 @@
+
+ # texconfig dvipdfmx
+ dvipdfmx)
+- help="Usage: $progname dvipdfmx paper PAPER
++ help="Usage: $progname dvipdfmx [paperconf,paper-list,paper PAPER]
+
+ Valid PAPER settings:
+ letter legal ledger tabloid a4 a3"
+@@ -665,6 +668,8 @@
+ paper)
+ case $3 in
+ letter|legal|ledger|tabloid|a4|a3)
++ echo "WARNING: On Debian, this change will NOT be persistent"
++ echo "upon upgrades or changes to the libpaper settings!"
+ fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";;
+ "") echo "$help" >&2; rc=1;;
+ *)
+@@ -779,6 +784,12 @@
+ echo "$progname: configuration file for printer \`$printerName' (config.$printerName) not found" >&2
+ rc=1
+ ;;
++ /usr/share/texmf|/usr/share/texlive/texmf|/usr/share/texlive/texmf-dist)
++ echo "On Debian system, this command would remove files installed by dpkg."
++ echo "Please use texconfig dvips del PRINTER only for printers installed by you."
++ echo "Exiting."
++ rc=1
++ ;;
+ *)
+ if rm "$pFile"; then
+ echo "$progname: file \`$pFile' removed" >&2
+@@ -809,7 +820,7 @@
+ locateConfigPsFile
+ case "$configPsFile" in
+ "")
+- echo "$progname: file config.ps not found" >&2; rc=1
++ echo "$progname: file $configPsFile not found" >&2; rc=1
+ ;;
+ *)
+ if grep "@ $tcBatchDvipsPaper " $configPsFile >/dev/null 2>&1; then
+@@ -889,11 +900,11 @@
+ ;;
+
+ faq)
+- setupTexmfmain
+- if test -f $MT_TEXMFMAIN/doc/tetex/teTeX-FAQ; then
+- <$MT_TEXMFMAIN/doc/tetex/teTeX-FAQ eval ${PAGER-more}
++ setupTexmfdist
++ if test -f $MT_TEXMFDIST/doc/tetex/teTeX-FAQ.gz; then
++ <$MT_TEXMFDIST/doc/tetex/teTeX-FAQ.gz eval ${PAGER-zless}
+ else
+- echo "$progname: faq not found (usually in \$TEXMFMAIN/doc/tetex/teTeX-FAQ)" >&2
++ echo "$progname: faq not found (usually in \$TEXMFDIST/doc/tetex/teTeX-FAQ)" >&2
+ rc=1
+ fi
+ ;;
+@@ -1007,21 +1018,6 @@
+ ;;
+
+ formats)
+- cat >&2 <<EOM
+-texconfig formats is no longer supported, because manual edits of
+-fmtutil.cnf will be overwritten by the new TeX Live package manager,
+-tlmgr, which regenerates that file as needed upon package changes.
+-Thus, to add or remove formats, the recommended method is to use tlmgr
+-to add or remove the appropriate package.
+-
+-If you need to make manual additions, you can edit the file
+-fmtutil-local.cnf under TEXMFLOCAL. Further information with
+-tlmgr --help and at http://tug.org/texlive/tlmgr.html.
+-
+-Exiting.
+-EOM
+- exit 1 # but leave the real code for posterity
+-
+ setupTmpDir
+ echo "$progname: analyzing old configuration..." >&2
+ fmtutil --catcfg > $tmpdir/pre
+@@ -1037,7 +1033,6 @@
+ for i in `awk '{print $1}' $tmpdir/addOrChange`; do
+ fmtutil --byfmt "$i" || rc=1
+ done
+- texlinks --multiplatform || rc=1
+ fi
+ ;;
+
+@@ -1047,22 +1042,6 @@
+
+ # "hyphen FORMAT"
+ hyphen)
+- cat >&2 <<EOM
+-texconfig hyphen is no longer supported, because manual edits of
+-language.dat (or language.def) will be overwritten by the new TeX Live
+-package manager, tlmgr, which regenerates those configuration files as
+-needed upon package changes. Thus, to add or remove hyphenation
+-patterns, the recommended method is to use tlmgr to add or remove the
+-appropriate package.
+-
+-If you need to make manual additions, you can edit the files
+-language-local.dat and language-local.def under TEXMFLOCAL. Further
+-information with tlmgr --help and at http://tug.org/texlive/tlmgr.html.
+-
+-Exiting.
+-EOM
+- exit 1 # but leave the real code for posterity
+-
+ tcBatchHyphenFormat=$2
+ formatsForHyphen=`getFormatsForHyphen`
+ formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'`
+@@ -1084,6 +1063,11 @@
+ rc=1
+ return
+ ;;
++ /var/lib/texmf/*)
++ echo "$progname: The hyphenation file for $tcBatchHyphenFormat is a generated file in Debian"
++ echo "You cannot use this texconfig command, use \`update-language(1)' instead."
++ echo "Please read its manual page or /usr/share/tex-common/TeX-on-Debian*"
++ ;;
+ esac
+
+ getRelDir "$tcBatchHyphenFile"
+@@ -1111,7 +1095,7 @@
+ fi
+ ;;
+ esac
+- ${VISUAL-${EDITOR-vi}} "$tcBatchHFEdit"
++ ${VISUAL:-${EDITOR:-sensible-editor}} "$tcBatchHFEdit"
+ if cmp "$tcBatchHFEdit" "$tcBatchHFOrig" >/dev/null 2>&1; then
+ echo "$progname: configuration unchanged." >&2
+ else
+@@ -1153,7 +1137,6 @@
+ case $2 in
+ "")
+ if fmtutil --all \
+- && texlinks --multiplatform \
+ && updmap; then
+ :
+ else
+@@ -1210,41 +1193,10 @@
+ ;;
+
+ paper)
+- help="Usage: $progname paper PAPER
+-
+-Valid PAPER settings:
+- letter a4"
+-
+- p=$2; pXdvi=$2; pDvips=$2
+- case $2 in
+- letter)
+- pXdvi=us;;
+- a4)
+- pXdvi=a4;;
+- "") echo "$help" >&2; rc=1; return;;
+- *)
+- echo "$progname: unknown PAPER \`$2' given as argument for \`$progname paper'" >&2
+- echo "$progname: try \`$progname paper' for help" >&2
+- rc=1
+- return;;
+- esac
+- if checkForBinary dvips >/dev/null && tcfmgr --cmd find --file config.ps >/dev/null 2>&1; then
+- tcBatch dvips paper $pDvips
+- fi
+- if checkForBinary dvipdfm >/dev/null && tcfmgr --cmd find --file config >/dev/null 2>&1; then
+- tcBatch dvipdfm paper $p
+- fi
+- if checkForBinary dvipdfmx >/dev/null && tcfmgr --cmd find --file dvipdfmx.cfg >/dev/null 2>&1; then
+- tcBatch dvipdfmx paper $p
+- fi
+- if checkForBinary xdvi >/dev/null && tcfmgr --cmd find --file XDvi >/dev/null 2>&1; then
+- tcBatch xdvi paper $pXdvi
+- fi
+- if checkForBinary pdftex >/dev/null && tcfmgr --cmd find --file pdftexconfig.tex >/dev/null 2>&1; then
+- tcBatch pdftex paper $p
+- fi
++ echo "This command shouldn't be used on Debian. Please use 'paperconf' instead."
++ echo
++ rc=1
+ ;;
+-
+ pdftex)
+ help="Usage: $progname pdftex paper PAPER
+
+@@ -1277,6 +1229,8 @@
+ ;;
+
+ paper)
++ echo "WARNING: On Debian, this change will NOT be persistent"
++ echo "upon upgrades or changes to the libpaper settings!"
+ case $3 in
+ letter)
+ w="8.5 true in"; h="11 true in"
+@@ -1385,6 +1339,8 @@
+ echo "$tcBatchXdviPapers"
+ ;;
+ paper)
++ echo "WARNING: On Debian, this change will NOT be persistent"
++ echo "upon upgrades or changes to the libpaper settings!"
+ case $3 in
+ a1|a1r|a2|a2r|a3|a3r|a4|a4r|a5|a5r|a6|a6r|a7|a7r|b1|b1r|b2|b2r|b3|b3r|b4|b4r|b5|b5r|b6|b6r|b7|b7r|c1|c1r|c2|c2r|c3|c3r|c4|c4r|c5|c5r|c6|c6r|c7|c7r|foolscap|legal|us|usr)
+ fmgrConfigReplace XDvi paper: "*paper: $3"
diff --git a/texlive-base/debian/patches/debian-updmap-man b/texlive-base/debian/patches/debian-updmap-man
new file mode 100644
index 0000000..aebdae4
--- /dev/null
+++ b/texlive-base/debian/patches/debian-updmap-man
@@ -0,0 +1,48 @@
+---
+ texmf/doc/man/man1/updmap.1 | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+--- texlive-base-2012.20121123.orig/texmf/doc/man/man1/updmap.1
++++ texlive-base-2012.20121123/texmf/doc/man/man1/updmap.1
+@@ -178,28 +178,29 @@
+ mentioned in all the updmap.cfg files are merged.
+ .IP
+ Thus, if updmap.cfg files are present in all trees, and the default
+-layout is used as shipped with TeX Live, the following files are
++layout is used as shipped with TeX Live on Debian, the following files are
+ read, in the given order.
+ .nf
+ .IP
+ For updmap\-sys:
+-TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf\-config/web2c/updmap.cfg
+-TEXMFSYSVAR $TEXLIVE/YYYY/texmf\-var/web2c/updmap.cfg
+-TEXMFLOCAL $TEXLIVE/texmf\-local/web2c/updmap.cfg
+-TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg
+-TEXMFDIST $TEXLIVE/YYYY/texmf\-dist/web2c/updmap.cfg
++TEXMFSYSCONFIG /etc/texmf/web2c/updmap.cfg
++TEXMFSYSVAR var/lib/texmf/web2c/updmap.cfg
++TEXMFLOCAL /usr/local/share/texmf\-local/web2c/updmap.cfg
++TEXMFDEBIAN usr/share/texmf/web2c/updmap.cfg
++TEXMFMAIN /usr/share/texlive/texmf/web2c/updmap.cfg
++TEXMFDIST /usr/share/texlive/texmf\-dist/web2c/updmap.cfg
+ .IP
+ For updmap:
+ TEXMFCONFIG $HOME/.texliveYYYY/texmf\-config/web2c/updmap.cfg
+ TEXMFVAR $HOME/.texliveYYYY/texmf\-var/web2c/updmap.cfg
+ TEXMFHOME $HOME/texmf/web2c/updmap.cfg
+-TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf\-config/web2c/updmap.cfg
+-TEXMFSYSVAR $TEXLIVE/YYYY/texmf\-var/web2c/updmap.cfg
+-TEXMFLOCAL $TEXLIVE/texmf\-local/web2c/updmap.cfg
+-TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg
+-TEXMFDIST $TEXLIVE/YYYY/texmf\-dist/web2c/updmap.cfg
++TEXMFSYSCONFIG /etc/texmf/web2c/updmap.cfg
++TEXMFSYSVAR var/lib/texmf/web2c/updmap.cfg
++TEXMFLOCAL /usr/local/share/texmf\-local/web2c/updmap.cfg
++TEXMFDEBIAN usr/share/texmf/web2c/updmap.cfg
++TEXMFMAIN /usr/share/texlive/texmf/web2c/updmap.cfg
++TEXMFDIST /usr/share/texlive/texmf\-dist/web2c/updmap.cfg
+ .IP
+-(where YYYY is the TeX Live release version).
+ .fi
+ .IP
+ There is another exception to keep upgradability from earlier versions
diff --git a/texlive-base/debian/patches/fmtutil_keep_failedlog b/texlive-base/debian/patches/fmtutil_keep_failedlog
new file mode 100644
index 0000000..e7ebc8c
--- /dev/null
+++ b/texlive-base/debian/patches/fmtutil_keep_failedlog
@@ -0,0 +1,24 @@
+---
+ texmf/scripts/tetex/fmtutil.sh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- texlive-base-2012.20121123.orig/texmf/scripts/tetex/fmtutil.sh
++++ texlive-base-2012.20121123/texmf/scripts/tetex/fmtutil.sh
+@@ -763,7 +763,6 @@
+ log_warning "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' possibly failed."
+
+ # We don't want user-interaction for the following "mv" commands:
+- mv "$format.log" "$fulldestdir/$format.log" </dev/null
+ #
+ destfile=$fulldestdir/$fmtfile
+ if mv "$fmtfile" "$destfile" </dev/null; then
+@@ -802,6 +801,9 @@
+ else
+ log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed"
+ fi
++ rm -f "$fulldestdir/$format.log"
++ # We don't want user-interaction for the following "mv" command:
++ mv "$format.log" "$fulldestdir/$format.log" </dev/null
+ }
+
+ ###############################################################################
diff --git a/texlive-base/debian/patches/series b/texlive-base/debian/patches/series
index 525e4b7..b92bd7f 100644
--- a/texlive-base/debian/patches/series
+++ b/texlive-base/debian/patches/series
@@ -19,7 +19,11 @@ pdftex-config-paper-factorization
xdvi-config-paper-factorization
# debian internal, location of modules is different
debian_updmap-search-path
-# debian adaption
+debian-updmap-man
+debian-fmtutil-adaptions
+fmtutil_keep_failedlog
+set-e-fmtutil
+debian-texconfig-adaptions
texdoc-see-and-zip
fix-natbib-add-spaces
upstream_fix_babel_french_days
diff --git a/texlive-base/debian/patches/set-e-fmtutil b/texlive-base/debian/patches/set-e-fmtutil
new file mode 100644
index 0000000..2153cc7
--- /dev/null
+++ b/texlive-base/debian/patches/set-e-fmtutil
@@ -0,0 +1,27 @@
+---
+ texmf/scripts/tetex/fmtutil.sh | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- texlive-base-2012.20121123.orig/texmf/scripts/tetex/fmtutil.sh
++++ texlive-base-2012.20121123/texmf/scripts/tetex/fmtutil.sh
+@@ -3,6 +3,9 @@
+ # Public domain. Originally written by Thomas Esser.
+ # Run with --help for usage.
+
++set -e
++retval=0
++
+ # program history:
+ # further changes in texk/tetex/ChangeLog.
+ # 2007-01-04 patch by JK to support $engine subdir (enabled by default)
+@@ -523,8 +526,8 @@
+ if test -n "$cfgmaint"; then
+ if test -z "$cfgparam"; then
+ setupTmpDir
+- co=`tcfmgr --tmp $tmpdir --cmd co --file $cnf`
+- test $? = 0 || cleanup 1
++ co=`tcfmgr --tmp $tmpdir --cmd co --file $cnf || retval=$?`
++ test $retval = 0 || cleanup 1
+ set x $co; shift
+ id=$1; cnf_file=$3; orig=$4
+ verboseMsg "$progname: initial config file is \`$orig'"
diff --git a/texlive-base/debian/texlive-base.root/usr/share/texlive/debian/debianize-fmtutil b/texlive-base/debian/texlive-base.root/usr/share/texlive/debian/debianize-fmtutil
new file mode 100644
index 0000000..cbca14e
--- /dev/null
+++ b/texlive-base/debian/texlive-base.root/usr/share/texlive/debian/debianize-fmtutil
@@ -0,0 +1,429 @@
+# This file, debianize-fmtutil, is meant to be sourced by fmtutil and
+# enhance the --enable and --disable options with the functionality
+# needed to deal with Debian's generated fmtutil.cnf.
+# $Id$
+
+# This is the planned scheme how it works
+#
+# A for disablefmt:
+# 1. create a list of files to act on (either in sysconfdir only, or in user dirs too)
+# 2. grep for not-commented lines in these files that contain $fmt
+# 3. if in syswide-mode, for each of these files, run configReplace appropriately;
+# if not in syswide mode, for each of these files,
+# test whether it is in the syswide dir
+# 3.a if not, run configReplace appropriately
+# 3b. if yes, create copy in user dir and run configReplace appropriately
+#
+# B for enableMap:
+# 1. create a list of files to act on (either in sysconfdir only, or in user dirs too)
+# 2. grep for commented lines in these files that contain $map
+# 2.1. if any are found, check whether it is only one
+# 2.1.1 if there is only one, run configReplace on that file appropriately
+# 2.1.2 if there is more than one, the precedence is
+# 20tetex-extra.cfg > XX*local*.cfg > 10tetex-base.cfg > any
+# (extra has maximum priority because
+# 2.1.2.1 if it's clear on which file to act, run configReplace on that file
+# appropriately
+# 2.1.2.2 if unclear (i.e. only "any"), exit with an error
+# 2.2 if none are found, act on 10local.cfg (could be made configurable)
+# - if 10local.cfg does not exist, create it (with an explanatory comment)
+# - run configReplace on it appropriately
+#
+# C for syncwithtrees (and even more?)
+# ?
+#
+# After that, update-fmtutil must be run (in the appropriate mode!), and then fmtutil
+# must reexecute itself. Since disableMap is called by enableMap, we need a wrapper
+# for it.
+
+###############################################################################
+# verboseMsg(msg)
+# print `msg' to stderr is $verbose is true
+###############################################################################
+verboseMsg() {
+ $verboseFlag && verbose echo ${1+"$@"} >&2
+}
+
+###############################################################################
+# enablefmt(format)
+# enables format in configuration file
+###############################################################################
+enablefmt()
+{
+ enableFmtInner $1
+ runUpdate
+}
+
+###############################################################################
+# disablefmt(format)
+# disables format in configuration file
+###############################################################################
+disablefmt()
+{
+ disableFmtInner $1
+ runUpdate
+}
+
+###############################################################################
+# debianEditWarnAndShow()
+# warn that this won't work
+###############################################################################
+debianEditWarnAndShow(){
+ echo "Warning!"
+ echo ""
+ echo "In Debian, fmtutil.cnf, the format configuration file, is a generated file."
+ echo "The actual configuration files are in /etc/texmf/fmt.d."
+ echo "Please read the update-fmtutil(1) manpage and edit those files."
+ echo ""
+ echo "Instead of editing, you will now be shown fmtutil.cnf in a pager."
+ echo ""
+ echo "Press enter to continue."
+ read dummy
+
+ sensible-pager $cnf_file
+
+}
+
+###############################################################################
+# DebianSyswideMode ()
+# determine whether we are running in syswide mode (or user-specific)
+###############################################################################
+DebianSyswideMode(){
+ test "$(id -u)" -eq 0 && return 0 || return 1
+}
+
+###############################################################################
+# FindDebianUserdir ()
+# find the directory containing user-specific fmt.d snippets
+###############################################################################
+FindDebianUserdir(){
+# verboseMsg "entering FindDebianUserdir"
+
+ texmfconfig=$(kpsewhich --expand-path '$TEXMFCONFIG')
+ OLDIFS="$IFS"
+ IFS=:
+ count=0
+ for d in "$texmfconfig"; do
+ count=$(($count+1))
+ : ${cnfdir:=$d}
+ if [ -d "$d/fmt.d" ]; then
+ defaultuserdir="$d/fmt.d"
+ break
+ fi
+ done
+ IFS="$OLDIFS"
+ # still empty? Pick one
+ if [ -z "$defaultuserdir" ]; then
+ if [ $count -eq 1 ]; then
+ defaultuserdir="$cnfdir/fmt.d"
+ else
+ echo "TEXMFCONFIG contains more than one directory, and none of them" >&2
+ echo "already contains a fmt.d/ subdirectory." >&2
+ echo "I don't know how to proceed here, stopping." >&2
+ return
+ fi
+ fi
+
+ /usr/share/texmf/web2c/mktexdir $defaultuserdir
+ if [ -d $defaultuserdir ]; then
+ echo $defaultuserdir
+ fi
+}
+
+###############################################################################
+# createDebianConffilelist
+# create a list of configuration files containing fmtutil snippets;
+# we are going to act on these
+###############################################################################
+createDebianConffilelist(){
+# verboseMsg "entering createDebianConffilelist"
+
+ userFiles=""
+ local DebianConffilelist=""
+ syswideFiles=`find /etc/texmf/fmt.d -maxdepth 1 -type f -name '*.cnf'`
+ if ! DebianSyswideMode; then
+ debianuserdir=`FindDebianUserdir`
+ if [ -n "$debianuserdir" ]; then
+ userFiles=`find "$debianuserdir" -maxdepth 1 -type f -name '*.cnf'`
+ fi
+ fi
+ if [ -n "$userFiles" ]; then
+ for sysfile in $syswideFiles; do
+ for userfile in $userFiles; do
+ if [ ! "`basename $userfile`" = "`basename $sysfile`" ]; then
+ DebianConffilelist="$DebianConffilelist $sysfile"
+ fi
+ done
+ done
+ DebianConffilelist="$DebianConffilelist $userFiles"
+ else
+ DebianConffilelist="$syswideFiles"
+ fi
+ echo $DebianConffilelist
+}
+
+###############################################################################
+# snippetFileIsWritable (debCnfFile)
+# checks whether we are (supposed to be) able to write to a file
+###############################################################################
+snippetFileIsWritable(){
+ local file=$1
+
+ if DebianSyswideMode; then
+ return 0
+ else
+ # /etc/texmf/fmt.d shouldn't be hardcoded
+ if [ "${file#/etc/texmf}" = "${file}" ]; then
+ # file is not in systemwide dir
+ return 0
+ else
+ return 1
+ fi
+ fi
+}
+
+###############################################################################
+# makeUserCopy (filename)
+# create a copy in the user dir
+###############################################################################
+makeUserCopy(){
+ local debCnfFile="$1"
+
+ # create a copy of that file in the user dir
+ debianuserdir=`FindDebianUserdir`
+ newdebCnfFile="$debianuserdir/`basename $debCnfFile`"
+ verboseMsg "I'm not allowed to handle $fmt in $debCnfFile." >&2
+ verboseMsg "Creating copy in $debianuserdir instead." >&2
+ cp $debCnfFile $newdebCnfFile
+ echo "$newdebCnfFile"
+}
+
+###############################################################################
+# findUserfiles (filelist)
+# pick user-specific files out of a filelist of configuration files
+###############################################################################
+findUserfiles(){
+ userfiles=""
+ while [ $# -gt 0 ]; do
+ file="$1"
+ if [ "$file" = "${file#/etc/texmf/}" ]; then
+ # doesn't start with /etc/texmf/: must be user-specific
+ userfiles="$userfiles $file"
+ fi
+ shift;
+ done
+ echo $userfiles
+}
+
+###############################################################################
+# findRightMatchfile (format,filelist)
+# find the right file from filelist to enable mapname
+###############################################################################
+findRightMatchfile(){
+ fmt=$1; shift
+ matchfiles="$@"
+ local debCnfFile=""
+
+ if [ $# -eq 1 ]; then
+ # it is only one, enable map in it. May we write it?
+ debCnfFile=$matchfiles
+ if ! snippetFileIsWritable $debCnfFile; then
+ debCnfFile=`makeUserCopy $debCnfFile`
+ fi
+ echo $debCnfFile
+ verboseMsg "Enabling format in $debCnfFile."
+ return 0
+ else
+ # there are more than one;
+ if ! DebianSyswideMode; then
+ # can only change files in the user's dir
+ usermatchfiles=`findUserfiles $matchfiles`
+ if [ `(set $usermatchfiles; echo $#)` -eq 1 ]; then
+ # exactly one of them is a user-specific file
+ echo $usermatchfiles
+ verboseMsg "Enabling format in user-specific file $usermatchfiles."
+ return 0
+ else
+ # two files in the user directory (as bad as two in the site-wide
+ # dir), or no user-specific files. If there are two user-specific
+ # files, report about them:
+ test -n "$usermatchfiles" && matchfiles="$usermatchfiles" || true
+ fi
+ fi
+ # for now, we exit with an error. Any sensible choice would have to
+ # check whether teTeX or texlive is installed, and I want to save me
+ # that hazzle.
+ cat >&2 <<EOF
+Entries for format $fmt found in several files:
+$matchfiles
+
+Since fmtutil.cnf is a generated file in Debian, I don't know how to proceed.
+Please refer to the manpage of update-fmtutil(1)
+
+EOF
+ fi
+}
+
+###############################################################################
+# pickLocalFile (mapname,directory)
+# pick the right local file in directory
+###############################################################################
+pickLocalFile(){
+ fmt=$1
+ debDirname=$2
+ debDirname=${debDirname%/}
+ # Is there a file with "local" in the name?
+ localfile="`ls $debDirname/*local*cfg 2>/dev/null`"
+ if [ -n "$localfile" ]; then
+ # there is at least one
+ if [ `(set $localfile; echo $#)` -eq 1 ]; then
+ # exactly one
+ verboseMsg "Using local configuration file $localfile"
+ echo $localfile
+ return 0
+ else
+ # more than one local file? Brrrr.
+ cat >&2 <<EOF
+While trying to enable $fmt locally, I found several user-specific config files:
+$localfile
+
+I don't know how to proceed here. Please refer to the manpage of update-fmtutil(1)
+
+EOF
+ fi
+ else
+ # no user config file yet
+ echo $debDirname/10local.cfg
+ return 0
+ fi
+}
+
+###############################################################################
+# findRightLocalfile (fmt)
+# find the right file to enable fmt, site-wide or user-specific
+###############################################################################
+findRightLocalfile(){
+ fmt=$1
+ # Do we know about a user-specific directory?
+ if DebianSyswideMode; then
+ DebCnfFile=`pickLocalFile $fmt /etc/texmf/fmt.d`
+ else
+ debianuserdir=`FindDebianUserdir`
+ test -w $debianuserdir || (
+ echo "Target directory $debianuserdir not writable." >&2
+ echo "Exiting" >&2
+ exit 0
+ )
+ DebCnfFile=`pickLocalFile $fmt $debianuserdir`
+ fi
+# # configReplace will try to grep in the file: touch it to prevent a error message
+# touch $DebCnfFile
+ verboseMsg "Using local configuration file $DebCnfFile"
+ echo $DebCnfFile
+}
+
+###############################################################################
+# runUpdate
+# run update-fmtutil
+###############################################################################
+runUpdate(){
+ updOptions=""
+ if [ -n "$cfgparam" ]; then
+ # --conffile option was given on the command line
+ updOptions="--output-file $orig"
+ fi
+ # here we could check for an alternative user dir, or output file
+ # but as long as FindDebianUserdir only reports the default location,
+ # it doesn't make sense
+
+ verboseMsg "Running update-fmtutil to merge the changed files"
+ update-fmtutil --quiet $updOptions
+}
+
+###############################################################################
+# disableFmtInner (map)
+# disables fmt in config file (any type) (real command)
+###############################################################################
+disableFmtInner()
+{
+ fmt=$1
+ noverbose="$2"
+
+ local debCnfFile
+
+ oldverbose="$verbose"
+ if [ -n "$noverbose" ]; then
+ # don't confuse users with disable messages when they called --enable
+# verboseMsg "disabling verbosity"
+ verbose=false
+ fi
+
+
+ if [ -z "$DebianConffilelist" ]; then
+ DebianConffilelist=`createDebianConffilelist`
+ fi
+
+ # create list of all files that contain an entry
+ for debCnfFile in $DebianConffilelist; do
+ if grep -q "^$fmt" $debCnfFile; then
+ if ! snippetFileIsWritable $debCnfFile; then
+ debCnfFile=`makeUserCopy $debCnfFile`
+ fi
+ verboseMsg "Disabling $fmt in $debCnfFile."
+ ed $debCnfFile >/dev/null 2>&1 <<-eof
+ g/^$fmt[ ]/s/^/#! /
+ w
+ q
+eof
+ fi
+ done
+
+ verbose="$oldverbose"
+ return 0
+}
+
+###############################################################################
+# enableFmtInner (fmt)
+# enables fmt in config file (any type) (real command)
+###############################################################################
+enableFmtInner(){
+ fmt=$1
+ local debCnfFile=""
+
+ if [ -z "$DebianConffilelist" ]; then
+ DebianConffilelist=`createDebianConffilelist`
+ fi
+
+ # a format should only be defined once, so we carefully disable
+ # everything about it here:
+ disableFmtInner "$fmt" noverbose
+
+ # now enable with the right type.
+ # But we have to determine where to enable.
+ # is there already a file that contains a (commented) entry?
+ matchfiles=""
+ for file in $DebianConffilelist; do
+ if grep -q "^#![ ]*$fmt[ ]" "$file"; then
+ matchfiles="$matchfiles $file"
+ fi
+ done
+ if [ -n "$matchfiles" ]; then
+ # there is already (at least) one file that has a commented entry for our map
+ debCnfFile=`findRightMatchfile $fmt $matchfiles`
+ test -w "$debCnfFile" || debCnfFile=""
+ fi
+ if [ -z "$debCnfFile" ]; then
+ # still none, there is no (commented) entry in any writable file yet.
+ debCnfFile=`findRightLocalfile $fmt`
+ test -n "$debCnfFile" || abort "Cannot proceed. Exiting"
+ verboseMsg "Creating new entry for format $fmt in $debCnfFile"
+ fi
+
+ ed $debCnfFile >/dev/null 2>&1 <<-eof
+ g/^#![ ]*$fmt[ ]/s/..[ ]*//
+ w
+ q
+eof
+}
+
+
diff --git a/texlive-extra/debian/patches/fix-scripts b/texlive-extra/debian/patches/fix-scripts
index 693742d..8f06d0b 100644
--- a/texlive-extra/debian/patches/fix-scripts
+++ b/texlive-extra/debian/patches/fix-scripts
@@ -1,11 +1,12 @@
---
- texmf-dist/scripts/pkfix/pkfix.pl | 3 +--
- texmf-dist/scripts/pst2pdf/pst2pdf | 3 +--
- texmf-dist/scripts/vpe/vpe.pl | 3 +--
- 3 files changed, 3 insertions(+), 6 deletions(-)
+ texmf-dist/scripts/a2ping/a2ping.pl | 10 ++--------
+ texmf-dist/scripts/pkfix/pkfix.pl | 3 +--
+ texmf-dist/scripts/pst2pdf/pst2pdf | 3 +--
+ texmf-dist/scripts/vpe/vpe.pl | 3 +--
+ 4 files changed, 5 insertions(+), 14 deletions(-)
---- texlive-extra-2012.20121112.orig/texmf-dist/scripts/pkfix/pkfix.pl
-+++ texlive-extra-2012.20121112/texmf-dist/scripts/pkfix/pkfix.pl
+--- texlive-extra-2012.20121123.orig/texmf-dist/scripts/pkfix/pkfix.pl
++++ texlive-extra-2012.20121123/texmf-dist/scripts/pkfix/pkfix.pl
@@ -1,5 +1,4 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
- if 0;
@@ -13,8 +14,8 @@
use strict;
$^W=1; # turn warning on
#
---- texlive-extra-2012.20121112.orig/texmf-dist/scripts/pst2pdf/pst2pdf
-+++ texlive-extra-2012.20121112/texmf-dist/scripts/pst2pdf/pst2pdf
+--- texlive-extra-2012.20121123.orig/texmf-dist/scripts/pst2pdf/pst2pdf
++++ texlive-extra-2012.20121123/texmf-dist/scripts/pst2pdf/pst2pdf
@@ -1,5 +1,4 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
- if 0;
@@ -22,8 +23,8 @@
use strict; # to be sure, that all is safe ... :-)
---- texlive-extra-2012.20121112.orig/texmf-dist/scripts/vpe/vpe.pl
-+++ texlive-extra-2012.20121112/texmf-dist/scripts/vpe/vpe.pl
+--- texlive-extra-2012.20121123.orig/texmf-dist/scripts/vpe/vpe.pl
++++ texlive-extra-2012.20121123/texmf-dist/scripts/vpe/vpe.pl
@@ -1,5 +1,4 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
- if 0;
@@ -31,3 +32,19 @@
use strict;
#
# vpe.pl
+--- texlive-extra-2012.20121123.orig/texmf-dist/scripts/a2ping/a2ping.pl
++++ texlive-extra-2012.20121123/texmf-dist/scripts/a2ping/a2ping.pl
+@@ -1,11 +1,5 @@
+-#! /bin/sh
+-eval '(exit $?0)' && eval 'PERL_BADLANG=x;export PERL_BADLANG;: \
+-;exec perl -x -S -- "$0" ${1+"$@"};#'if 0;
+-eval 'setenv PERL_BADLANG x;exec perl -x -S -- "$0" $argv:q;#'.q+
+-#!perl -w
+-package Htex::a2ping; $0=~/(.*)/s;unshift@INC,'.';do($1);die$@if$@;__END__+if !1;
+-# This Perl script was generated by JustLib2 at Wed Apr 23 09:14:13 2003.
+-# Don't touch/remove any lines above; http://www.inf.bme.hu/~pts/justlib
++#! /usr/bin/perl -w
++package Htex::a2ping;
+ #
+ # This program is free software, licensed under the GNU GPL, >=2.0.
+ # This software comes with absolutely NO WARRANTY. Use at your own risk!
--
Debian packaging of texlive-nonbin)
Reply to: