[subversion-commit] SVN tetex commit + diffs: r378 - tetex-base/trunk/debian

Frank Küster frank at costa.debian.org
Tue Dec 6 19:44:39 UTC 2005


Author: frank
Date: 2005-12-06 19:44:38 +0000 (Tue, 06 Dec 2005)
New Revision: 378

Modified:
   tetex-base/trunk/debian/common.functions.in
   tetex-base/trunk/debian/common.variables
   tetex-base/trunk/debian/postinst.in
   tetex-base/trunk/debian/postrm.functions
   tetex-base/trunk/debian/postrm.in
   tetex-base/trunk/debian/preinst.in
   tetex-base/trunk/debian/variables
Log:
quite tested, but may still have bad errors

Modified: tetex-base/trunk/debian/common.functions.in
===================================================================
--- tetex-base/trunk/debian/common.functions.in	2005-12-06 12:42:51 UTC (rev 377)
+++ tetex-base/trunk/debian/common.functions.in	2005-12-06 19:44:38 UTC (rev 378)
@@ -221,6 +221,40 @@
 
 }
 
+get_newfilename(){
+  file="$1" # without leading /etc/texmf
+  basedir=${file%%/*}
+  restname=$(echo ${file#*/})
+  case $basedir in
+    $file)
+      case $file in
+	modes.mf)
+	  echo metafont/misc/modes.mf
+	  ;;
+	mktex.cnf)
+	  echo web2c/mktex.cnf
+      esac
+      ;;
+    map)
+      echo fonts/$file
+      ;;
+    dvips)
+      echo $basedir/config/$restname
+      ;;
+      *)
+      echo tex/$basedir/config/$restname
+      ;;
+  esac
+}
+
+dpkg_md5sum(){
+  grep $1  /var/lib/dpkg/status | cut -f 3 -d ' '
+}
+
+ucf_md5sum(){
+  grep $1  /var/lib/ucf/hashfile | cut -f 1 -d ' '
+}
+
 #################################################################
 ##  End of function definitions from file common.functions
 #################################################################

Modified: tetex-base/trunk/debian/common.variables
===================================================================
--- tetex-base/trunk/debian/common.variables	2005-12-06 12:42:51 UTC (rev 377)
+++ tetex-base/trunk/debian/common.variables	2005-12-06 19:44:38 UTC (rev 378)
@@ -25,8 +25,8 @@
 <:$TEXMF_PARTS="05TeXMF 15Plain 45TeXinputs 55Fonts 65BibTeX 75DviPS 85Misc 90TeXDoc 95NonPath":>//
 <:for (@TEXMF_PARTS_FULLNAME=split(/ /,$TEXMF_PARTS)){s{(.*)}{texmf.d/$1.cnf}}:>//
 <:$TEX_COMMON_UCF_FILES="@TEXMF_PARTS_FULLNAME updmap.d/00updmap.cfg":>//
-# <:$confstatedir="/var/lib/tetex":>//
-# <:$no_config_prefix="admin-wants-no":>//
+<:#$confstatedir="/var/lib/tetex":>//
+<:#$no_config_prefix="admin-wants-no":>//
 <:$LSRS="/var/lib/texmf/ls-R /var/lib/texmf/ls-R-TEXMFMAIN /var/lib/texmf/ls-R-LOCAL /var/cache/fonts/ls-R":>//
 <:# get the package version - must be usable in subdirectories, too:>//)
 <:if(-f "changelog"){open(CHANGELOG,"changelog")} else {open(CHANGELOG, "../changelog")};

Modified: tetex-base/trunk/debian/postinst.in
===================================================================
--- tetex-base/trunk/debian/postinst.in	2005-12-06 12:42:51 UTC (rev 377)
+++ tetex-base/trunk/debian/postinst.in	2005-12-06 19:44:38 UTC (rev 378)
@@ -23,10 +23,11 @@
 PREINST_MOVE_EXT=<:=$PREINST_MOVE_EXT:>
 OLD_LDAT=$etc/language.dat
 
+oldstuff_dir=<:=$OLDSTUFFDIR:>
+FORMER_UCF="<:=$BASE_UCF:>"
 UNUSED_CONFFILES="<:=$UNUSED_CONFFILES_BASE:>"
 
-REMOVE_DIRS=etex
-OLDSTUFFDIR=<:=$OLDSTUFFDIR:>
+UNUSED_CONFDIRS="<:=$UNUSED_CONFDIRS_BASE:>"
 
 umask 022
 
@@ -81,8 +82,12 @@
 
     # remove backup files from preinst
     for file in $UNUSED_CONFFILES; do
-      rm -f /etc/texmf/$file.$PREINST_MOVE_EXT
+      rm -f /etc/texmf/$oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT
     done
+    for file in $FORMER_UCF; do
+      rm -f /etc/texmf/$oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT
+      if [ -x /usr/bin/ucf ]; then ucf --purge /etc/texmf/$file; fi
+    done
 
 # Update language.dat (update-language is in tex-common on which we depend)
     update-language

Modified: tetex-base/trunk/debian/postrm.functions
===================================================================
--- tetex-base/trunk/debian/postrm.functions	2005-12-06 12:42:51 UTC (rev 377)
+++ tetex-base/trunk/debian/postrm.functions	2005-12-06 19:44:38 UTC (rev 378)
@@ -58,4 +58,37 @@
   fi
 }
 
+#debug(){true "$*"}
+debug(){
+  echo -en "$*"
+}
 
+postrm_abort_restore_file(){
+  file=/etc/texmf/$1
+  newname=`get_newfilename $1`
+  debug $file
+  test -f "$file" || return 0
+  debug "handled\n"
+  if [ -e $file.$PREINST_MOVE_EXT ]; then
+    mv $file.$PREINST_MOVE_EXT $file
+  else
+    if [ -e /etc/texmf/$newname ]; then
+      mv /etc/texmf/$newname $file 
+    fi
+  fi
+}
+postrm_abort_restore_file_ucf(){
+  file=/etc/texmf/$1
+  newname=`get_newfilename $1`
+  debug $file
+  test -f "$file" || return 0
+  debug "handled\n"
+  if [ -e $file.$PREINST_MOVE_EXT ]; then
+    mv $file.$PREINST_MOVE_EXT $file
+  else
+    if [ -e /etc/texmf/$newname ]; then
+      ucf /etc/texmf/$newname $file 
+      rm /etc/texmf/$newname
+    fi
+  fi
+}

Modified: tetex-base/trunk/debian/postrm.in
===================================================================
--- tetex-base/trunk/debian/postrm.in	2005-12-06 12:42:51 UTC (rev 377)
+++ tetex-base/trunk/debian/postrm.in	2005-12-06 19:44:38 UTC (rev 378)
@@ -14,7 +14,10 @@
 
 UNUSED_CONFFILES="<:=$UNUSED_CONFFILES_BASE:>"
 PREINST_MOVE_EXT=<:=$PREINST_MOVE_EXT:>
+FORMER_UCF="<:=$BASE_UCF:>"
 
+UNUSED_CONFDIRS="<:=$UNUSED_CONFDIRS_BASE:>"
+
 ## Variables needed for upgrading
 generated="download35.map builtin35.map psfonts_t1.map psfonts_pk.map \
  pdftex_dl14.map pdftex_ndl14.map dvipdfm_dl14.map dvipdfm_ndl14.map ps2pk.map"
@@ -56,10 +59,13 @@
     # - app-defaults/XDvi was not renamed, just taken over by 
     #   tetex-bin if it was installed
     # - 10tetex-base.cfg is a conffile, but there might be a *.postinst-bak file
-    for oldconffile in $UNUSED_CONFFILES pdftex/pdftex.cfg updmap.d/10tetex-base.cfg; do
-      remove_with_backups /etc/texmf/$oldconffile
+    for oldconffile in /etc/texmf/pdftex/pdftex.cfg /etc/texmf/updmap.d/10tetex-base.cfg /etc/X11/app-defaults/XDvi; do
+      remove_with_backups $oldconffile
     done
-    remove_with_backups /etc/X11/app-defaults/XDvi
+    for oldconffile in $UNUSED_CONFFILES $FORMER_UCF; do
+      newname=`get_newfilename $oldconffile`
+      remove_with_backups /etc/texmf/$newname
+    done
     for oldconfdir in $UNUSED_CONFDIRS; do
       rmdir /etc/texmf/$oldconfdir 2>/dev/null || true
     done
@@ -68,19 +74,11 @@
     ;;
   abort-install|abort-upgrade)
     for file in $UNUSED_CONFFILES; do
-      debug $file
-      test -f "$file" || break
-      debug "handled\n"
-      if [ -e /etc/texmf/$file.$PREINST_MOVE_EXT ]; then
-	mv /etc/texmf/$file.$PREINST_MOVE_EXT /etc/texmf/$file
-      else
-	newname=`get_newfilename $file`
-	if [ -e /etc/texmf/$newname ]; then
-	  mv /etc/texmf/$newname /etc/texmf/$file 
-	fi
-      fi
+      postrm_abort_restore_file $file
     done
-
+    for file in $FORMER_UCF; do
+      postrm_abort_restore_file_ucf $file
+    done
     ;;
 esac
 

Modified: tetex-base/trunk/debian/preinst.in
===================================================================
--- tetex-base/trunk/debian/preinst.in	2005-12-06 12:42:51 UTC (rev 377)
+++ tetex-base/trunk/debian/preinst.in	2005-12-06 19:44:38 UTC (rev 378)
@@ -11,6 +11,8 @@
 dvipdfmdef=/usr/share/texmf/tex/latex/graphics/dvipdfm.def
 UNUSED_CONFFILES="<:=$UNUSED_CONFFILES_BASE:>"
 PREINST_MOVE_EXT=<:=$PREINST_MOVE_EXT:>
+FORMER_UCF="<:=$BASE_UCF:>"
+oldstuff_dir=<:=$OLDSTUFFDIR:>
 
 # UPDMAP_CFG=/etc/texmf/updmap.d/10tetex-base.cfg
 # UPDMAP_CFG_TRANSITION=/etc/texmf/updmap.d/00updmap.cfg_keep-for-tetex-base
@@ -24,10 +26,43 @@
 <:open(FUNCTIONS,'common.functions');@FUNCTIONS=<FUNCTIONS>;close(FUNCTIONS):>//
 <:=@FUNCTIONS:>//
 
-#debug(){true "$*"}
-debug(){
-  echo -en "$*"
+debug(){true "$*"}
+# debug(){
+#   echo -en "$*"
+# }
+
+preinst_remove_or_move(){
+  file=/etc/texmf/$1
+  newname=`get_newfilename $1`
+  debug $file
+  test -f "$file" || return 0
+  debug "handled\n"
+  oldmd5sum=`dpkg_md5sum $file`
+  currmd5sum=`md5sum $file | cut -d ' ' -f 1`
+  if [ "$oldmd5sum" = "$currmd5sum" ]; then
+    mv $file /etc/texmf/$oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT
+  else
+    newdir=`dirname /etc/texmf/$newname`
+    mkdir -p $newdir
+    mv $file /etc/texmf/$newname
+    (cd /etc/texmf; rmdir --ignore-fail-on-non-empty -p `dirname $file`)
+  fi
 }
+preinst_remove_or_move_ucf(){
+  file=/etc/texmf/$1
+  newname=`get_newfilename $1`
+  debug $file
+  test -f "$file" || return 0
+  debug "handled\n"
+  oldmd5sum=`ucf_md5sum $file`
+  currmd5sum=`md5sum $file | cut -d ' ' -f 1`
+  if [ "$oldmd5sum" = "$currmd5sum" ]; then
+    mv $file /etc/texmf/$oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT
+  else
+    mv $file /etc/texmf/$newname
+    if [ -x /usr/bin/ucf ]; then ucf --purge $file; fi
+  fi
+}
 
 #################################################################
 # Here starts the real action
@@ -57,18 +92,14 @@
 # remove obsolete conffiles if they are unchanged, 
 # otherwise move them to the appropriate place
     for file in $UNUSED_CONFFILES; do
-      debug $file
-      test -f "$file" || break
-      debug "handled\n"
-      oldmd5sum=`dpkg_md5sum $file`
-      currmd5sum=`md5sum /etc/texmf/$file | cut -d ' ' -f 1`
-      if [ "$oldmd5sum" = "$currmd5sum" ]; then
-	mv /etc/texmf/$file /etc/texmf/$file.$PREINST_MOVE_EXT
-      else
-	newname=`get_newfilename $file`
-	mv /etc/texmf/$file /etc/texmf/$newname
-      fi
+      preinst_remove_or_move $file
     done
+    for file in $FORMER_UCF; do
+      preinst_remove_or_move_ucf $file
+    done
+    for dir in $UNUSED_CONFDIRS; do
+      test -d $dir && rmdir --ignore-fail-on-non-empty $dir || true
+    done
 
     ;;
   abort-upgrade)

Modified: tetex-base/trunk/debian/variables
===================================================================
--- tetex-base/trunk/debian/variables	2005-12-06 12:42:51 UTC (rev 377)
+++ tetex-base/trunk/debian/variables	2005-12-06 19:44:38 UTC (rev 378)
@@ -18,9 +18,7 @@
 <:$MOVE_GENERIC_UCF="generic/fontmath.cfg generic/fonttext.cfg generic/preload.cfg":>//
 <:$MOVE_CONTEXT_NOUCF="original-adobe-euro.map original-context-symbol.map original-vogel-symbol.map":>//
 <:$MOVE_CONTEXT_UCF="original-ams-euler.map original-ams-cmr.map original-youngryu-tx.map original-youngryu-px.map":>//
-<:$unused_contextmaps="il2-ams-cmr.map pl0-ams-cmr.map original-adobe-euro.map original-ams-cmr.map \
-    original-ams-euler.map original-context-symbol.map original-vogel-symbol.map \
-    original-youngryu-px.map original-youngryu-tx.map":>//
+<:$unused_contextmaps="il2-ams-cmr.map pl0-ams-cmr.map original-adobe-euro.map original-ams-cmr.map original-ams-euler.map original-context-symbol.map original-vogel-symbol.map original-youngryu-px.map original-youngryu-tx.map":>//
 <:$contextmaps_oldplace="pdftex/context":>//
 <:$contextmaps_newplace="map/dvips/context":>//
 <:#for (@unused_contextmaps_oldplace=split(/ /,$unused_contextmaps)){s{(.*)}{$contextmaps_oldplace/$1}}:>//
@@ -65,13 +63,16 @@
 dvips/config.qcr dvips/config.qhv dvips/config.qpl dvips/config.qtm dvips/config.qzc dvips/config.omega \
 dvips/omega.cfg dvipdfm/README.config modes.mf":>//
 <:$unused_conffiles_misc_2="dvips/context.map etex/language.def latex/fontmath.cfg latex/fonttext.cfg \
-    latex/preload.cfg pdftex/cmttf.map":>//
+latex/preload.cfg pdftex/cmttf.map":>//
 <:$UNUSED_CONFFILES_BASE="@unused_contextmaps_newplace @unused_contextmaps_oldplace $unused_inifiles \
-    $unused_conffiles_misc_3 $unused_conffiles_map_3 $unused_conffiles_misc_2":>//
+$unused_conffiles_misc_3 $unused_conffiles_map_3 $unused_conffiles_misc_2":>//
 <:#unused confdirs are not in fact necessarily unused; they just need:>//
 <:#to be removed upon purge, after deleting files in them.:>//
 <:$OLDSTUFFDIR="/etc/texmf/oldstuff_unused":>//
-<:$UNUSED_CONFDIRS_BASE="etex pdftex $OLDSTUFFDIR":>//
+<:$UNUSED_CONFDIRS_BASE="etex pdftex $OLDSTUFFDIR dvipdfm dvips generic context latex cslatex\
+cyrplain platex plain map map/pdftex map/pdftex/cmttf map/dvipdfm map/dvipdfm/tetex map/dvips \
+map/dvips/context map/dvips/vntex map/dvips/urwvn map/dvips/tetex map/dvips/qfonts map/dvips/psnfssx \
+map/dvips/ps map/dvips/misc map/dvips/lucida map/dvips/cc-pl map/dvips/antt map/dvips/antp":>//
 <:#$BASE_UCF contains a list of files with their destination directories below /etc/texmf/:>//
 <:$BASE_UCF="mktex.cnf dvips/config.builtin35 dvipdfm/config \\
     map/dvips/tetex/contnav.map generic/pdftexconfig.tex \\




More information about the Pkg-tetex-commits mailing list