[subversion-commit] SVN tetex-base commit + diffs: r1453 -
tetex-base/trunk/debian
Frank Küster
frank at costa.debian.org
Thu Jun 22 17:32:49 UTC 2006
Author: frank
Date: 2006-06-22 17:32:47 +0000 (Thu, 22 Jun 2006)
New Revision: 1453
Modified:
tetex-base/trunk/debian/searchbase35
Log:
- now the output is even nicer, and string lengths can be easily configured
- added some types of files
Modified: tetex-base/trunk/debian/searchbase35
===================================================================
--- tetex-base/trunk/debian/searchbase35 2006-06-22 17:27:42 UTC (rev 1452)
+++ tetex-base/trunk/debian/searchbase35 2006-06-22 17:32:47 UTC (rev 1453)
@@ -14,31 +14,71 @@
my $ly1min_archive = "/home/frank/area/ly1-min.zip";
my $outfile_base = "psnfss";
+my @fontlist =
+ ("avantgar", "bookman", "charter", "courier", "helvetic", "ncntrsbk",
+ "palatino", "symbol", "times", "zapfchan", "zapfding");
# my @fontlist =
-# ("avantgar", "bookman", "charter", "courier", "helvetic", "ncntrsbk",
-# "palatino", "symbol", "times", "zapfchan", "zapfding");
-my @fontlist =
- ("zapfding");
+# ("zapfding");
my %psnfssRequired = (
Title => "%% Required PSNFSS fonts",
Pattern => "urw/base35|lw35nfs|freenfss|charter/bch",
Filename =>"psnfss-required.txt",
ListName => "required",
+ Lengths => "15,40,15,30",
Comment =>
"% These files are required for psnfss
% according to its file 00readme.txt"
+ );
+
+# obsolete stuff
+my %URWdirectaccess = (
+ Title => "%% files to directly access URW fonts",
+ Pattern => "tex/latex/.*\.fd|urw35vf|config\.u|u..\.map",
+ Filename =>"psnfss-urwdirect.txt",
+ ListName => "URWdirect",
+ Lengths => "15,14,40,30",
+ Comment =>
+"% These files can be used to directly access the URW fonts in
+% LaTeX. This should not be done if the same fonts are also
+% used as a replacement for the base 35 fonts.
+%
+% Ralf suspects that they once could be found in
+% CTAN/fonts/psfonts/urw/."
);
-# string lengths
-my %Length;
-$Length{BaseFile} = 15;
-$Length{FileWithPath} = 40;
-$Length{Zipfile} = 15;
-$Length{License} = 30;
+# external stuff
+my %PCLnfss = (
+ Title => "%% Font metrics for PCL printer fonts",
+ Pattern => "pclnfss",
+ Filename =>"psnfss-pclnfss.txt",
+ ListName => "pclnfss",
+ Lengths => "15,40,1,30",
+ Comment =>
+"% These files can be used to create PCL printer files
+% and are only useful if one has a PCL printer and a
+% corresponding screen viewer.
+%
+% They should be merged with other pclnfss files on CTAN into a
+% pclnfss.tpm and included in collection-fontsextra."
+);
-my @categories = (\%psnfssRequired);
+my %NoCategory = (
+ Title => "%% Files with no category",
+ Pattern => "",
+ Filename =>"psnfss-nocategory.txt",
+ ListName => "nocategory",
+ Lengths => "15,40,1,30",
+ Comment =>
+"% These files have not yet been classified"
+ );
+
+my $noCTAN = "no hit on CTAN";
+
+
+my @categories = (\%psnfssRequired, \%URWdirectaccess, \%PCLnfss);
+
my $tpmDir = "texmf-dist/tpm/";
my $CTANmirror = "ftp://cam.ctan.org/tex-archive/";
@@ -108,6 +148,7 @@
my %AllFilesList; # a hash containing references to the lists, by font
my %SortedFilesList; # a hash containing references to files sorted by origin (and font)
my %RestFileList; # by font
+my $format = "%-*s\t%-*s\t%-*s\t%-*s\n";
# functions
sub getLicensePerArchive {
@@ -141,14 +182,7 @@
my $zipfile = basename($CTANarchive{$archive}{zipfile});
my $license;
$license = getLicensePerArchive($CTANarchive{$archive}{zipfile});
- my $format = "%-*s\t%-*s\t%-*s\t%-*s\n";
- $ReturnLine = sprintf
- $format,
- $Length{BaseFile}, $basename,
- $Length{FileWithPath}, $hit,
- $Length{Zipfile}, $zipfile,
- $Length{License}, $license
- ;
+ $ReturnLine = $basename ."@". $hit ."@". $zipfile ."@". $license;
return($ReturnLine);
}
}
@@ -164,14 +198,7 @@
my $zipfile = basename($CTANarchive{$archive}{zipfile});
my $license;
$license = getLicensePerArchive($CTANarchive{$archive}{zipfile});
- my $format = "%-*s\t%-*s\t%-*s\t%-*s\n";
- $ReturnLine = sprintf
- $format,
- $Length{BaseFile}, $basename,
- $Length{FileWithPath}, $hit,
- $Length{Zipfile}, " ",
- $Length{License}, $license
- ;
+ $ReturnLine = $basename ."@". $hit ."@". $zipfile ."@". $license ;
return($ReturnLine);
}
}
@@ -204,14 +231,7 @@
if ($CTANbyname{$basefile}) {
my $license;
$license = getLicenseFromList($CTANbyname{$basefile});
- my $format = "%-*s\t%-*s\t%-*s\t%-*s\n";
- $locline = sprintf
- $format,
- $Length{BaseFile}, $basefile,
- $Length{FileWithPath}, $CTANbyname{$basefile},
- $Length{Zipfile}, " ",
- $Length{License}, $license
- ;
+ $locline = $basefile ."@". $CTANbyname{$basefile} ."@". " " ."@". "license: unknown";
last FINDLOC
}
# now look in some other archives
@@ -219,55 +239,82 @@
$locline = $loc;
last FINDLOC
}
+ # still no hit
+ $locline = $basefile ."@". $noCTAN ."@". $file ."@". "license: unknown";
}
# prepend the filename
$locline = $locline ? $locline
: $basefile . "\t\t unknown\t license: unknown\n" ;
+ # some standard replacements to make lines shorter
+ $locline =~ s at macros/latex/contrib/@m/l/c/@;
+ $locline =~ s at texmf-dist/@@;
+
push @{$AllFilesList{$font}}, $locline;
+
} # end foreach (@Files)
}
sub SortFileLists {
my $font = $_[0];
- @{$RestFileList{$font}} = @{$AllFilesList{$font}};
+ @{$SortedFilesList{${NoCategory}{ListName}}{$font}} = @{$AllFilesList{$font}};
foreach my $category (@categories) {
# push each matching line onto the category's list
- foreach (@{$RestFileList{$font}}) {
+ foreach (@{$SortedFilesList{${NoCategory}{ListName}}{$font}}) {
push @{$SortedFilesList{${$category}{ListName}}{$font}},$_ if ( m(${$category}{Pattern}) );
}
# now note which lines are in both lists
my %HowOftenHash = ();
- foreach my $line ( @{$RestFileList{$font}}, @{$SortedFilesList{${$category}{ListName}}{$font}} ) {
+ foreach my $line ( @{$SortedFilesList{${NoCategory}{ListName}}{$font}}, @{$SortedFilesList{${$category}{ListName}}{$font}} ) {
$HowOftenHash{$line}++
};
- # empty RestFileList and fill it again with the lines that have count 1
- @{$RestFileList{$font}} = ();
+ # empty the nocategory list and fill it again with the lines that have count 1
+ @{$SortedFilesList{${NoCategory}{ListName}}{$font}} = ();
foreach my $line ( keys %HowOftenHash ) {
- push @{$RestFileList{$font}}, $line unless ( $HowOftenHash{$line} > 1 );
+ push @{$SortedFilesList{${NoCategory}{ListName}}{$font}}, $line unless ( $HowOftenHash{$line} > 1 );
};
}
}
+sub CreateOutList {
+ my ($category, $font) = @_;
+ my $filenumber = 0;
+ foreach (@{$SortedFilesList{${$category}{ListName}}{$font}}) {
+ my @wordlist = split /@/;
+ my @LengthsList = split (m/,/, ${$category}{Lengths});
+ my @sprintflist;
+ my $NumElement = 0;
+ foreach my $element (@wordlist) {
+ push @sprintflist, $LengthsList[$NumElement], $element;
+ $NumElement++;
+ }
+ $_ = sprintf $format, @sprintflist;
+ };
+
+};
+
+
# main sorting loop
foreach my $font (@fontlist) {
CreateAllFilesList ($font);
# now sort files...
- SortFileLists($font);
+ SortFileLists($font);
};
# main output loop
-foreach my $category ( @categories ) {
+foreach my $category ( @categories, \%NoCategory ) {
open (OUTLIST,'>', ${$category}{Filename} ) or die "Cannot open ${$category}{Filename}";
print OUTLIST "\n\n" . ${$category}{Title} . "\n";
print OUTLIST "\n" . ${$category}{Comment} . "\n";
foreach my $font ( @fontlist) {
+ next unless (@{$SortedFilesList{${$category}{ListName}}{$font}});
print OUTLIST "\n% files from $font:\n";
+ CreateOutList ( $category, $font);
print OUTLIST @{$SortedFilesList{${$category}{ListName}}{$font}};
};
close OUTLIST;
More information about the Pkg-tetex-commits
mailing list