[subversion-commit] SVN tetex-base commit + diffs: r1429 -
tetex-base/trunk/debian
Frank Küster
frank at costa.debian.org
Wed Jun 14 15:10:25 UTC 2006
Author: frank
Date: 2006-06-14 15:10:23 +0000 (Wed, 14 Jun 2006)
New Revision: 1429
Modified:
tetex-base/trunk/debian/searchbase35
Log:
work on searchbase35
Modified: tetex-base/trunk/debian/searchbase35
===================================================================
--- tetex-base/trunk/debian/searchbase35 2006-06-14 15:10:09 UTC (rev 1428)
+++ tetex-base/trunk/debian/searchbase35 2006-06-14 15:10:23 UTC (rev 1429)
@@ -20,8 +20,18 @@
my @fontlist =
("zapfding");
-my $psnfssRequiredPattern = "urw/base35|lw35nfs|freenfss|charter/bch";
+my %psnfssRequired = (
+ Title => "%% Required PSNFSS fonts",
+ Pattern => "urw/base35|lw35nfs|freenfss|charter/bch",
+ Filename =>"psnfss-required.txt",
+ ListName => "",
+ Comment =>
+"% These files are required for psnfss
+% according to its file 00readme.txt"
+);
+my @categories = (\%psnfssRequired);
+
my $tpmDir = "texmf-dist/tpm/";
my $CTANmirror = "ftp://cam.ctan.org/tex-archive/";
@@ -88,6 +98,10 @@
my %CTANbyname = map { basename($_), $_ } @CTANbyname;
+my %AllFilesList; # a hash containing references to the lists
+my %SortedFilesList;
+my %RestFileList;
+
# functions
sub getLicensePerArchive {
my $file = basename($_[0]);
@@ -140,14 +154,8 @@
}
}
-# open (OUTLIST,'>', $outfile_base . ".list") or die "Cannot open $outfile_base.list";
-my %AllFilesList; # a hash containing references to the lists
-my %RequiredFilesList;
-my %RestFileList;
-
-
-# main loop
-foreach my $font (@fontlist) {
+sub CreateAllFilesList {
+ my $font = $_[0];
my $LocalTPM = $tpmDir . $font . ".tpm";
my $dom_parser = new XML::DOM::Parser;
@@ -185,36 +193,58 @@
$locline = $locline
? $basefile . "\t" . $locline . "\n"
: $basefile . "\t\t unknown\t license: unknown\n" ;
-# print OUTLIST $locline ;
+
push @{$AllFilesList{$font}}, $locline;
} # end foreach (@Files)
+}
- # now sort files...
- my @RequiredFilesList;
- foreach (@{$AllFilesList{$font}}) {
- push @{$RequiredFilesList{$font}},$_ if ( m($psnfssRequiredPattern) );
+sub SortFileLists {
+ my $font = $_[0];
+
+ @{$RestFileList{$font}} = @{$AllFilesList{$font}};
+ foreach $category (@categories) {
+ # push each matching line onto the category's list
+ foreach (@{$RestFileList{$font}}) {
+ push @{$RequiredFilesList{$font}},$_ if ( m($psnfssRequired{Pattern}) );
+ }
+
+ # now note which lines are in both lists
+ my %HowOftenHash = ();
+ foreach my $line ( @{$RestFileList{$font}}, @{$RequiredFilesList{$font}} ) {
+ $HowOftenHash{$line}++
+ };
+
+ # empty RestFileList and fill it again with the lines that have count 1
+ @{$RestFileList{$font}} = ();
+ foreach my $line ( keys %HowOftenHash ) {
+ push @{$RestFileList{$font}}, $line unless ( $HowOftenHash{$line} > 1 );
+ };
}
- @{$RestFileList{$font}} = ();
- my %HowOftenHash = ();
+}
- foreach my $line ( @{$AllFilesList{$font}}, @{$RequiredFilesList{$font}} ) {
- $HowOftenHash{$line}++
- };
- foreach my $line ( keys %HowOftenHash ) {
- push @{$RestFileList{$font}}, $line unless ( $HowOftenHash{$line} > 1 );
- };
+# main sorting loop
+foreach my $font (@fontlist) {
+ CreateAllFilesList ($font);
- print @{$RestFileList{$font}};
+ # now sort files...
+ SortFileLists($font);
};
+# main output loop
+foreach my $category ( @categories ) {
+ 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) {
+ print OUTLIST "\n% files from $font:\n";
+ print OUTLIST @{$RequiredFilesList{$font}};
+ };
+ close OUTLIST;
+ print "Wrote ${$category}{Filename}.\n"
+};
+
exit 0;
__END__
-
-
-
-
-# print @RequiredFilesList;
-# print @AllFilesList;
More information about the Pkg-tetex-commits
mailing list