[Debian-tex-commits] SVN tex-common commit + diffs: r5189 - in tex-common/branches/v3: . debian

Norbert Preining preining at alioth.debian.org
Fri Mar 9 06:48:25 UTC 2012


Author: preining
Date: 2012-03-09 06:48:24 +0000 (Fri, 09 Mar 2012)
New Revision: 5189

Modified:
   tex-common/branches/v3/TODO
   tex-common/branches/v3/debian/changelog
   tex-common/branches/v3/debian/postinst.in
   tex-common/branches/v3/debian/prerm
Log:
make a more involved postinst that removes the files
if unchanged, and keeps backups if changed
and try to move over 00updmap.cfg settings into
a new updmap.cfg
needs new texlive-base packages!!!


Modified: tex-common/branches/v3/TODO
===================================================================
--- tex-common/branches/v3/TODO	2012-03-09 05:21:15 UTC (rev 5188)
+++ tex-common/branches/v3/TODO	2012-03-09 06:48:24 UTC (rev 5189)
@@ -1,3 +1,3 @@
-- Manually build acl2, find out why "/usr/bin/make mini-proveall" fails.
-- remove old tetex-packages from reportbug-control as soon as the
-  migration packages have disappeared
\ No newline at end of file
+* ucf move /etc/texmf/updmap.d/00updmap.cfg to /etc/texmf/web2c/updmap.cfg
+* ucf remove or disable if changed /etc/texmf/texmf.d/*
+

Modified: tex-common/branches/v3/debian/changelog
===================================================================
--- tex-common/branches/v3/debian/changelog	2012-03-09 05:21:15 UTC (rev 5188)
+++ tex-common/branches/v3/debian/changelog	2012-03-09 06:48:24 UTC (rev 5189)
@@ -1,11 +1,12 @@
 tex-common (3.1) experimental; urgency=low
 
+  * UNRELEASED
   * only try to remove /etc/texmf/web2c if it is still here (Closes: #663029)
   * add missing break against tex-gyre <= 2.004.1-2.1 (Closes: #663173)
   * remove old ucf managed files with ucf instead of dpkg-maintscript-helper
     (Closes: #663092)
 
- -- Norbert Preining <preining at debian.org>  Fri, 09 Mar 2012 13:54:08 +0900
+ -- Norbert Preining <preining at debian.org>  Fri, 09 Mar 2012 15:47:24 +0900
 
 tex-common (3.0) experimental; urgency=low
 

Modified: tex-common/branches/v3/debian/postinst.in
===================================================================
--- tex-common/branches/v3/debian/postinst.in	2012-03-09 05:21:15 UTC (rev 5188)
+++ tex-common/branches/v3/debian/postinst.in	2012-03-09 06:48:24 UTC (rev 5189)
@@ -296,7 +296,20 @@
     esac
 }
 
+ucf_md5sum(){
+  file=$1
+  md5sum=$(grep "$file$"  /var/lib/ucf/hashfile | cut -f 1 -d ' ')
+  echo $md5sum
+}
 
+cfgval()
+{
+  cnfFile="$1"
+  opt="$2"
+  cat "$cnfFile" | sed -n 's/^'"$opt"'[  =][     =]*//p' | sed q
+}
+
+
 #################################################################
 # Here starts the real action
 #################################################################
@@ -308,20 +321,88 @@
         ;;
 
     configure|reconfigure)
+
+    # remove old language.dat file, it is not used anymore
+    if [ -f /etc/texmf/language.dat ] ; then
+        old_ldat_md5sum=`md5sum /etc/texmf/language.dat`
+        if [ ! "$old_ldat_md5sum" = fe9baf0768ade79a585a9df568dac5f6 ] && \
+            [ ! "$old_ldat_md5sum" = 1d2d9b25a41ab1cec892bd3382af7645 ]; then
+            cat > /etc/texmf/language.dat.postinst-bak <<EOF
+This file is no longer used and has therefore been renamed by the postinst 
+script of the tex-common package.
+
+Please use the mechanism described in update-language(8) instead.
+
+EOF
+            cat /etc/texmf/language.dat >> /etc/texmf/language.dat.postinst-bak
+        fi
+        rm /etc/texmf/language.dat
+    fi
+
+
     #
     # whatever we do, we remove the updmap.cfg file in /var/lib/texmf/web2c!!
     # it was created by former versions of update-updmap and disturbs the 
     # peace in the new system!
     rm -f /var/lib/texmf/web2c/updmap.cfg
 
-    for i in $UCF_FILES ; do
-      rm -f /etc/texmf/$i
-      ucf --purge /etc/texmf/$i
-      if test -x "`which ucfr`" ; then
-        ucfr --purge tex-common /etc/texmf/$i
-      fi
+    #
+    # ucf files that will be removed
+    UCF_REMOVE="texmf.d/05TeXMF.cnf texmf.d/15Plain.cnf texmf.d/45TeXinputs.cnf texmf.d/55Fonts.cnf texmf.d/65BibTeX.cnf texmf.d/75DviPS.cnf texmf.d/80DVIPDFMx.cnf texmf.d/85Misc.cnf texmf.d/90TeXDoc.cnf texmf.d/95NonPath.cnf"
+    for i in $UCF_REMOVE ; do
+        file=/etc/texmf/$i
+        if [ -r $file ] ; then
+            oldmd5sum=$(ucf_md5sum $file)
+            currmd5sum=$(md5sum $file | cut -d ' ' -f 1)
+            if [ "$oldmd5sum" != "$currmd5sum" ]; then
+                cat > $file.postinst-bak <<EOF
+This file is no longer used and has therefore been renamed by the postinst 
+script of the tex-common package.
+EOF
+                cat $file >> $file.postinst-bak
+                rm $file
+            fi
+        fi
+        ucf --purge $file
+        if test -x "`which ucfr`" ; then
+            ucfr --purge tex-common $file
+        fi
     done
 
+    # move changed settings from 00updmap.cfg to /etc/texmf/web2c/updmap.cfg
+    if [ -r /etc/texmf/updmap.d/00updmap.cfg ]; then
+        if [ ! -r /etc/texmf/web2c/updmap.cfg ] ; then
+            # these are the defaults in TL2012 and onward, so we set them here
+            dflt_dvipsPreferOutline=true
+            dflt_LW35=URWkb
+            dflt_pdftexDownloadBase14=true
+            dflt_dvipdfmDownloadBase14=true
+            dflt_dvipsDownloadBase35=true
+            options="dvipsPreferOutline LW35 pdftexDownloadBase14 dvipdfmDownloadBase14 dvipsDownloadBase35"
+            SETTING_CHANGED=false
+            tempdir=`mktemp -d`
+            tempfile1=`mktemp -p $tempdir`
+            trap 'cleanup' HUP INT QUIT BUS PIPE TERM
+            for option in $options; do
+                eval $option=`cfgval $conffile $option`
+                if eval [ ! "\$$option" = "\$dflt_$option" ]; then
+                    SETTING_CHANGED=true
+                    eval optvalue=\$$option
+                    echo "$option = $optvalue" >> $tempfile1
+                fi
+            done
+            if [ "$SETTING_CHANGED" = "true" ]; then
+                mkdir -p /etc/texmf/web2c/
+                mv $tempfile /etc/texmf/web2c/updmap.cfg
+            fi
+        fi
+        ucf --purge /etc/texmf/updmap.d/00updmap.cfg
+        if test -x "`which ucfr`" ; then
+            ucfr --purge tex-common /etc/texmf/updmap.d/00updmap.cfg
+        fi
+    fi
+            
+
     # after we have removed the left overs from old times
     # create/update texmf.cnf
     update-texmf

Modified: tex-common/branches/v3/debian/prerm
===================================================================
--- tex-common/branches/v3/debian/prerm	2012-03-09 05:21:15 UTC (rev 5188)
+++ tex-common/branches/v3/debian/prerm	2012-03-09 06:48:24 UTC (rev 5189)
@@ -1,7 +1,6 @@
 #!/bin/sh -e
 # 
-# postinst maintainer script for the Debian tex-common package.
-# $Id$
+# prerm maintainer script for the Debian tex-common package.
 
 # remove dirs in /usr/local if empty
 




More information about the Debian-tex-commits mailing list