[tex-live] [tex-k] fmtutil --byengine ?

Norbert Preining preining at logic.at
Wed Aug 12 23:16:04 CEST 2009


On Mi, 12 Aug 2009, Karl Berry wrote:
>     --- /src/TeX/texlive-svn/Master/bin/x86_64-linux/fmtutil	2009-06-17 10:03:03.000000000 +0200
>     +++ fmtutil	2009-08-12 22:52:39.000000000 +0200
> 
> Yeah, Norbert, but what about Windows?

Bummer

> As usual, you write the code faster than I can send email!

C-code usually takes a bit

You might ask why I am so eager: For tlmgr I was searching for --byfmt 
like hell, and programmed around it but only for those formats defined
in the tlpdb, not for user added formats in fmtutil-local.cnf. Now
that would have been much easier wiht --byfmt.

No idea if it works or compiles, but it looks reasonable. If someone
which can compile on Win can try it.


--- fmtutil.c	2008-04-16 16:17:27.000000000 +0200
+++ fmtutil.c.new	2009-08-12 23:12:49.000000000 +0200
@@ -141,6 +141,7 @@
 " --byfmt formatname        (re)create format for `formatname'\n"
 "                           `base' and `mem' files can also be created\n"
 " --byhyphen hyphenfile     (re)create formats that depend on `hyphenfile'\n"
+" --byengine engine         (re)create formats that depend on `engine'\n"
 " --showhyphen formatname   print name of hyphenfile for format `formatname'\n"
 " --version                 show revision number\n"
 " --help                    show this message\n"
@@ -373,6 +374,7 @@
   char cnffile[SIXTY4];
   char fmtname[SIXTY4];
   char hyphenfile[SIXTY4];
+  char byenginename[SIXTY4];
   char kpsedot[BLEN];
   char enginesubdir[SIXTY4];
   char *tmp;
@@ -387,12 +389,14 @@
        4 : --byhyphen hyphenfile
        5 : --showhyphen formatname
        6 : --refresh
+       7 : --byengine engine
 */
 
   flag = 0;
   cnffile[0] = '\0';
   fmtname[0] = '\0';
   hyphenfile[0] = '\0';
+  byenginename[0] = '\0';
   Destdir[0] = '\0';
   Currdir[0] = '\0';
   Enginename[0] = '\0';
@@ -482,6 +486,16 @@
       strcpy(hyphenfile, av[i]);
       continue;
     }
+    else if(!strncmp(av[i],"--bye", 5) || !strncmp(av[i], "-bye", 4)) {
+      i++;
+      if(i >= ac) {
+        fprintf(stderr, "Invalid argument.\n");
+        exit (100);
+      }
+      flag = 7;
+      strcpy(byenginename, av[i]);
+      continue;
+    }
     else if(!strncmp(av[i],"--s", 3) || !strncmp(av[i], "-s", 2)) {
       i++;
       if(i >= ac) {
@@ -676,6 +690,17 @@
     if(j == 0)
       fprintf(stderr, "hyphen pattern %s not written in %s.\n",hyphenfile,cnffile);
   }
+  else if(flag == 7) {
+    for(i = 0; i < Fmtnum; i++) {
+      if(!stricmp(K[i].engine, byenginename)) {
+        do_initex(K[i].format, K[i].engine, K[i].args);
+        j++;
+      }
+    }
+    if(j == 0) {
+      fprintf(stderr, "engine name %s not written in %s.\n", byenginename, cnffile);
+    }
+  }
   else if(flag == 3) {
     for(i = 0; i < Fmtnum; i++) {
       if(Enginename[0]) {



Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining at logic.at>        Vienna University of Technology
Debian Developer <preining at debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
MELCOMBE REGIS (n.)
The name of the style of decoration used in cocktail lounges in mock
Tudor hotels in Surrey.
			--- Douglas Adams, The Meaning of Liff


More information about the tex-live mailing list