[Debian-tex-commits] SVN tex-common commit + diffs: r2630 - in tex-common/trunk: debian scripts

Frank Küster frank at alioth.debian.org
Wed Apr 4 13:52:23 UTC 2007


Author: frank
Date: 2007-04-04 13:52:20 +0000 (Wed, 04 Apr 2007)
New Revision: 2630

Modified:
   tex-common/trunk/debian/changelog
   tex-common/trunk/scripts/FileUtils.pm
   tex-common/trunk/scripts/Tpm.pm
Log:
Update Tpm.pm and FileUtils.pm from TeXLive 2007


Modified: tex-common/trunk/debian/changelog
===================================================================
--- tex-common/trunk/debian/changelog	2007-04-04 12:06:25 UTC (rev 2629)
+++ tex-common/trunk/debian/changelog	2007-04-04 13:52:20 UTC (rev 2630)
@@ -4,11 +4,12 @@
     and TeX Live's texmf.cnf. This change is needed to make mpost work
     under all circumstances [np].
   * Update settings and comments in the texmf.cnf snippets to match
-    upstream's as close as possible
-  * Drop backwards compatibility hacks for paths (see NEWS.Debian)
-  * Enable parse-first-line feature, except for Knuth's "tex".
+    upstream's as close as possible [fk]
+  * Drop backwards compatibility hacks for paths (see NEWS.Debian) [fk]
+  * Enable parse-first-line feature, except for Knuth's "tex". [fk]
+  * Update Tpm.pm and FileUtils.pm from TeXLive 2007 [fk]
 
- -- Frank Küster <frank at debian.org>  Mon,  2 Apr 2007 16:30:44 +0200
+ -- Frank Küster <frank at debian.org>  Wed,  4 Apr 2007 15:53:09 +0200
 
 tex-common (1.3) experimental; urgency=low
 

Modified: tex-common/trunk/scripts/FileUtils.pm
===================================================================
--- tex-common/trunk/scripts/FileUtils.pm	2007-04-04 12:06:25 UTC (rev 2629)
+++ tex-common/trunk/scripts/FileUtils.pm	2007-04-04 13:52:20 UTC (rev 2630)
@@ -1,4 +1,4 @@
-# $Id: //depot/Master/Tools/FileUtils.pm#17 $ $Date: 2005/06/02 $ $Author: karl $
+# $Id: FileUtils.pm 2402 2006-11-08 01:45:28Z karl $
 # Written 2004, Fabrice Popineau.
 # Public domain.
 # 
@@ -196,7 +196,7 @@
   my ($dir, $proc, $prune) = @_;
   my (@l, $f, $done, $src, $DIR);
 
-  warn " Walking $dir\n" if $::opt_debug;
+  #print " walking $dir with $proc, $prune\n" if $::opt_debug;
 
   if ((! $prune) || ($prune && ! &{$prune}($dir))) {
     $done = 0;
@@ -204,7 +204,7 @@
     opendir (DIR, $dir) || die "opendir($dir) failed: $!";
     while (my $d = readdir (DIR)) {
       # do not forget to remove "." and ".."
-      next if $d =~ /^\.\.?$/;
+      next if $d =~ /^\.(\.?|svn)$/;
       push (@l, $d);
     }
     closedir (DIR) || warn "closedir($dir) failed: $!";
@@ -588,10 +588,12 @@
   my ($file);
   $dir =~ s@\\@/@g;
   foreach $file (@l) {
-    next if $file =~ /^\.\.$/;
-    #print "    push $dir/$file\n" if $::opt_debug;
-    if (-f "$dir/$file") {
-      push @listglob, "$dir/$file";
+    next if $file =~ /^\.(\.?|svn)$/;
+    my $path = "$dir/$file";
+    next if $path =~ m/^${Tpm::IgnoredFiles}$/;
+    if (-f $path) {
+      #print "    push $dir/$file\n" if $::opt_debug;
+      push @listglob, $path;
     }
   }
 }
@@ -974,6 +976,16 @@
   return &FileUtils::tree2list($node);
 }
 
+# Print Perl backtrace, for debugging.
+sub backtrace {
+  my $subr;
+  my $stackframe = 0;
+  while (($pkg,$filename,$line,$subr) = caller ($stackframe)) {
+    print "$filename:$line: $pkg::$subr called\n";
+    $stackframe++;
+  }
+}
+
 END { }
 
 1;

Modified: tex-common/trunk/scripts/Tpm.pm
===================================================================
--- tex-common/trunk/scripts/Tpm.pm	2007-04-04 12:06:25 UTC (rev 2629)
+++ tex-common/trunk/scripts/Tpm.pm	2007-04-04 13:52:20 UTC (rev 2630)
@@ -1,4 +1,4 @@
-# $Id: //depot/Master/Tools/Tpm.pm#92 $ $Date: 2005/10/19 $ $Author: karl $
+# $Id: Tpm.pm 3719 2007-01-23 01:44:19Z karl $
 # Written 2004, Fabrice Popineau.
 # Public domain.
 # 
@@ -72,12 +72,16 @@
 @ArchList = (
 	     "alpha-linux",
 	     "alpha-osf",
+	     "hppa-hpux",
 	     "i386-darwin",
 	     "i386-freebsd",
 	     "i386-linux",
+	     "i386-openbsd",
+	     "i386-solaris",
 	     "mips-irix",
 	     "powerpc-aix",
 	     "powerpc-darwin",
+	     "powerpc-linux",
 	     "sparc-solaris",
 	     "sparc-linux",
 	     "win32",
@@ -101,93 +105,112 @@
 		       "TLCore/bin-windvi"
 		      );
 
-$IgnoredFiles = "(bin/i386-freebsd|bin/i386-openbsd|bin/i386-solaris|bin/mips-irix|bin/powerpc-aix|bin/powerpc-darwin|bin/sparc-solaris|bin/win32/TeXLive.exe|texmf/tpm/(collection-binaries|texlive|xemtex|scheme-.*|.*-static)\.tpm|texmf(-doc|-dist)?/(ls-R|aliases|lists/.*|README|tpm/tpm.dtd)|source/.*)";
+# this list is not up to date, therefore I think it is not needed.
+#  . "bin/i386-freebsd|bin/i386-openbsd|bin/i386-solaris|bin/mips-irix"
+#  . "|bin/powerpc-aix|bin/powerpc-darwin|bin/sparc-solaris"
 
+# used both to ignore whole tpm's (?) and individual files?
+# must match whole path
+$IgnoredFiles = "("
+  . 'source/.*'
+  . '|texmf/tpm/(collection-binaries|texlive|xemtex|scheme-.*|.*-static)\.tpm'
+  . '|texmf(-doc|-dist)?/(ls-R|aliases|lists/.*|README|tpm/tpm.dtd)'
+  . '|.*/\.svn.*'
+  . ")";
+
 # The so-called engines
-my @engines = ("aleph", "enctex", "eomega", "metafont", "metapost", "omega", "pdftex", "pdfetex", "tex", "vtex",
+my @engines = (
+               "aleph", "enctex", "eomega", "metafont", "metapost",
+               "omega", "pdftex", "pdfetex", "tex", "vtex", 
 	       "bibtex", "context", "dvipdfm", "dvips", "ispell",
 	       "makeindex","mft", "psutils", "tex4ht", "texdoctk",
 	       "ttf2pk");
 # The so called formats
 my @formats = (
 	       "alatex", "amstex", "context", "cslatex", "csplain", "enctex",
-	       "eplain", "fontinst", "generic", "jadetex", "lambda", "latex", "latex3",
+	       "eplain", "fontinst", "generic", "jadetex", "lambda",
+	       "latex", "latex3",
 	       "mex", "physe", "phyzzx", "plain", "psizzl", 
-	       "startex", "texinfo", "texsis", "xmltex", "ytex", );
+	       "startex", "texinfo", "texsis", "xetex", "xelatex",
+               "xmltex", "ytex", );
 # Kind of font files
 my @fonttypes = (
 		 "afm", "misc", "ofm", "opentype", "ovf", "ovp", "pfb",
-		 "pk", "sfd", "source", "tfm", "truetype", "type1", "vf"
+		 "pfm", "pk", "sfd", "source", "tfm", "truetype", "type1", "vf"
 		);
 # Font vendors
 my @vendors = (
-	       "adobe", "amsfonts", "archaic", "arphic",
+	       "adobe", "amsfonts", "arabi", "archaic", "arphic",
                "bakoma", "bh", "bitstrea", "bluesky",
-               "cg", ,"cns", "cspsfonts-adobe", 
+               "cg", "cns", "cspsfonts-adobe", "groff",
 	       "hoekwater", "ibm", "itc", "jknappen", "jmn", "korean", "lh",
-	       "misc", "monotype", "paragrap",
+	       "mathdesign", "misc", "monotype", "paragrap",
 	       "public", "uhc", "urw", "urw35vf", "vntex", "wadalab",
-	       "yandy");
+	       "xetex", "yandy");
 my @fontmodes = (
 		 "ljfour", "ljfive", "cx"
 		); 
-my @languages = ("bulgarian", "czechslovak", "dutch", "english",
+my @languages = ("bulgarian", "chinese", "czechslovak", "dutch", "english",
                  "finnish", "french", "general", 
 		 "german", "greek", "italian", "japanese", "korean",
 		 "mongolian",
 		 "polish", "portuguese", "russian", "slovak", "spanish",
-		 "thai", "ukrainian", "vietnamese");
+		 "thai", "turkish", "ukrainian", "vietnamese");
 
 my %dotfiles = (
 		"texmf-dist/tex/latex/tools/*" => ( "texmf-dist/tex/latex/tools/.tex" ),
 		"texmf/chktex/*" => ( "texmf/chktex/.chktexrc" )
 		);
 
-my $CatalogueDir = "/src/TeX/texcatalogue";
+my $CatalogueDir = "${MasterDir}/texmf-doc/doc/english/catalogue";
 my $Catalogue;
 
 #
+# %Tpm2Catalogue gives a mapping from tpm names to Catalogue entries
+#
 # missing entries
 # ? bengali:pandey
 # ? grotesq:urwvf
 # ? helvetic:urwvf
 # ? knuthotherfonts:halftone
 # makedtx:makedtx not working!
-# ? oberdiek:twoopt, tabularht, tabularkv, settobox, refcount, alphalph, chemarr, classlist, dvipscol, engord, hypbmsec, hypcap, ifdraft, ifpdf, ifvtexm pagesel, pdfcolmk pdfcrypt, pdflscape (somehing missing???)
+# ? oberdiek:twoopt, tabularht, tabularkv, settobox, refcount, alphalph, chemar
+# r, classlist, dvipscol, engord, hypbmsec, hypcap, ifdraft, ifpdf, ifvtexm pagese
+# l, pdfcolmk pdfcrypt, pdflscape (somehing missing???)
 my %Tpm2Catalogue = (
-	"ctib" => "ctib4tex",
-	"CJK" => "cjk",
-	"bayer" => "universa",
-	"bigfoot" => "suffix",
-	"cb" => "cbgreek",
-	"cd-cover" => "cdcover",
-	"cmex" => "cmextra",
-	"cs" => "csfonts", 
-	"cyrplain" => "t2",
-	"devanagr" => "devanagari",
-	"eCards" => "ecards",
-	"ESIEEcv" => "esieecv",
-	"euclide" => "pst-eucl",
-	"GuIT" => "guit",
-	"HA-prosper" => "prosper",
-	"ibycus" => "ibycus4",
-	"ibygrk" => "ibycus4",
-	"IEEEconf" => "ieeeconf",
-	"IEEEtran" => "ieeetran",
-	"iso" => "isostds",
-	"iso10303" => "isostds",
-	"jknapltx" => "jknappen",
-	"kastrup" => "binhex",
-	"le" => "frenchle",
-	"mathtime" => "mathtime-ltx",
-	"omega-devanagari" => "devanagari-omega",
-	"pdftexdef" => "pdftex-def",
-	"procIAGssymp" => "prociagssymp",
-	"resume" => "res",
-	"SIstyle" => "sistyle",
-	"SIunits" => "siunits",
-	"syntax" => "syntax2",
-	"Tabbing" => "tabbing" );
+      "ctib" => "ctib4tex",
+      "CJK" => "cjk",
+      "bayer" => "universa",
+      "bigfoot" => "suffix",
+      "cb" => "cbgreek",
+      "cd-cover" => "cdcover",
+      "cmex" => "cmextra",
+      "cs" => "csfonts", 
+      "cyrplain" => "t2",
+      "devanagr" => "devanagari",
+      "eCards" => "ecards",
+      "ESIEEcv" => "esieecv",
+      "euclide" => "pst-eucl",
+      "GuIT" => "guit",
+      "HA-prosper" => "prosper",
+      "ibycus" => "ibycus4",
+      "ibygrk" => "ibycus4",
+      "IEEEconf" => "ieeeconf",
+      "IEEEtran" => "ieeetran",
+      "iso" => "isostds",
+      "iso10303" => "isostds",
+      "jknapltx" => "jknappen",
+      "kastrup" => "binhex",
+      "le" => "frenchle",
+      "mathtime" => "mathtime-ltx",
+      "omega-devanagari" => "devanagari-omega",
+      "pdftexdef" => "pdftex-def",
+      "procIAGssymp" => "prociagssymp",
+      "resume" => "res",
+      "SIstyle" => "sistyle",
+      "SIunits" => "siunits",
+      "syntax" => "syntax2",
+      "Tabbing" => "tabbing" );
 
 my $Verbose = 0;
 
@@ -231,12 +254,9 @@
   my ($doc, $f) = @_;
 
   my %s = getTextField($doc, $f);
-  my $str = "";
-  if (defined($s{"text"})) {
-    $str = $s{"text"};
-  }
-  $str =~ s/^\n*//gmx;
-  $str =~ s/\n*$//gm;
+  my $str = $s{"text"};
+  $str =~ s/^\n*//;
+  $str =~ s/\n*$//;
   $str =~ s/\n/ /gomsx;
   @{$s{"text"}} = split(" ", $str);
   return %s;
@@ -408,7 +428,7 @@
   my $parser = new XML::DOM::Parser;
   chomp (my $user = `whoami`);  # for Creator field.
   my $doc = $parser->parse("\
-<!DOCTYPE rdf:RDF SYSTEM \"../../Tools/tpm.dtd\">\
+<!DOCTYPE rdf:RDF SYSTEM \"../../support/tpm.dtd\">\
 <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:TPM=\"http://texlive.dante.de/\">\
   <rdf:Description about=\"http://texlive.dante.de/texlive/tlcore/${name}.zip\">\
     <TPM:Name>${name}</TPM:Name>\
@@ -418,12 +438,12 @@
     <TPM:Creator>$user</TPM:Creator>\
     <TPM:Author></TPM:Author>\
     <TPM:Title>The ${name} package.</TPM:Title>\
-    <TPM:Size>864</TPM:Size>\
+    <TPM:Size>314</TPM:Size>\
     <TPM:Description></TPM:Description>\
     <TPM:Build>\
       <TPM:RunPatterns>${texmf}/tpm/${name}.tpm</TPM:RunPatterns>\
     </TPM:Build>\
-    <TPM:RunFiles size=\"679\">${texmf}/tpm/${name}.tpm</TPM:RunFiles>\
+    <TPM:RunFiles size=\"270\">${texmf}/tpm/${name}.tpm</TPM:RunFiles>\
     <TPM:Provides>${type}/${name}</TPM:Provides>\
   </rdf:Description>\
 </rdf:RDF>\
@@ -437,7 +457,7 @@
   my $parser = new XML::DOM::Parser;
 
   $doc = $parser->parse("<!DOCTYPE rdf:RDF\n\
-  SYSTEM \"../../Tools/tpm.dtd\">\n\
+  SYSTEM \"../../support/tpm.dtd\">\n\
 <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns\#\"\n\
  xmlns:TPM=\"http://texlive.dante.de/\">\n</rdf:RDF>\n");
 
@@ -535,7 +555,7 @@
   $node = $doc->createElement("TPM:Requires");
   my %requires = $self->getHash("Requires");
   if (%requires) {
-    foreach my $k (@TpmCategories) {
+    foreach my $k (sort @TpmCategories) {
       my @taglist = @{$requires{$k}};
       for my $tag (sort @taglist) {
         my $tpmbin = $doc->createElement("TPM:$k");
@@ -623,7 +643,9 @@
     foreach $v (@{$self->{$n}}) {
       if (($CurrentArch eq "all" && FileUtils::member(${$v}{"arch"}, @Tpm::ArchList))
 	  || ${$v}{"arch"} eq ${CurrentArch}) {
-        push @l, @{${$v}{"text"}};
+        my @val = @{${$v}{"text"}};
+	#print "getfilelist pushing for $v: @val\n";
+        push @l, @val;
       }
     }
   }
@@ -636,9 +658,13 @@
   }
 
   if (wantarray) {
+    #print "getfilelist($n) returning list: @l\n";
+    #&debug_hash ($n, $self->{$n});
+    #print "$n {text} = " . @{$n{text}} . "\n";
     return @l;
   }
   else {
+    #print "getfilelist($n) returning scalar: @l\n";
     if (@l) {
       return (join "\n", @l);
     }
@@ -1014,7 +1040,7 @@
   }
 }
 
-
+
 sub formatdate {
   return sprintf("%4d/%02d/%02d %02d:%02d:%02d", 
 	       $_[5]+1900, $_[4]+1, $_[3], $_[2], $_[1], $_[0]);
@@ -1046,49 +1072,74 @@
   return &formatdate(@mytime);
 }
 
+sub debug_date
+{
+  my ($str,$date) = @_;
+  #warn "$str " . &formatdate(gmtime($date)) . "\n";
+}
+
+# if any of FILES are newer than OLDDATE, return the newest mtime.
+# 
 sub max_date
 {
   my ($olddate, @files) = @_;
-  my ($f, $tpmdate);
-#  print "olddate was " . &formatdate(gmtime($oldate)) . "\n";
-  foreach $f (@files) {
-    if ($f =~ m@^texmf-dist/tpm/.*\.tpm@) {
-      $tpmdate = ${stat($f)}[9];
+  my $tpmdate = 0;
+  &debug_date ("  max_date files=@files, olddate=", $olddate);
+  for my $f (@files) {
+    # although the texmf/tpm/*.tpm files are mostly hand-maintained, it
+    # still seems best for the TPM:Date to reflect the newest date of
+    # the actual files in the package; the sizes and such might still
+    # get autoupdated.
+    if ($f =~ m,/tpm/.*\.tpm$,) {
+      $tpmdate = (stat("$MasterDir/$f"))[9];
+      &debug_date ("   tpm itself, found ", $tpmdate);
     }
-    else {
+    elsif (-f "$MasterDir/$f") {
       my @st = stat("$MasterDir/$f");
-#      print "file $f is " . &formatdate(gmtime($st[9])) . "\n";
+      &debug_date ("   file $f is ", $st[9]);
       if ($st[9] > $olddate) {
-#	print "replacing\n";
+	&debug_date ("    replacing olddate ", $olddate);
         $olddate = $st[9];
       }
     }
   }
-  if ($olddate == 0) {
+  if ($olddate == 0 && $tpmdate) {
+    &debug_date ("  max_date using tpm date", $tpmdate);
     $olddate = $tpmdate;
   }
-#  print "newdate is " . &formatdate(gmtime($oldate)) . "\n";
+  &debug_date ("  max_date returning ", $olddate);
   return $olddate;
 }
 
 sub fixDate {
   my ($self) = @_;
   my $newdate = 0;
-  foreach my $s (@{$self->getFileList("BinFiles")}) {
-    if ($CurrentArch eq "all" || $s =~ m@/${CurrentArch}/@) {
-      $newdate = &max_date($newdate, ${$s}{"text"});
-    }
+  my @binfiles = $self->getFileList("BinFiles");
+  #warn "binfiles=@binfiles";
+  if ($CurrentArch ne "all") {
+    @binfiles = grep { m@/${CurrentArch}/@ } @binfiles;
+    warn "arch-filtered for $CurrentArch binfiles=@binfiles";
   }
-#  print "#### newdate is " . &formatdate(gmtime($newdate)) . "\n";
-  $newdate = &max_date($newdate, $self->getFileList("RunFiles"));
-#  print "#### newdate is " . &formatdate(gmtime($newdate)) . "\n";
+  $newdate = &max_date($newdate, @binfiles);
+  &debug_date (" newdate after bin: ", $newdate);
+  #
   $newdate = &max_date($newdate, $self->getFileList("DocFiles"));
-#  print "#### newdate is " . &formatdate(gmtime($newdate)) . "\n";
+  &debug_date (" newdate after doc: ", $newdate);
+  #
   $newdate = &max_date($newdate, $self->getFileList("SourceFiles"));
+  &debug_date (" newdate after source: " , $newdate);
+  #
   $newdate = &max_date($newdate, $self->getFileList("RemoteFiles"));
+  &debug_date (" newdate after remote: " , $newdate);
+  #
+  # Check the RunFiles last, because it includes the tpm itself, and we
+  # only want to use that as a last resort.
+  $rundate = &max_date($newdate, $self->getFileList("RunFiles"));
+  &debug_date (" newdate after run: ", $newdate);
   $self->setAttribute("Date", &formatdate(gmtime($newdate)));
 }
 
+
 sub fixRequires {
   my ($self, $test) = @_;
 
@@ -1153,12 +1204,13 @@
   my $pkgname = $self->getAttribute("Name");
   $pkgname =~ s/^(bin-|lib-|tex-)//;
 
+  # handle several cases where the Catalogue name
+  # is not the package name...
   if (defined($Tpm2Catalogue{$pkgname})) {
     $pkgcat = $Tpm2Catalogue{$pkgname};
   } else {
     $pkgcat = $pkgname;
-  }
-  print STDERR "Looking for $pkgname (as $pkgcat) in the Catalogue.\n" if $Verbose;
+  }print STDERR "Looking for $pkgname (as $pkgcat) in the Catalogue.\n" if $Verbose;
   my $fletter = substr($pkgcat, 0, 1);
   my $catname = "${CatalogueDir}/entries/$fletter/${pkgcat}.xml"; 
   return if (! -f $catname);
@@ -1242,6 +1294,7 @@
   my @doc_patterns = ( );
   my @source_patterns = ( );
 
+  # 
   # Usually the package name and the directory name match.
   # Here are the special cases when they don't.
   if (&FileUtils::member(${name}, @engines)) {
@@ -1271,13 +1324,21 @@
 	( $texmf . "/fonts/map/${name}/base/*", $texmf . "/fonts/map/${name}/config/*",
 	  $texmf . "/fonts/enc/${name}/base/*", $texmf . "/fonts/enc/${name}/config/*" );
 
+    # exception for context doc, since everything belongs to context.tpm.
+    } elsif (${name} eq 'context') {
+      push (@doc_patterns, "$texmf/doc/context/*");
+
     # Exception for metapost !
     } elsif (${name} eq 'metapost') {
       push @run_patterns, $texmf . "/metapost/support/*";
 
-    # Exception for tex4ht !
+    # Exception for tex4ht, since we just want everything.
     } elsif (${name} eq 'tex4ht') {
-      push @run_patterns, $texmf . "/tex4ht/ht-fonts/*";
+      push @run_patterns,
+           ("$texmf/tex4ht/bin/*",
+            "$texmf/tex4ht/ht-fonts/*",
+            "$texmf/tex4ht/xttl/*",
+           );
 
     # Exception for omega !
     } elsif (${name} eq 'omega') {
@@ -1295,6 +1356,7 @@
 
     }
 
+  # 
   } elsif (&FileUtils::member(${name}, @formats)) {
     print "special format patterns for $name\n" if $::opt_debug;
     # if our $name is one of the formats
@@ -1303,62 +1365,74 @@
       push @run_patterns, (  $texmf . "/$e/${name}/base/*",
 			     $texmf . "/$e/${name}/config/*",
 			  );
-      push @run_patterns, $texmf . "/$e/${name}/*" if ($_ ne 'tex' && $_ ne 'omega');
+      push @run_patterns, $texmf . "/$e/${name}/*"
+        unless ($_ eq 'tex' || $_ eq 'omega')
     } @engines;
-    
+
     map {
       push @run_patterns, $texmf . "/tex/$_/${name}/*";
     } @formats;
 
+    # for xetex
+    push @run_patterns, "$texmf/fonts/misc/$name/*";
+    push @doc_patterns, ( $texmf . "/doc/$name/*" ) if $name eq "xetex";
+
     push @doc_patterns, ( $texmf . "/doc/${name}/base/*" );
 
     push @source_patterns, ( $texmf . "/source/${name}/base/*" );
 
-    # Exception for Context !
-    if (${name} eq 'context') {
-      push @run_patterns, $texmf . "/tex/context/*";
-
     # exception for texinfo since it has no subdirs.
-    } elsif (${name} eq 'texinfo') {
+    if (${name} eq 'texinfo') {
       push @run_patterns, $texmf . "/tex/texinfo/*";
 
+    # exception for eplain since it has no subdirs either.
+    } elsif (${name} eq 'eplain') {
+      push @run_patterns, "$texmf/tex/eplain/*";
+      push @doc_patterns, "$texmf/doc/eplain/*";
+      push @source_patterns, "$texmf/source/eplain/*";
+
     # Exception for fontinst, since it has lots of subdirs, including misc.
     # cyrfinst is really a separate package, but let's not clean that up now.
     } elsif (${name} eq 'fontinst') {
       push @run_patterns, $texmf . "/tex/fontinst/*/*";
     }
     
+  # 
   } elsif (&FileUtils::member(${name}, @vendors)) {
     print "special vendor patterns for $name\n" if $::opt_debug;
     push @run_patterns, $texmf . "/dvips/${name}/*";
     
-    map { push @run_patterns, $texmf . "/fonts/$_/${name}/*"; } @fonttypes;
+    if ($name eq "groff") {
+      # Exception for groff: we do not want subdirectories (e.g.,
+      # times), we only want actual files (psyrgo.tfm).  Let groff/times
+      # end up in times.tpm.
+      map { push @run_patterns, "$texmf/fonts/$_/${name}/*.*"; }
+      @fonttypes;      
+    } else {
+      # Everything but groff:
+      map { push @run_patterns, "$texmf/fonts/$_/${name}/*"; }
+      @fonttypes;
+    }
 
     map { 
       my $e = $_;
       map {
 	push @run_patterns, $texmf . "/$e/$_/${name}/*"
-          unless $name eq "misc" && $_ eq "fontinst";
-            # keep fontinst/misc in fontinst.
+            # keep fontinst/misc in fontinst:
+          unless ($name eq "misc" && $_ eq "fontinst");
       } @formats;
     } @engines;
     
-    # Exception for amsfonts -- te/staw decided in June 2005 to use ams
-    # for the directory name within fonts, but amsfonts elsehwere.
-    if (${name} eq 'amsfonts') {
-      push @run_patterns, 
-	( $texmf . "/dvips/ams/config.*",
-	  $texmf . "/fonts/map/*/ams/*",
-	  $texmf . "/fonts/*/bluesky/ams/*",
-	  $texmf . "/fonts/*/public/ams/*",
-	);
-      push @source_patterns,
-        ( $texmf . "/source/latex/amsfonts/*" );
-     }
+    # Exception for lh: also have source/latex/lh.
+    push @source_patterns, ( $texmf . "/source/latex/$name/*" );  # lh
     
-    # Exception for vntex -- doc is in doc/generic instead of doc/fonts.
+    # Exception for mathdesign: doc is in doc/latex instead of doc/fonts.
+    push @doc_patterns, ( $texmf . "/doc/latex/$name/*" );  # mathdesign
+
+    # Exception for vntex: doc is in doc/generic instead of doc/fonts.
     push @doc_patterns, ( $texmf . "/doc/generic/$name/*" );  # vntex
 
+  # 
   } else {
     print "normal patterns for $name\n" if $::opt_debug;
     map {
@@ -1367,13 +1441,19 @@
       push @doc_patterns, $texmf . "/doc/$e/${name}/*";
       push @source_patterns, $texmf . "/source/$e/${name}/*";
       map {
-	push @run_patterns, $texmf . "/$e/$_/${name}/*";
+	push @run_patterns, $texmf . "/$e/$_/${name}/*"
+	  # keep tex/context/pgf in context.
+	  unless $name eq "pgf" && $_ eq "context" && $e eq "tex";
       } @formats;
+      #warn "run_patterns after engine $e = @run_patterns\n";
+    } @engines;
 
-    } @engines;
-    
     map {
-      push @run_patterns, $texmf . "/tex/$_/${name}/*";
+      push @run_patterns, $texmf . "/tex/$_/${name}/*"
+        # keep tex/context/pgf in context.
+	unless $name eq "pgf" && $_ eq "context";
+      #warn "run_patterns after format $_ = @run_patterns\n";
+
       push @doc_patterns, $texmf . "/doc/$_/${name}/*";
       push @source_patterns, $texmf . "/source/$_/${name}/*";
     } @formats;
@@ -1381,12 +1461,15 @@
     push @doc_patterns, $texmf . "/doc/${name}/*";
     push @source_patterns, $texmf . "/source/${name}/*";
     
-    # one more special case, fontname has its own odd map files.
+    # Exceptions for fontname and glyphlist: their own odd map files.
     if ($name eq 'fontname') {
-      push @run_patterns, $texmf . "/fonts/map/${name}/*";
+      push @run_patterns, "$texmf/fonts/map/${name}/*";
+    } elsif ($name eq 'glyphlist') {
+      push @run_patterns, "$texmf/fonts/map/${name}/*";
     }
   }
   
+  #  common to all.
   map {
     my $v = $_;
     map {
@@ -1426,6 +1509,7 @@
   push @source_patterns, $texmf . "/source/fonts/${name}/*";
   push @run_patterns, $texmf. "/tpm/$name.tpm";
   
+  #warn "final run_patterns for $name: @run_patterns\n";
   $self->setList("RunPatterns", @run_patterns);
   $self->setList("DocPatterns", @doc_patterns);
   $self->setList("SourcePatterns", @source_patterns);
@@ -1668,7 +1752,7 @@
 }
 
 sub Clean {
-  my ($self, $patterns, $fixreq, $newdir) = @_;
+  my ($self, $patterns, $fixreq) = @_;
 
   # Update the Date to the date of the latest file in the package
   $self->fixDate();
@@ -1717,24 +1801,10 @@
 
   # Alternatively you could expand patterns if for example you have just edited them
   # See the 'process2_tpm' function below
-  # If newdir is not set or it is a direcory
-  $outfname = "";
-  if ($newdir) {
-    if (!(-e $newdir)) {
-      `mkdir -p $newdir`;
-    }
-    if (!(-d $newdir)) {
-      print "ERROR: $newdir is not a directory, not writing tpm file!\n"; 
-      return;
-    }
-    $outfname = "$newdir/" . ${Tpm::TexmfTreeOfType}{$type} . "/tpm/$name.tpm";
-    $dn = &FileUtils::dirname($outfname);
-    `mkdir -p $dn`;
-  }
   # Test that patterns and files list are n sync
   if ($self->testSync()) {
-    print "Writing $type/$name $outfname\n";
-    $self->writeFile($outfname);
+    print "Writing $type/$name\n";
+    $self->writeFile();
   }
   else {
     print "ERROR: out of sync between patterns and files in $tpmname (not written).\n";
@@ -1779,4 +1849,26 @@
   } $self->getAllFileList();
 }
 
+
+# Log LABEL followed by hash elements, all on one line.
+#
+sub debug_hash
+{
+  my ($label) = shift;
+  my (%hash) = (ref $_[0] && $_[0] =~ /.*HASH.*/) ? %{$_[0]} : @_;
+
+  my $str = "$label: {";
+  my @items = ();
+  for my $key (sort keys %hash) {
+    my $val = $hash{$key};
+    $key =~ s/\n/\\n/g;
+    $val =~ s/\n/\\n/g;
+    push (@items, "$key:$val");
+  }
+  $str .= join (",", @items);
+  $str .= "}";
+
+  print "$str\n";
+}
+
 1;




More information about the Debian-tex-commits mailing list