[subversion-commit] SVN tetex-bin commit + diffs: r1700 -
tetex-bin/trunk/debian
Frank Küster
frank at costa.debian.org
Sat Oct 7 20:40:49 UTC 2006
Author: frank
Date: 2006-10-07 20:40:48 +0000 (Sat, 07 Oct 2006)
New Revision: 1700
Modified:
tetex-bin/trunk/debian/debianize-updmap
Log:
some fixes to debianize-updmap, not yet fully tested
Modified: tetex-bin/trunk/debian/debianize-updmap
===================================================================
--- tetex-bin/trunk/debian/debianize-updmap 2006-10-07 18:34:42 UTC (rev 1699)
+++ tetex-bin/trunk/debian/debianize-updmap 2006-10-07 20:40:48 UTC (rev 1700)
@@ -8,7 +8,12 @@
# A for disableMap:
# 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 $map
-# 3. for each of these files, run configReplace appropriately
+# CHANGE 3. for each of these files, run configReplace appropriately
+# 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)
@@ -50,7 +55,7 @@
defaultuserdir=$HOME/.texmf-config/updmap.d
# this should read a config item in updmap.cfg, but for now we just
- # check whether the default exists
+ # check whether the default exists.
if [ -d $defaultuserdir ]; then
echo $defaultuserdir
fi
@@ -63,16 +68,22 @@
# we are going to act on these
###############################################################################
createDebianConffilelist(){
- if DebianSyswideMode; then
- find /etc/texmf/updmap.d -maxdepth 1 -type f -name '*.cfg'
- else
+ local DebianConffilelist=""
+ syswideFiles=`find /etc/texmf/updmap.d -maxdepth 1 -type f -name '*.cfg'`
+ if ! DebianSyswideMode; then
debianuserdir=`FindDebianUserdir`
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'
+ userFiles=`find "$debianuserdir" -maxdepth 1 -type f -name '*.cfg'`
fi
fi
+ if [ -n "$userFiles" ]; then
+ userBasenames=`for file in $userFiles; do basename $file; done`
+ for file in $syswideFiles; do
+ local copyInUserdir=false
+
+ done
+ else
+ fi
}
###############################################################################
@@ -81,19 +92,16 @@
###############################################################################
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
-# if ! DebianSyswideMode; then
-# debianuserdir=`FindDebianUserdir`
-# if [ -n "$debianuserdir" ]; then
-# updOptions="--conf-dir $debianuserdir"
-# fi
-# # here we could add support for an alternative output file
-# fi
verboseMsg "Running update-updmap to merge the changed files"
- update-updmap --quiet
+ update-updmap --quiet $updOptions
}
###############################################################################
# cleanupNoExit()
@@ -126,7 +134,10 @@
repeatOptions="$repeatOptions `eval echo --$option \\$$option`"
fi
done
- repeatOptions="$repeatOptions --cnffile=$orig"
+ if [ -n "$cfgparam" ]; then
+ # --conffile option was given on the command line
+ repeatOptions="$repeatOptions --cnffile=$orig"
+ fi
if [ "texhashEnabled" = "false" ]; then
repeatOptions="$repeatOptions --nohash"
fi
@@ -183,7 +194,7 @@
else
# there are more than one;
if ! DebianSyswideMode; then
- # a file in the user's dir takes precedence
+ # 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
@@ -226,6 +237,7 @@
# 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
@@ -253,14 +265,21 @@
findRightLocalfile(){
mapName=$1
# Do we know about a user-specific directory?
- DebianSyswideMode || debianuserdir=`FindDebianUserdir`
- if (! DebianSyswideMode) && [ -d "$debianuserdir" ]; then
- DebCnfFile=`pickLocalFile $mapName $debianuserdir`
+ if DebianSyswideMode; then
+ DebCnfFile=`pickLocalFile $mapName /etc/texmf/updmap.d`
else
- DebCnfFile=`pickLocalFile $mapName /etc/texmf/updmap.d`
+ debianuserdir=`FindDebianUserdir`
+ /usr/share/texmf/web2c/mktexdir $debianuserdir
+ test -w $debianuserdir || (
+ echo "Target directory $debianuserdir not writable."
+ echo "Exiting"
+ exit 0
+ )
+ DebCnfFile=`pickLocalFile $mapName $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
}
@@ -282,7 +301,7 @@
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 "$debCnfFile" "^$type[ ]*$1" "#! $type $1"
+ configReplace "$debCnfFile" "^$type[[:space:]]*$1" "#! $type $1"
done
fi
done
@@ -334,9 +353,10 @@
if [ -n "$matchfiles" ]; then
# there is already (at least) one file that has a commented entry for our map
debCnfFile=`findRightMatchfile $mapName $matchfiles`
- test -n "$debCnfFile" || abort "Cannot proceed. Exiting"
- else
- # there is no (commented) entry yet.
+ test -w "$debCnfFile" || debCnfFile=""
+ fi
+ if [ -z "$debCnfFile" ]; then
+ # still none, there is no (commented) entry in any writable file yet.
debCnfFile=`findRightLocalfile $mapName`
test -n "$debCnfFile" || abort "Cannot proceed. Exiting"
verboseMsg "Creating new entry for map file $mapName in $debCnfFile"
More information about the Pkg-tetex-commits
mailing list