[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian packaging of context) branch, master, updated. debian/2013.05.28.20130704-1-1-gbaddaa1



The following commit has been merged in the master branch:
commit baddaa1bb922ad9fbd363083d2777e809508e1d2
Author: Norbert Preining <preining@debian.org>
Date:   Wed Jul 17 13:41:58 2013 +0900

    (hopefully) fixing the missing docfiles bug (Closes: #716892)

diff --git a/debian/changelog b/debian/changelog
index 380f347..4ccd28b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+context (2013.05.28.20130704-2) UNRELEASED; urgency=low
+
+  * (hopefully) fixing the missing docfiles bug (Closes: #716892)
+
+ -- Norbert Preining <preining@debian.org>  Wed, 17 Jul 2013 13:41:11 +0900
+
 context (2013.05.28.20130704-1) unstable; urgency=low
 
   * Imported Upstream version 2013.05.28.20130704
diff --git a/debian/context.postinst b/debian/context.postinst
index 8d85267..f85d91e 100755
--- a/debian/context.postinst
+++ b/debian/context.postinst
@@ -8,6 +8,50 @@ dhit_libkpathsea_configured ()
 
 case "$1" in
   configure)
+    # dealing with doc link changes, bug #716892
+    # tex-common >=4 removes the link 
+    #   /usr/share/texmf/doc -> /usr/share/doc/texmf
+    # In addition, the preinst of tex-common renames the link
+    # and the postinst removes the backup of the link
+    #
+    # now if the order of unpacking is reversed on upgrade
+    # the doc files get lost:
+    # wheezy status: context ships files in /usr/share/doc/texmf
+    # post wheezy status: context ships files in /usr/share/texmf/doc
+    #
+    # order of events in the bad case
+    # - wheezy installed, dist upgrade
+    # - new context is unpacked, files should go into /u/s/texmf/doc,
+    #   but since that is a link the files end up in /u/s/doc/texmf.
+    # - tex-common is updated, removing the link
+    # - tex-common is configured
+    # - context is configured
+    # files have moved from /u/s/texmf/doc to /u/s/doc/texmf
+    #
+    # We deal with this case by moving the files back to the
+    # proper place in the following way
+    # - preinst: 
+    #   If . tex-common is at version ~ 3, context at 2012
+    #      . /u/s/texmf/doc is a link as specified above
+    #   then
+    #      touch /var/lib/tex-common/context-inverse-update-stamp
+    # - postinst
+    #   If . -r /var/lib/tex-common/context-inverse-update-stamp
+    #      . doc files are in /u/s/doc/texmf
+    #   then move them back to /u/s/texmf/doc
+    #
+    if [ -r /var/lib/tex-common/context-inverse-update-stamp ] ; then
+      dpkg-query --listfiles context | grep ^/usr/share/texmf/doc | while read f
+      do
+        misplacedf=`echo "$f" | sed -e 's=^/usr/share/texmf/doc=/usr/share/doc/texmf='`
+      	if [ -f "$misplacedf" ] ; then
+	  mkdir -p `dirname "$f"`
+	  mv "$misplacedf" "$f"
+	  rmdir --ignore-fail-on-non-empty `dirname "$misplacedf"`
+	fi
+      done
+    fi
+    #
     if dhit_libkpathsea_configured; then
       tempfile=$(mktemp -p /tmp mtxrun.XXXXXXXX)
       printf "Running mtxrun --generate. This may take some time... "
diff --git a/debian/context.preinst b/debian/context.preinst
index 72d85b7..bcddc0f 100755
--- a/debian/context.preinst
+++ b/debian/context.preinst
@@ -3,6 +3,24 @@ set -e
 
 case "$1" in
 	install|upgrade)
+    # check if we got unpacked into a linked /usr/share/texmf/doc
+    # see postinst for explanations
+    ov=$2
+    if [ -n "$ov" ] && dpkg --compare-versions "$ov" lt 2013 ; then
+      tcv=$(dpkg-query --show --showformat='${Version}' tex-common)
+      if [ -n "$tcv" ] && dpkg --compare-versions "$tcv" lt 4 ; then
+        slink=/usr/share/texmf/doc
+        slinktarget=../doc/texmf
+        if [ -L $slink ] && [ "$(readlink $slink)" = $slinktarget ] ; then
+          # ok, that link will be gone with the upgrade from tex-common
+          # and our doc files list, make sure that our postinst
+          # script can recover them!
+          mkdir -p /var/lib/tex-common
+          touch /var/lib/tex-common/context-inverse-update-stamp
+        fi
+      fi
+    fi
+    #
 		if [ -L /var/lib/texmf/web2c/pdftex ] ; then
 			linkdest=$(readlink -n /var/lib/texmf/web2c/pdftex)
 			case "$linkdest" in

-- 
Debian packaging of context)


Reply to: