Ken Brown, 2014.11.17. 12:00 :
What I have in mind is simpler than this.  There's nothing wrong with
the existing texlive postinstall scripts except slowness, due to the
repetition of time-consuming commands in different scripts.  So I just
need to do some rearranging:

1. I would create a pre-postinstall perpetual script that checks
/etc/postinstall to see if there are any ordinary texlive postinstall
scripts that are not marked as done.  If so, it runs mktexlsr.  [This
may not be necessary; I have to think about it some more.]

2. I would modify all ordinary texlive postinstall scripts to remove all
calls to mktexlsr, fc-cache, and updmap-sys, except for calls to the
latter that simply enable maps.  And I would remove the --nohash option
from those.  In addition, these scripts would create a marker file to
indicate that updmap-sys and fc-cache need to be run later.

3. I would create a post-postinstall perpetual script that runs
updmap-sys and fc-cache as needed.

I have a half-baked cygport patch for texlive postinstall. I dropped it because I don't use cygwin's tex anymore, but it may have some value.

Packages put commands in /etc/postinstall/texlive. The first postinstall script runs and removes them, so subsequent postinsall scripts will see an empty workqueue. Ordering is done by assigning priorities to commands.

s

>From eed457541118eb5c2fd43a63597b2b3b5fc21531 Mon Sep 17 00:00:00 2001
From: Szavai Gyula <[email protected]>
Date: Thu, 12 Jun 2014 08:32:45 +0200
Subject: [PATCH] postinst: cross-package texlive script consolidation

---
 lib/src_postinst.cygpart |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 6188899..25cdb8c 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -327,10 +327,10 @@ __prep_mateconf_schemas() {
 __prep_texlive() {
        local d fmt fmts map maps
 
-       dodir /etc/postinstall /etc/preremove
+       dodir /etc/postinstall /etc/postinstall/texlive /etc/preremove
 
-       cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-               /usr/bin/mktexlsr
+       cat >> ${D}/etc/postinstall/texlive/${PN}.sh <<-_EOF
+               10 /usr/bin/mktexlsr
        _EOF
 
        fmts=$(__config_get texlive_fmts)
@@ -340,33 +340,33 @@ __prep_texlive() {
        then
                for map in $maps
                do
-                       cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-                               /usr/bin/updmap-sys --nohash --nomkmap --enable 
$map
+                       cat >> ${D}/etc/postinstall/texlive/${PN}.sh <<-_EOF
+                               20 /usr/bin/updmap-sys --nohash --nomkmap 
--enable $map
                        _EOF
                        cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF
                                /usr/bin/updmap-sys --nohash --nomkmap 
--disable ${map#*=}
                        _EOF
                done
-               cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-                       /usr/bin/updmap-sys --nohash --syncwithtrees
-                       /usr/bin/updmap-sys --nohash
-                       /usr/bin/mktexlsr
+               cat >> ${D}/etc/postinstall/texlive/${PN}.sh <<-_EOF
+                       30 /usr/bin/updmap-sys --nohash --syncwithtrees
+                       33 /usr/bin/updmap-sys --nohash
+                       36 /usr/bin/mktexlsr
                _EOF
        fi
        if [ -n "${fmts#0}" ]
        then
                for fmt in $fmts
                do
-                       cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-                               /usr/bin/fmtutil-sys --enablefmt $fmt
-                               /usr/bin/fmtutil-sys --byfmt $fmt
+                       cat >> ${D}/etc/postinstall/texlive/${PN}.sh <<-_EOF
+                               50 /usr/bin/fmtutil-sys --enablefmt $fmt
+                               53 /usr/bin/fmtutil-sys --byfmt $fmt
                        _EOF
                        cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF
                                /usr/bin/fmtutil-sys --disablefmt $fmt
                        _EOF
                done
-               cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-                       /usr/bin/mktexlsr
+               cat >> ${D}/etc/postinstall/texlive/${PN}.sh <<-_EOF
+                       60 /usr/bin/mktexlsr
                _EOF
        fi
 
@@ -374,11 +374,19 @@ __prep_texlive() {
        do
                if [ -d ${D}${d} ]
                then
-                       cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-                               /usr/bin/fc-cache -f $d
+                       cat >> ${D}/etc/postinstall/texlive/${PN}.sh <<-_EOF
+                               70 /usr/bin/fc-cache -f $d
                        _EOF
                fi
        done
+
+       cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
+               if [ -d  /etc/postinstall/texlive/ ]
+               then
+                       cat /etc/postinstall/texlive/*.sh | sort -u | cut -d ' 
' -f 2- | sh
+                       rm -R /etc/postinstall/texlive/
+               fi
+       _EOF
 }
 
 #****P* Postinstall/X Sessions
-- 
1.7.9

Reply via email to