[subversion-commit] SVN tetex commit + diffs: r175 - in
tetex-bin/trunk/debian: . patches
Frank Küster
frank at costa.debian.org
Thu Aug 25 19:33:50 UTC 2005
Author: frank
Date: 2005-08-25 19:33:49 +0000 (Thu, 25 Aug 2005)
New Revision: 175
Modified:
tetex-bin/trunk/debian/changelog
tetex-bin/trunk/debian/debianize-updmap
tetex-bin/trunk/debian/patches/patch-deb
Log:
- refined debianize-updmap, it's tested and works with the patched updmap
- unfuzzy patch-deb with quilt, and patch updmap to use debianize-updmap
- changelog entry for this and the added updmap.cfg manpage
Modified: tetex-bin/trunk/debian/changelog
===================================================================
--- tetex-bin/trunk/debian/changelog 2005-08-25 15:00:05 UTC (rev 174)
+++ tetex-bin/trunk/debian/changelog 2005-08-25 19:33:49 UTC (rev 175)
@@ -13,8 +13,12 @@
* Added an explanation of user-specific font configuration in
README.Debian, thanks to Ralf Stubner
<Ralf.Stubner at physik.uni-erlangen.de> [frank]
+ * Add a manpage for updmap.cfg, thanks to Hilmar (closes: #320781)
+ [frank]
+ * updmap(-sys) now does the right thing when called with --disable or
+ --enable. Changing options does not yet work, though [frank]
- -- Frank Küster <frank at debian.org> Wed, 24 Aug 2005 12:57:20 +0200
+ -- Frank Küster <frank at debian.org> Thu, 25 Aug 2005 21:31:37 +0200
tetex-bin (3.0-6) experimental; urgency=low
Modified: tetex-bin/trunk/debian/debianize-updmap
===================================================================
--- tetex-bin/trunk/debian/debianize-updmap 2005-08-25 15:00:05 UTC (rev 174)
+++ tetex-bin/trunk/debian/debianize-updmap 2005-08-25 19:33:49 UTC (rev 175)
@@ -1,6 +1,7 @@
-# This file is meant to be sourced by updmap and enhance the --enable and
-# --disable options with the functionality needed to deal with Debian's
-# generated updmap.cfg.
+# This file, debianize-updmap, is meant to be sourced by updmap and
+# enhance the --enable and --disable options with the functionality
+# needed to deal with Debian's generated updmap.cfg.
+# $Id$
# This is the planned scheme how it works
#
@@ -15,7 +16,8 @@
# 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
-# XX*local*.cfg > 10tetex-base.cfg > 20tetex-extra.cfg > any
+# 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
@@ -33,16 +35,76 @@
# file per run.
###############################################################################
-# disableMap (map)
-# disables map in config file (any type) (Debian wrapper)
+# createDebianConffilelist
+# create a list of configuration files containing updmap snippets;
+# we are going to act on these
###############################################################################
-disableMap()
+createDebianConffilelist(){
+ if [ -n "$debianuserdir" ]; then
+ find /etc/texmf/updmap.d "$debianuserdir" -maxdepth 1 -type f -name '*.cfg'
+ else
+ find /etc/texmf/updmap.d -maxdepth 1 -type f -name '*.cfg'
+ fi
+}
+
+###############################################################################
+# runUpdate
+# run update-updmap
+###############################################################################
+runUpdate(){
+ updOptions=""
+ if [ -n "$debianuserdir" ]; then
+ updOptions="--conf-dir $debianuserdir"
+ fi
+
+ verboseMsg "Running update-updmap to merge the changed files"
+ update-updmap --quiet $updOptions --output-file $orig
+}
+###############################################################################
+# cleanupNoExit()
+# clean up the temp area, but don't exit
+###############################################################################
+cleanupNoExit()
{
- disableMapInner $1
- runUpdate
- reExecSelf
+ rc=$?
+ $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
+ && { cd / && rm -rf "$tmpdir"; }
}
+
###############################################################################
+# reExecSelf
+# execute ourselves again - the confile has changed after an enable or disable
+# command has been processed
+###############################################################################
+reExecSelf(){
+ # remove the temporary directory
+ cleanupNoExit
+
+ # if we need not remake map files, we are done here
+ if [ "$mkmapEnabled" = "false" ]; then exit 0; fi
+
+ # pass ourselves the right options.
+ repeatOptions=""
+ for option in dvipsoutputdir pdftexoutputdir dvipdfmoutputdir; do
+ # strange that I can't do the same with eval test -n
+ if eval [ ! -z "\$$option" ]; then
+ repeatOptions="$repeatOptions `eval echo --$option \\$$option`"
+ fi
+ done
+ repeatOptions="$repeatOptions --cnffile=$orig"
+ if [ "texhashEnabled" = "false" ]; then
+ repeatOptions="$repeatOptions --nohash"
+ fi
+ if [ "$verbose" = "false" ]; then
+ repeatOptions="$repeatOptions --quiet"
+ fi
+
+ verboseMsg "Now running $progname again to generate output files"
+ echo $progname $repeatOptions
+ exec $progname $repeatOptions
+}
+
+###############################################################################
# grepType (map,file)
# grep in file for entry map, and return the mapType
###############################################################################
@@ -53,33 +115,153 @@
egrep "^(MixedMap|Map)[ ]*$map( | |$)" "$file" | awk '{print $1}' | sort | uniq
}
+
###############################################################################
+# 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/updmap.d}" ]; then
+ # doesn't start with /etc/texmf/updmap.d: must be user-specific
+ userfiles="$userfiles $file"
+ fi
+ shift;
+ done
+ echo $userfiles
+}
+
+###############################################################################
+# findRightMatchfile (mapname,filelist)
+# find the right file from filelist to enable mapname
+###############################################################################
+findRightMatchfile(){
+ mapName=$1; shift
+ matchfiles="$@"
+ if [ $# -eq 1 ]; then
+ # it is only one, enable map in it
+ echo $matchfiles
+ verboseMsg "Enabling map file in $matchfiles"
+ return 0
+ else
+ # there are more than one;
+ if [ -n "$debianuserdir" ]; then
+ # a file in the user's dir takes precedence
+ matchfiles=`findUserfiles $matchfiles`
+ if [ `(set $matchfiles; echo $#)` -eq 1 ]; then
+ # exactly one of them is a user-specific file
+ echo $matchfiles
+ verboseMsg "Enabling map file in user-specific file $matchfiles"
+ return 0
+ else
+ # two files in the user directory. As bad as two in the site-wide
+ # dir, we do nothing special
+ :
+ 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 map file $mapName found in several files:
+$matchfiles
+
+Since updmap.cfg is a generated file in Debian, I don't know how to proceed.
+Please refer to the manpage of update-updmap(1)
+
+EOF
+ fi
+}
+
+###############################################################################
+# pickLocalFile (mapname,directory)
+# pick the right local file in directory
+###############################################################################
+pickLocalFile(){
+ mapName=$1
+ debDirname=$2
+ debDirname=${debDirname%/}
+ # Is there a file with "local" in the name?
+ localfile=""
+ 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
+ echo $localfile
+ return 0
+ else
+ # more than one local file? Brrrr.
+ cat >&2 <<EOF
+While trying to enable $mapName locally, I found several user-specific map files:
+$localfile
+
+I don't know how to proceed here. Please refer to the manpage of update-upmdap(1)
+
+EOF
+ fi
+ else
+ # no user config file yet
+ echo $debDirname/99local.cfg
+ return 0
+ fi
+}
+
+###############################################################################
+# findRightLocalfile (mapname)
+# find the right file to enable mapname, site-wide or user-specific
+# mapname is only needed for the error message
+###############################################################################
+findRightLocalfile(){
+ mapName=$1
+ # Do we know about a user-specific directory?
+ if [ -n "$debianuserdir" ]; then
+ DebCnfFile=`pickLocalFile $mapName $debianuserdir`
+ else
+ DebCnfFile=`pickLocalFile $mapName /etc/texmf/updmap.d`
+ fi
+ # configReplace will try to grep in the file: touch it to prevent a error message
+ touch $DebCnfFile
+ echo $DebCnfFile
+}
+
+###############################################################################
# disableMapInner (map)
# disables map in config file (any type) (real command)
###############################################################################
disableMapInner()
{
- #mapType=`awk '($1 == "MixedMap" || $1 == "Map") && $2 == map { print $1 }' \
- # map=$1 <"$cnfFile" | sort | uniq`
map=$1
+ local mapType
if [ -z "$DebianConffilelist" ]; then
- createDebianConffilelist
+ DebianConffilelist=`createDebianConffilelist`
fi
# act on all files that contain an entry
- for file in $DebianConffilelist; do
- if mapType=`grepType $map "$cnfFile"`; then
+ for debCnfFile in $DebianConffilelist; do
+ if mapType=`grepType $map "$debCnfFile"`; then
# although it's a bug, there might be two types enabled - we disable both
for type in $mapType; do
- configReplace "$cnfFile" "^$type[ ]*$1" "#! $type $1"
+ configReplace "$debCnfFile" "^$type[ ]*$1" "#! $type $1"
done
fi
done
}
-
###############################################################################
+# disableMap (map)
+# disables map in config file (any type) (Debian wrapper)
+###############################################################################
+disableMap()
+{
+ disableMapInner $1
+ runUpdate
+ reExecSelf
+}
+###############################################################################
# enableMap (type, map)
# enables an entry in the config file for map with a given type.
###############################################################################
@@ -96,7 +278,7 @@
esac
if [ -z "$DebianConffilelist" ]; then
- createDebianConffilelist
+ DebianConffilelist=`createDebianConffilelist`
fi
# a map can only have one type, so we carefully disable everything
@@ -108,24 +290,22 @@
# is there already a file that contains a (commented) entry?
matchfiles=""
for file in $DebianConffilelist; do
- if egrep "^#![[:blank:]]*(MixedMap|Map)[[:blank:]]*$map([[:blank:]]|$)" "$file" ; then
+ if egrep "^#![[:blank:]]*(MixedMap|Map)[[:blank:]]*$map([[:blank:]]|$)" "$file" >/dev/null ; then
matchfiles="$matchfiles $file"
fi
done
- if [ -z "$matchfiles" ]; then
+ if [ -n "$matchfiles" ]; then
# there is already (at least) one file that has a commented entry for our map
- if [ `(set $matchfiles; echo $#)` -eq 1 ]; then
- # it is only one, enable map in it
- configReplace "$file" "^#![ ]*$mapType[ ]*$mapName" "$mapType $mapName"
- # from here we go directly to runUpdate!
- else
- # there are more than one
- fi
+ debCnfFile=`findRightMatchfile $mapName $matchfiles`
+ test -n "$debCnfFile" || abort "Cannot proceed. Exiting"
else
+ # there is no (commented) entry yet.
+ debCnfFile=`findRightLocalfile $mapName`
+ test -n "$debCnfFile" || abort "Cannot proceed. Exiting"
+ verboseMsg "Creating new entry for map file $mapName in $debCnfFile"
fi
- configReplace "$cnfFile" "^#![ ]*$mapType[ ]*$mapName" "$mapType $mapName"
+ configReplace "$debCnfFile" "^#![ ]*$mapType[ ]*$mapName" "$mapType $mapName"
runUpdate
reExecSelf
}
-
Modified: tetex-bin/trunk/debian/patches/patch-deb
===================================================================
--- tetex-bin/trunk/debian/patches/patch-deb 2005-08-25 15:00:05 UTC (rev 174)
+++ tetex-bin/trunk/debian/patches/patch-deb 2005-08-25 19:33:49 UTC (rev 175)
@@ -1,5 +1,7 @@
---- configure.orig 2005-08-02 18:55:29.120999860 +0200
-+++ configure 2005-08-02 18:55:29.252985294 +0200
+Index: configure
+===================================================================
+--- configure.orig 2005-08-25 17:10:48.000000000 +0200
++++ configure 2005-08-25 17:10:53.000000000 +0200
@@ -4213,12 +4213,13 @@
@@ -20,8 +22,10 @@
# more customizations for standalone xdvik
if test -z "$xdvik_standalone"; then
---- texk/kpathsea/mktexlsr.orig 2005-08-02 18:55:29.125999308 +0200
-+++ texk/kpathsea/mktexlsr 2005-08-02 18:55:29.254985073 +0200
+Index: texk/kpathsea/mktexlsr
+===================================================================
+--- texk/kpathsea/mktexlsr.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/kpathsea/mktexlsr 2005-08-25 17:10:53.000000000 +0200
@@ -103,9 +103,9 @@
db_dir=`echo "$db_file" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname
@@ -62,8 +66,10 @@
done
tty -s && echo "$progname: Done." >&2
exit 0
---- texk/make/paths.mk.orig 2005-08-02 18:55:29.128998977 +0200
-+++ texk/make/paths.mk 2005-08-02 18:55:29.254985073 +0200
+Index: texk/make/paths.mk
+===================================================================
+--- texk/make/paths.mk.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/make/paths.mk 2005-08-25 17:10:53.000000000 +0200
@@ -47,7 +47,7 @@
texmf = @texmfmain@
@@ -73,8 +79,10 @@
# Regular input files.
texinputdir = $(texmf)/tex
---- texk/tetex/Makefile.in.orig 2005-08-02 18:55:29.131998646 +0200
-+++ texk/tetex/Makefile.in 2005-08-02 18:55:29.255984963 +0200
+Index: texk/tetex/Makefile.in
+===================================================================
+--- texk/tetex/Makefile.in.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/tetex/Makefile.in 2005-08-25 17:10:53.000000000 +0200
@@ -35,7 +35,7 @@
# Auxiliary files.
@@ -93,8 +101,10 @@
done
$(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf)/texconfig $(texmf)/texconfig/g $(texmf)/texconfig/v $(texmf)/texconfig/x
$(INSTALL_DATA) $(srcdir)/texmf/texconfig/g/generic $(texmf)/texconfig/g
---- texk/tetex/texconfig.orig 2005-08-02 18:55:29.135998205 +0200
-+++ texk/tetex/texconfig 2005-08-02 18:55:29.260984411 +0200
+Index: texk/tetex/texconfig
+===================================================================
+--- texk/tetex/texconfig.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/tetex/texconfig 2005-08-25 17:10:53.000000000 +0200
@@ -883,8 +883,8 @@
faq)
@@ -114,8 +124,10 @@
else
echo "$progname: setting up vardir failed. Reason: no permission to write file \`$tfc'" >&2
rc=1
---- texk/tetex/fmtutil.orig 2005-08-02 18:55:29.138997874 +0200
-+++ texk/tetex/fmtutil 2005-08-02 18:57:46.673838136 +0200
+Index: texk/tetex/fmtutil
+===================================================================
+--- texk/tetex/fmtutil.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/tetex/fmtutil 2005-08-25 17:10:53.000000000 +0200
@@ -25,7 +25,13 @@
# --cnffile file set configfile for fmtutil
# --fmtdir directory set destination directory for format files
@@ -166,8 +178,10 @@
###############################################################################
# cleanup()
# clean up the temp area and exit with proper exit status
---- texk/tetex/fmtutil-sys.orig 2005-08-02 18:55:29.141997543 +0200
-+++ texk/tetex/fmtutil-sys 2005-08-02 18:55:51.429537861 +0200
+Index: texk/tetex/fmtutil-sys
+===================================================================
+--- texk/tetex/fmtutil-sys.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/tetex/fmtutil-sys 2005-08-25 17:10:53.000000000 +0200
@@ -23,6 +23,7 @@
TEXMFVAR="$v"
@@ -177,8 +191,10 @@
+export TEXMFVAR TEXMFCONFIG progname
exec fmtutil ${1+"$@"}
---- texk/tetex/fmtutil.man.orig 2005-08-02 18:55:29.144997212 +0200
-+++ texk/tetex/fmtutil.man 2005-08-02 18:55:29.262984191 +0200
+Index: texk/tetex/fmtutil.man
+===================================================================
+--- texk/tetex/fmtutil.man.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/tetex/fmtutil.man 2005-08-25 17:10:53.000000000 +0200
@@ -53,6 +53,15 @@
(not implemented, just for compatibility)
.IP "\fB--test\fP"
@@ -195,8 +211,10 @@
.PP
.SH "FILES"
.PP
---- texk/web2c/fmtutil.in.orig 2005-08-02 18:55:29.147996881 +0200
-+++ texk/web2c/fmtutil.in 2005-08-02 18:55:29.263984080 +0200
+Index: texk/web2c/fmtutil.in
+===================================================================
+--- texk/web2c/fmtutil.in.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/web2c/fmtutil.in 2005-08-25 17:10:53.000000000 +0200
@@ -55,7 +55,7 @@
# Change "amstex.ini -> bamstex.ini" and "- -> language.dat"
@@ -206,8 +224,10 @@
# Change "pdfamstex.ini -> pdfbamstex.ini" and "- -> language.dat"
# if you want babel support in pdfamstex:
---- texk/web2c/cwebdir/cweb.1.orig 2005-08-02 18:55:29.150996550 +0200
-+++ texk/web2c/cwebdir/cweb.1 2005-08-02 18:55:29.264983970 +0200
+Index: texk/web2c/cwebdir/cweb.1
+===================================================================
+--- texk/web2c/cwebdir/cweb.1.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/web2c/cwebdir/cweb.1 2005-08-25 17:10:53.000000000 +0200
@@ -100,19 +100,19 @@
.
.SH FILES
@@ -233,8 +253,10 @@
Directory for cweb "include" files.
.
.SH "SEE ALSO"
---- texk/tetex/updmap.man.orig 2005-08-02 18:55:29.194991694 +0200
-+++ texk/tetex/updmap.man 2005-08-02 18:55:29.265983860 +0200
+Index: texk/tetex/updmap.man
+===================================================================
+--- texk/tetex/updmap.man.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/tetex/updmap.man 2005-08-25 17:10:53.000000000 +0200
@@ -98,10 +98,10 @@
\fBdvipdfmDownloadBase14\fP
.IP
@@ -268,3 +290,120 @@
\fBgsftopk\fP(1), \fBpdftex\fP(1), \fBps2pk\fP(1),
\fBtexhash\fP(1), \fBxdvi\fP(1)\&.
.PP
+Index: texk/tetex/updmap
+===================================================================
+--- texk/tetex/updmap.orig 2005-08-25 17:10:48.000000000 +0200
++++ texk/tetex/updmap 2005-08-25 20:00:27.638812777 +0200
+@@ -112,10 +112,15 @@
+ test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
+
+ # the version string
+-version=1107552857 # seconds since `00:00:00 1970-01-01 UTC'
++version=1107552857-debian # seconds since `00:00:00 1970-01-01 UTC'
+ # date '+%s' (with GNU date)
+
+ ###############################################################################
++# source Debian-specific changes
++###############################################################################
++. /usr/share/tetex-bin/debianize-updmap
++
++###############################################################################
+ # help()
+ # display help message and exit
+ ###############################################################################
+@@ -126,6 +131,8 @@
+
+ Valid options:
+ --cnffile file specify configuration file
++ --debian-userdir directory specify directory containing user-specific
++ updmap.cfg snippets (see update-updmap(1))
+ --dvipsoutputdir directory specify output directory (dvips syntax)
+ --pdftexoutputdir directory specify output directory (pdftex syntax)
+ --dvipdfmoutputdir directory specify output directory (dvipdfm syntax)
+@@ -351,38 +358,40 @@
+ # enableMap (type, map)
+ # enables an entry in the config file for map with a given type.
+ ###############################################################################
+-enableMap()
+-{
+- case $1 in
+- Map|MixedMap)
+- ;;
+- *)
+- abort "invalid mapType $1"
+- ;;
+- esac
+-
+- # a map can only have one type, so we carefully disable everything
+- # about map here:
+- disableMap "$2"
+-
+- # now enable with the right type:
+- configReplace "$cnfFile" "^#![ ]*$1[ ]*$2" "$1 $2"
+-}
++# for Debian, this is superseded by a function defined in debianize-updmap
++# enableMap()
++# {
++# case $1 in
++# Map|MixedMap)
++# ;;
++# *)
++# abort "invalid mapType $1"
++# ;;
++# esac
++
++# # a map can only have one type, so we carefully disable everything
++# # about map here:
++# disableMap "$2"
++
++# # now enable with the right type:
++# configReplace "$cnfFile" "^#![ ]*$1[ ]*$2" "$1 $2"
++# }
+
+ ###############################################################################
+ # disableMap (map)
+ # disables map in config file (any type)
+ ###############################################################################
+-disableMap()
+-{
+- #mapType=`awk '($1 == "MixedMap" || $1 == "Map") && $2 == map { print $1 }' \
+- # map=$1 <"$cnfFile" | sort | uniq`
+- map=$1
+- mapType=`egrep "^(MixedMap|Map)[ ]*$map( | |$)" "$cnfFile" | awk '{print $1}' | sort | uniq`
+- for type in $mapType; do
+- configReplace "$cnfFile" "^$type[ ]*$1" "#! $type $1"
+- done
+-}
++# for Debian, this is superseded by a function defined in debianize-updmap
++# disableMap()
++# {
++# #mapType=`awk '($1 == "MixedMap" || $1 == "Map") && $2 == map { print $1 }' \
++# # map=$1 <"$cnfFile" | sort | uniq`
++# map=$1
++# mapType=`egrep "^(MixedMap|Map)[ ]*$map( | |$)" "$cnfFile" | awk '{print $1}' | sort | uniq`
++# for type in $mapType; do
++# configReplace "$cnfFile" "^$type[ ]*$1" "#! $type $1"
++# done
++# }
+
+ ###############################################################################
+ # psADOBE()
+@@ -891,6 +900,10 @@
+ cfgparam=1; cnfFile=$2; shift;;
+ --cnffile=*)
+ cfgparam=1; cnfFile=`echo "$1" | sed 's/--cnffile=//'`;;
++ --debian-userdir)
++ debianuserdir=$2; shift;;
++ --debian-userdir=*)
++ debianuserdir=`echo "$1" | sed 's/--debian-userdir=//'`;;
+ --dvipsoutputdir)
+ dvipsoutputdirparam=1; dvipsoutputdir=$2; shift;;
+ --dvipsoutputdir=*)
+@@ -1285,6 +1298,7 @@
+ mkmapEnabled=true
+ verbose=true
+ needsCleanup=false
++ debianuserdir=
+
+ cnfFileShort=updmap.cfg
+ cnfFile=
More information about the Pkg-tetex-commits
mailing list