Commits

Smith Dhumbumroong committed 53d6a81

Correct and simplify thailatex's .install file.

  • Participants
  • Parent commits ce67786

Comments (0)

Files changed (1)

thailatex/thailatex.install

-install_thailatex_fonts() {
-    echo ">>> thailatex: patching babel.sty..."
-    sync-babel || return 1
-    echo ">>> thailatex: updating the filename database..."
-    echo ">>> thailatex: updating the fontmap files with updmap..."
-    sync-thailatex || return 1
-}
+BABELSTY=`kpsewhich babel.sty`
 
-remove_thailatex_fonts() {
-    echo ">>> thailatex: updating the filename database..."
-    texconfig-sys rehash
-    echo ">>> thailatex: updating the fontmap files with updmap..."
-    updmap-sys --quiet --disable thai.map
+update_texlsr() {
+    echo "Updating TeX filename database..."
+    /usr/bin/mktexlsr
 }
 
 post_install() {
-  install_thailatex_fonts $1
+    update_texlsr $1
+
+    echo -n "Updating babel.sty..."
+    sed -i -e '/turkish/i\\\DeclareOption{thai}{\\input{thai.ldf}}' $BABELSTY
+    echo "done."
+}
+
+post_upgrade() {
+    update_texlsr $1
 }
 
 post_remove() {
-  remove_thailatex_fonts $1
+    update_texlsr $1
+
+    echo -n "Updating babel.sty..."
+    sed -i -e '/thai.ldf/d' $BABELSTY
+    echo "done."
 }