| 1 |
#!/bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
dhit_libkpathsea_configured () |
| 5 |
{ |
| 6 |
kpsewhich --version >/dev/null 2>&1 |
| 7 |
} |
| 8 |
|
| 9 |
case "$1" in |
| 10 |
configure) |
| 11 |
# dealing with doc link changes, bug #716892 |
| 12 |
# tex-common >=4 removes the link |
| 13 |
# /usr/share/texmf/doc -> /usr/share/doc/texmf |
| 14 |
# In addition, the preinst of tex-common renames the link |
| 15 |
# and the postinst removes the backup of the link |
| 16 |
# |
| 17 |
# now if the order of unpacking is reversed on upgrade |
| 18 |
# the doc files get lost: |
| 19 |
# wheezy status: context ships files in /usr/share/doc/texmf |
| 20 |
# post wheezy status: context ships files in /usr/share/texmf/doc |
| 21 |
# |
| 22 |
# order of events in the bad case |
| 23 |
# - wheezy installed, dist upgrade |
| 24 |
# - new context is unpacked, files should go into /u/s/texmf/doc, |
| 25 |
# but since that is a link the files end up in /u/s/doc/texmf. |
| 26 |
# - tex-common is updated, removing the link |
| 27 |
# - tex-common is configured |
| 28 |
# - context is configured |
| 29 |
# files have moved from /u/s/texmf/doc to /u/s/doc/texmf |
| 30 |
# |
| 31 |
# We deal with this case by moving the files back to the |
| 32 |
# proper place in the following way |
| 33 |
# - preinst: |
| 34 |
# If . tex-common is at version ~ 3, context at 2012 |
| 35 |
# . /u/s/texmf/doc is a link as specified above |
| 36 |
# then |
| 37 |
# touch /var/lib/tex-common/context-inverse-update-stamp |
| 38 |
# - postinst |
| 39 |
# If . -r /var/lib/tex-common/context-inverse-update-stamp |
| 40 |
# . doc files are in /u/s/doc/texmf |
| 41 |
# then move them back to /u/s/texmf/doc |
| 42 |
# |
| 43 |
if [ -r /var/lib/tex-common/context-inverse-update-stamp ] ; then |
| 44 |
dpkg-query --listfiles context | grep ^/usr/share/texmf/doc | while read f |
| 45 |
do |
| 46 |
misplacedf=`echo "$f" | sed -e 's=^/usr/share/texmf/doc=/usr/share/doc/texmf='` |
| 47 |
if [ -f "$misplacedf" ] ; then |
| 48 |
mkdir -p `dirname "$f"` |
| 49 |
mv "$misplacedf" "$f" |
| 50 |
fi |
| 51 |
done |
| 52 |
# try to remove all the directories that have been there |
| 53 |
for i in /usr/share/doc/texmf/context/scripts/mkiv/ \ |
| 54 |
/usr/share/doc/texmf/context/scripts/mkii/ \ |
| 55 |
/usr/share/doc/texmf/context/scripts/ \ |
| 56 |
/usr/share/doc/texmf/context/third/gnuplot/ \ |
| 57 |
/usr/share/doc/texmf/context/third/ \ |
| 58 |
/usr/share/doc/texmf/context/document/general/manuals/ \ |
| 59 |
/usr/share/doc/texmf/context/document/general/ \ |
| 60 |
/usr/share/doc/texmf/context/document/ \ |
| 61 |
/usr/share/doc/texmf/context/manuals/allkind/ \ |
| 62 |
/usr/share/doc/texmf/context/manuals/ \ |
| 63 |
/usr/share/doc/texmf/context/ \ |
| 64 |
/usr/share/doc/texmf/man/man1/ \ |
| 65 |
/usr/share/doc/texmf/man/ \ |
| 66 |
/usr/share/doc/texmf/ ; do |
| 67 |
if [ -d $i ] ; then |
| 68 |
rmdir --ignore-fail-on-non-empty $i |
| 69 |
fi |
| 70 |
done |
| 71 |
rm /var/lib/tex-common/context-inverse-update-stamp |
| 72 |
fi |
| 73 |
# |
| 74 |
if dhit_libkpathsea_configured; then |
| 75 |
tempfile=$(mktemp -p /tmp mtxrun.XXXXXXXX) |
| 76 |
# printf "Running mtxrun --generate. This may take some time... " |
| 77 |
# if mtxrun --generate > $tempfile 2>&1 ; then |
| 78 |
# rm -f $tempfile |
| 79 |
# echo "done." |
| 80 |
# else |
| 81 |
# exec >&2 |
| 82 |
# echo |
| 83 |
# echo "mtxrun --generate failed. Output has been stored in" |
| 84 |
# echo "$tempfile" |
| 85 |
# echo "Please include this file if you report a bug." |
| 86 |
# echo |
| 87 |
# exit 1 |
| 88 |
# fi |
| 89 |
tempfile=$(mktemp -p /tmp luatools.XXXXXXXX) |
| 90 |
# printf "Pregenerating ConTeXt MarkIV format. This may take some time... " |
| 91 |
# if luatools --make cont-en > $tempfile 2>&1 ; then |
| 92 |
# rm -f $tempfile |
| 93 |
# echo "done." |
| 94 |
# else |
| 95 |
# exec >&2 |
| 96 |
# echo |
| 97 |
# echo "luatools --make cont-en failed. Output has been stored in" |
| 98 |
# echo "$tempfile" |
| 99 |
# echo "Please include this file if you report a bug." |
| 100 |
# echo |
| 101 |
# exit 1 |
| 102 |
# fi |
| 103 |
tempfile=$(mktemp -p /tmp luametatex.XXXXXXXX) |
| 104 |
# printf "Pregenerating LuaMetaTeX format files. This may take some time... " |
| 105 |
# if mtxrun --make cont-en > $tempfile 2>&1 ; then |
| 106 |
# rm -f $tempfile |
| 107 |
# echo "done." |
| 108 |
# else |
| 109 |
# exec >&2 |
| 110 |
# echo |
| 111 |
# echo "Generating LuaMetaTeX format files failed." |
| 112 |
# echo "$tempfile" |
| 113 |
# echo "Please include this file if you report a bug." |
| 114 |
# echo |
| 115 |
# exit 1 |
| 116 |
# fi |
| 117 |
fi |
| 118 |
;; |
| 119 |
esac |
| 120 |
|
| 121 |
#DEBHELPER# |