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

jadetex patch (was: usertags for jadetex)



Frank Küster <frank@debian.org> wrote:

> Norbert Preining <preining@logic.at> wrote:
>
[...]
>> Here is a diff against postinst that should fix this.

except that there's an other problem in there; it works currently, but
it violates the TeX policy

> --- postinst	2005-12-13 08:39:32.000000000 +0100
> +++ jadetex.postinst.fixed	2005-12-12 22:11:45.000000000 +0100
> @@ -58,10 +58,13 @@
>  checkfmt ( ) {
>      format=$1
>      baseformat=`basename $1 .fmt`
> +    fmtutil=fmtutil
> +    if [ -x /usr/bin/fmtutil-sys ]; then fmtutil=fmtutil-sys; fi
> +
>      if ! ( kpsewhich $baseformat.fmt || kpsewhich $baseformat.efmt ) > /dev/null ; then
>  	warn "WARNING: memory dump $format not found, attempting to reconstruct ..."
> -	echo "running 'fmtutil --byfmt $baseformat'" >> $MYTMPFILE
> -	fmtutil --byfmt $baseformat >> $MYTMPFILE
> +	echo "running '$fmtutil --byfmt $baseformat'" >> $MYTMPFILE
> +	$fmtutil --byfmt $baseformat >> $MYTMPFILE

The policy says:

,----
| If TeX formats need to be generated before execution, this should be
| done in the post-installation script.  Packages that depend on an
| executable can thus simply declare `Depends:' on the package providing
| the executable, and _only_ do that.  Any additional checks, e.g.  for
| the existence of format files, is unnecessary and harmful, causing
| internal changes (e.g.  of format file extensions) to break the
| depending package that does this check.
`----

Furthermore, fmtutil --byfmt automatically creates "baseformats" that
are needed, so all this checking is completely pointless.  All you need
is to depend on tetex-bin (>=3.0-10), where #334613 was fixed.

So the whole checkfmt function is unnecessary, error-prone and should be
dropped.  If the jadetex maintainer fears that he gets bugreports
because the base formats are not built, that shouldn't be a problem:  If
a bugreport comes in where something else than jadetex fails, just
reassign it to tetex-bin.

A patch for the postinst is attached, don't forget the versioned
depends.

Regards, Frank
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer

--- jadetex-3.13/debian/postinst	2005-12-22 14:02:27.826791216 +0100
+++ jadetex-3.13.new/debian/postinst	2005-12-22 14:11:09.155537200 +0100
@@ -55,29 +55,6 @@
   fi
 }
 
-checkfmt ( ) {
-    format=$1
-    baseformat=`basename $1 .fmt`
-    if ! ( kpsewhich $baseformat.fmt || kpsewhich $baseformat.efmt ) > /dev/null ; then
-	warn "WARNING: memory dump $format not found, attempting to reconstruct ..."
-	echo "running 'fmtutil --byfmt $baseformat'" >> $MYTMPFILE
-	fmtutil --byfmt $baseformat >> $MYTMPFILE
-	if kpsewhich $format > /dev/null ; then
-	    warn "       ok, reconstructed"
-	else
-	    warn "ERROR: cannot create TeX memory dump $format"
-	    warn "       Your TeX environment seems to be broken; the memory dump file $format"
-	    warn "       was not found and cannot be created.  Probably, TeX is miconfigured."
-	    warn "       You should submit the log file $MYTMPFILE as a bug against"
-	    warn "       the package tetex-bin."
-	    warn
-	    warn "JadeTeX cannot be installed."
-	    exit 1
-	fi
-    fi
-}
-
-
 make_and_check_fmt ( ) {
     local fmt
     fmt=$1
@@ -91,7 +68,7 @@
         return 0
     else
         log "running 'fmtutil --byfmt $fmt'..."
-        if ! fmtutil --byfmt $fmt >> $MYTMPFILE; then
+        if ! $fmtutil --byfmt $fmt >> $MYTMPFILE; then
             warn "ERROR: $fmt fmtutil failed"
             return 1
         else
@@ -147,12 +124,6 @@
     update-fmtutil
     update-texmf
 
-    echo "Checking for TeX memory dumps (.fmt) ..."
-    checkfmt latex.fmt
-    checkfmt pdftex.fmt
-    checkfmt pdflatex.fmt
-    echo "   done."
-
     echo "Creating JadeTeX memory dumps ..."
     if makejadetexfmt; then
         echo "   done."

Reply to: