cygport: texlive change

Ken Brown kbrown@cornell.edu
Sun Aug 2 19:43:00 GMT 2015


On 6/16/2015 9:27 PM, Ken Brown wrote:
> On 6/16/2015 7:52 PM, Yaakov Selkowitz wrote:
>> On Tue, 2015-06-16 at 10:24 -0400, Ken Brown wrote:
>>> The syntax for 'fmtutil' has changed in TeX Live 2015.  The attached
>>> patch accommodates that change.
>>
>> Just curious, what changed?  AFAICS the fmtutil-sys in 20140523-2 also
>> accepts --byfmt.
>
> The change is in the --enablefmt/--disablefmt commands.  For example, there are
> two formats called cont-en, one with engine pdftex and one with engine xetex. It
> used to be that you could write
>
>    fmtutil-sys --enablefmt cont-en
>
> and both of those formats would be enabled.  Now you have to write
>
>    fmtutil-sys --enablefmt cont-en/pdftex
>
> or
>
>    fmtutil-sys --enablefmt cont-en/xetex
>
> or both.  But for --byfmt, you still just use cont-en as before.
>
>> Also, I'm a bit confused by the use of $formats.  It seems to just be a
>> list of all ${fmt%/*}, but then in the --byfmt call you have ${format
>> %/*}.
>
> That's just a careless mistake on my part.  Thanks for catching it.  I should
> have just used $format in the --byfmt call.  The point of $formats is that it's
> a list of all ${fmt%/*} *without repetitions*; for example, cont-en would occur
> twice if I didn't remove repetitions.

Yaakov,

It looks like you forget this patch for cygport-0.20.2-1.  Here it is again, 
with the mistake corrected.

Ken
-------------- next part --------------
From e7998bb7fd9c4d06cbd76bc715862e6263901688 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Tue, 16 Jun 2015 09:47:53 -0400
Subject: [PATCH] texlive: fix calls to fmtutil for TeX Live 2015

The syntax for 'fmtutil --enablefmt/--disablefmt' now requires the
specification of a pair format/engine in case there is more than one
engine with a given format name.
---
 cygclass/texlive.cygclass |  2 +-
 lib/src_postinst.cygpart  | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/cygclass/texlive.cygclass b/cygclass/texlive.cygclass
index 8e00001..d059e25 100644
--- a/cygclass/texlive.cygclass
+++ b/cygclass/texlive.cygclass
@@ -209,7 +209,7 @@ texlive_install() {
 		done
 
 		for fmt in $(grep -E 'execute AddFormat' $tlpobj \
-		             | sed '/mode=disabled/d;s/.* name=\([^ ]*\).*/\1/g')
+		             | sed '/mode=disabled/d;s|.* name=\([^ ]*\).* engine=\([^ ]*\).*|\1/\2|')
 		do
 			__config_set texlive_fmts "$(__config_get texlive_fmts) $fmt"
 		done
diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 747b564..b28888d 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -329,7 +329,7 @@ __prep_mateconf_schemas() {
 #****
 
 __prep_texlive() {
-	local d fmt fmts map maps
+	local d fmt fmts format formats map maps
 	local markerdir=/var/lib/texmf/postinstall
 
 	dodir /etc/postinstall /etc/preremove ${markerdir}
@@ -355,18 +355,29 @@ __prep_texlive() {
 		done
 		echo >> ${D}/etc/preremove/${PN}.sh
 	fi
+
+	# Each element of $fmts is an expression "format/engine"; we
+	# need to use the entire expression for --enablefmt and
+	# --disablefmt, but only the "format" part for --byfmt.
+	formats=$(for fmt in $fmts; do echo ${fmt%/*}; done | sort -u)
+
 	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
 			_EOF
 			cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF
 				/usr/bin/fmtutil-sys --disablefmt $fmt
 			_EOF
 		done
+		for format in $formats
+		do
+			cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
+				/usr/bin/fmtutil-sys --byfmt ${format}
+			_EOF
+		done
 	fi
 
 	for d in /usr/share/texmf-dist/fonts/{opentype,truetype,type1}
-- 
2.4.5



More information about the Cygwin-apps mailing list