[subversion-commit] SVN tetex-base commit + diffs: r1144 - tetex-base/trunk/debian

Frank Küster frank at costa.debian.org
Thu Mar 30 12:45:28 UTC 2006


Author: frank
Date: 2006-03-30 12:45:27 +0000 (Thu, 30 Mar 2006)
New Revision: 1144

Modified:
   tetex-base/trunk/debian/tpm2licenses-new.pl
Log:
let Emacs reindent everything consistently

Modified: tetex-base/trunk/debian/tpm2licenses-new.pl
===================================================================
--- tetex-base/trunk/debian/tpm2licenses-new.pl	2006-03-30 12:43:55 UTC (rev 1143)
+++ tetex-base/trunk/debian/tpm2licenses-new.pl	2006-03-30 12:45:27 UTC (rev 1144)
@@ -47,8 +47,8 @@
     if ( -r "$cfgDir/$cfgName" ) {
 	print STDERR "Using configuration file $cfgDir/$cfgName\n";
 	$config->file("$cfgDir/$cfgName");
-    };
-};
+      };
+  };
 # now parse commandline
 $config->getopt();
 
@@ -70,14 +70,14 @@
 # $what = $opt_what;
 
 if ($debian_package) {
-    die "Unknown Debian package: $debian_package." unless
-	( $debian_package =~ /^tetex-base$/    || 
-	  $debian_package =~ /^tetex-src$/     ||
-	  $debian_package =~ /^texlive-base$/  ||
-	  $debian_package =~ /^texlive-extra$/ ||
-	  $debian_package =~ /^texlive-lang$/  ||
-	  $debian_package =~ /^texlive-doc$/   ||
-	  $debian_package =~ /^texlive-bin$/     );
+  die "Unknown Debian package: $debian_package." unless
+      ( $debian_package =~ /^tetex-base$/    || 
+	$debian_package =~ /^tetex-src$/     ||
+	$debian_package =~ /^texlive-base$/  ||
+	$debian_package =~ /^texlive-extra$/ ||
+	$debian_package =~ /^texlive-lang$/  ||
+	$debian_package =~ /^texlive-doc$/   ||
+	$debian_package =~ /^texlive-bin$/     );
 };
 
 my $TpmGlobalPath = $Master;
@@ -104,46 +104,46 @@
 require XML::DOM;
 require FileUtils;
 import FileUtils qw(canon_dir cleandir make_link newpath member
-	normalize substitute_var_val diff_list remove_list
-	rec_rmdir sync_dir walk_dir start_redirection stop_redirection);
+		    normalize substitute_var_val diff_list remove_list
+		    rec_rmdir sync_dir walk_dir start_redirection stop_redirection);
 require Tpm;
 #
 # what the hell, how do I import this array from Tpm.pm ???
 #
 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 $parser = new XML::DOM::Parser;
 my $startdir=getcwd();
@@ -186,13 +186,13 @@
       my $tpmFullname;
       if ( -f "texmf/tpm/" . $_ ) {
 	$tpmFullname = "texmf/tpm/" . $_
-      }
+	  }
       elsif ( -f "texmf-dist/tpm/" . $_ ) {
 	$tpmFullname = "texmf-dist/tpm/" . $_
-      }
+	  }
       elsif ( -f "texmf-doc/tpm/" . $_ ) {
 	$tpmFullname = "texmf-doc/tpm/" . $_
-      }
+	  }
       else {
 	print STDERR "Could not find $_\n";
 	exit 1;
@@ -203,75 +203,75 @@
 };
 
 sub list_licenses {
-   foreach $LocalTPM (@TpmList) {
-      $licline = "";
-      $bn = &basename($LocalTPM,".tpm");
-      if (defined($Tpm2Catalogue{$bn})) {
-        $pkgcat = $Tpm2Catalogue{$bn};
-      } else {
-        $pkgcat = $bn;
-      }
-      $licline .= "$bn: ";
-      my $fletter = substr($pkgcat, 0, 1);
-      my $catname = "${Catalogue}/entries/$fletter/${pkgcat}.xml";
+  foreach $LocalTPM (@TpmList) {
+    $licline = "";
+    $bn = &basename($LocalTPM,".tpm");
+    if (defined($Tpm2Catalogue{$bn})) {
+      $pkgcat = $Tpm2Catalogue{$bn};
+    } else {
+      $pkgcat = $bn;
+    }
+    $licline .= "$bn: ";
+    my $fletter = substr($pkgcat, 0, 1);
+    my $catname = "${Catalogue}/entries/$fletter/${pkgcat}.xml";
+    if (! -r $catname) {
+      $catname = "$tpmdir/${pkgcat}.xml";
       if (! -r $catname) {
-	  $catname = "$tpmdir/${pkgcat}.xml";
-	  if (! -r $catname) {
-	      $licline .= "not-in-catalogue";
-	      unless ($nocatalogue || $pkgcat =~ m/^individual.*/) {
-		  print "$licline\n";
-		  next;
-	      };
+	$licline .= "not-in-catalogue";
+	unless ($nocatalogue || $pkgcat =~ m/^individual.*/) {
+	  print "$licline\n";
+	  next;
+	};
 # 	  } else {
 # 	      print STDERR "found ${pkgcat}.xml in $tpmdir\n";
-	  };
+      };
+    }
+    my $ltype;
+    unless ($nocatalogue  || $pkgcat =~ m/^individual.*/) { 
+      #don't try to parse the xml file if we don't have a catalogue
+      my $cat = $parser->parsefile($catname);
+      my ($version, $lversion, $lchecked, $luser, $lfile);
+      $node = $cat->getElementsByTagName("version")->item(0);
+      if ($node) {
+	$version = $node->getAttribute("number");
       }
-      my $ltype;
-      unless ($nocatalogue  || $pkgcat =~ m/^individual.*/) { 
-              #don't try to parse the xml file if we don't have a catalogue
-	  my $cat = $parser->parsefile($catname);
-	  my ($version, $lversion, $lchecked, $luser, $lfile);
-	  $node = $cat->getElementsByTagName("version")->item(0);
-	  if ($node) {
-	      $version = $node->getAttribute("number");
-	  }
-	  $node = $cat->getElementsByTagName("license")->item(0);
-	  if ($node) {
-	      # ok we have a license entry in there
-	      $ltype = $node->getAttribute("type");
-	      $lversion = $node->getAttribute("version");
-	      $lchecked = $node->getAttribute("checked");
-	      $luser = $node->getAttribute("username");
-	      $lfile = $node->getAttribute("file");
-	  }
-	  if ("$lversion$lchecked$luser" eq "") {
-	      if ("$ltype" eq "") {
-		  $licline .= "unknown";
-	      } else {
-		  $licline .= "$ltype (unverified)";
-		  # we know the license, it makes sense to output the files
-		  $printfiles = '1';
-	      }
-	  } else {
-	      $version ||= ''; # make sure we have no uninitialized string values
-	      $lversion ||= '';
-	      $licline .= "$ltype (verification data:$version:$lversion:$lchecked:$luser:$lfile)";
-	      $printfiles = '1';
-	  }
+      $node = $cat->getElementsByTagName("license")->item(0);
+      if ($node) {
+	# ok we have a license entry in there
+	$ltype = $node->getAttribute("type");
+	$lversion = $node->getAttribute("version");
+	$lchecked = $node->getAttribute("checked");
+	$luser = $node->getAttribute("username");
+	$lfile = $node->getAttribute("file");
       }
-      if ( $pkgcat =~ m/^individual.*/ ) {
-	$ltype = $pkgcat;
-	$ltype =~ s/individual_(.*)/$1/;
-	$licline = "$pkgcat $ltype (verification data:::::header)";
+      if ("$lversion$lchecked$luser" eq "") {
+	if ("$ltype" eq "") {
+	  $licline .= "unknown";
+	} else {
+	  $licline .= "$ltype (unverified)";
+	  # we know the license, it makes sense to output the files
+	  $printfiles = '1';
+	}
+      } else {
+	$version ||= ''; # make sure we have no uninitialized string values
+	$lversion ||= '';
+	$licline .= "$ltype (verification data:$version:$lversion:$lchecked:$luser:$lfile)";
 	$printfiles = '1';
-      };
-      $what eq "license" && print "$licline\n";
-      # we know the license, it makes sense to output the files
-      $what eq "files" && ($printfiles || $nocatalogue) && printFiles($LocalTPM,$licline);
+      }
     }
+    if ( $pkgcat =~ m/^individual.*/ ) {
+      $ltype = $pkgcat;
+      $ltype =~ s/individual_(.*)/$1/;
+      $licline = "$pkgcat $ltype (verification data:::::header)";
+      $printfiles = '1';
+    };
+    $what eq "license" && print "$licline\n";
+    # we know the license, it makes sense to output the files
+    $what eq "files" && ($printfiles || $nocatalogue) && printFiles($LocalTPM,$licline);
+  }
 
 
-sub printFiles {
+  sub printFiles {
     my ($LocalTPM,$licline)= @_;
     my $pkg_header = "% " . $licline;
     my $dom_parser = new XML::DOM::Parser;
@@ -281,14 +281,14 @@
     my %DocFiles = Tpm::getListField($doc, "DocFiles");
 
     foreach ($RunFiles{"text"}, $DocFiles{"text"}, $SourceFiles{"text"}) { 
-        # this is already done in Tpm.pm, why isn't that sufficient?
-	$_ =~ s/^\n*// ;
-	# remove the texmf-dist/ we don't need
-	$_ =~ s at texmf-dist/@@g;
-        # make sure there's exactly one newline at the end
-	chomp;
-	$_ =~ s/$/\n/ ;
-	};
+      # this is already done in Tpm.pm, why isn't that sufficient?
+      $_ =~ s/^\n*// ;
+      # remove the texmf-dist/ we don't need
+      $_ =~ s at texmf-dist/@@g;
+      # make sure there's exactly one newline at the end
+      chomp;
+      $_ =~ s/$/\n/ ;
+    };
 
     # we don't want the tpm file which isn't installed
     $RunFiles{"text"} =~ s/\n.*\.tpm$//m;
@@ -299,57 +299,57 @@
 
     for ($debian_package) {
       my @texmfPath;
-	if ( /^texlive/ ) { 
-	  @texmfPath = ("texmf","texmf-dist","texmf-doc");
-	  foreach ($RunFiles{"text"}, $DocFiles{"text"}, $SourceFiles{"text"}) {
-		my @filelist = split(/\n/m,$_);
-		next if (! @filelist);
-		foreach (@filelist) {CheckFileExistence($_,\@texmfPath)};
-	    };
-
-	    MergeDirectories(\@RunFiles,\@texmfPath);
-	    MergeDirectories(\@DocFiles,\@texmfPath) if (@DocFiles);
-	    MergeDirectories(\@SourceFiles,\@texmfPath) if (@SourceFiles);
-   	    print "\n";
-	    print $pkg_header . "\n @RunFiles @DocFiles @SourceFiles";
+      if ( /^texlive/ ) { 
+	@texmfPath = ("texmf","texmf-dist","texmf-doc");
+	foreach ($RunFiles{"text"}, $DocFiles{"text"}, $SourceFiles{"text"}) {
+	  my @filelist = split(/\n/m,$_);
+	  next if (! @filelist);
+	  foreach (@filelist) {CheckFileExistence($_,\@texmfPath)};
 	};
-	if ( /^tetex-base$/ ) {
-   	    @texmfPath = (".");
-	    foreach ($RunFiles{"text"}, $DocFiles{"text"}) {
-		my @filelist = split(/\n/m,$_);
-		next if (! @filelist);
-		foreach (@filelist) {CheckFileExistence($_,\@texmfPath)};
-	    };
 
-	    MergeDirectories(\@RunFiles,\@texmfPath);
-	    MergeDirectories(\@DocFiles,\@texmfPath) if (@DocFiles);
-   	    print "\n";
-	    print $pkg_header . "\n @RunFiles @DocFiles";
+	MergeDirectories(\@RunFiles,\@texmfPath);
+	MergeDirectories(\@DocFiles,\@texmfPath) if (@DocFiles);
+	MergeDirectories(\@SourceFiles,\@texmfPath) if (@SourceFiles);
+	print "\n";
+	print $pkg_header . "\n @RunFiles @DocFiles @SourceFiles";
+      };
+      if ( /^tetex-base$/ ) {
+	@texmfPath = (".");
+	foreach ($RunFiles{"text"}, $DocFiles{"text"}) {
+	  my @filelist = split(/\n/m,$_);
+	  next if (! @filelist);
+	  foreach (@filelist) {CheckFileExistence($_,\@texmfPath)};
 	};
-	if ( /^tetex-src$/ ) {
-   	    @texmfPath = (".");
-	    foreach ($SourceFiles{"text"}) {
-		my @filelist = split(/\n/m,$_);
-		foreach (@filelist) {CheckFileExistence($_,\@texmfPath)};
-	    };
 
-	    MergeDirectories(\@SourceFiles,\@texmfPath);
-   	    print "\n";
-	    print $pkg_header . "\n @SourceFiles" unless (! @SourceFiles);
+	MergeDirectories(\@RunFiles,\@texmfPath);
+	MergeDirectories(\@DocFiles,\@texmfPath) if (@DocFiles);
+	print "\n";
+	print $pkg_header . "\n @RunFiles @DocFiles";
+      };
+      if ( /^tetex-src$/ ) {
+	@texmfPath = (".");
+	foreach ($SourceFiles{"text"}) {
+	  my @filelist = split(/\n/m,$_);
+	  foreach (@filelist) {CheckFileExistence($_,\@texmfPath)};
 	};
+
+	MergeDirectories(\@SourceFiles,\@texmfPath);
+	print "\n";
+	print $pkg_header . "\n @SourceFiles" unless (! @SourceFiles);
+      };
     };
-}
+  }
 
-sub CheckFileExistence {
+  sub CheckFileExistence {
     my ($file, at texmfPath) = ($_[0],@{$_[1]});
     my $found = 0;
     foreach my $texmfDir (@texmfPath) {
       -f $texmfDir . "/" . $file && ($found =1);
     };
     print STDERR "$file: Does not exist!\n" if ! $found;
-}
+  }
 
-sub MergeDirectories {
+  sub MergeDirectories {
     my ($filelist, at texmfPath) = ($_[0],@{$_[1]}); # $filelist is actually a pointer
     
     # create a list of dirnames, and remove duplicates
@@ -363,31 +363,31 @@
 
     my %DirComplete = map { $_, 1 } @dirnames;
     for (@dirnames) {
-	my $dirname = $_;
-	my $fullDir;
-	my $rootDir;
-	for (@texmfPath) {
-	  if ( -d ( $_ . "/" . $dirname )) { 
-	    $rootDir = $_;
-	    $fullDir =  ( $_ . "/" . $dirname );
-	  };
+      my $dirname = $_;
+      my $fullDir;
+      my $rootDir;
+      for (@texmfPath) {
+	if ( -d ( $_ . "/" . $dirname )) { 
+	  $rootDir = $_;
+	  $fullDir =  ( $_ . "/" . $dirname );
 	};
-	$fullDir or die "This should not happen: no directory $dirname, nowhere.";
-	my  @InstalledFiles = `find $fullDir -maxdepth 1 -type f 2>/dev/null | grep -v tetex` 
-	      or die "Calling find for $dirname, expanded to $fullDir, failed.";
-	for (@InstalledFiles) {
-	  chomp;
-	  s@^$rootDir/@@;
-	  $DirComplete{$dirname} = 0 unless $SearchHash{$_};
+      };
+      $fullDir or die "This should not happen: no directory $dirname, nowhere.";
+      my  @InstalledFiles = `find $fullDir -maxdepth 1 -type f 2>/dev/null | grep -v tetex` 
+	  or die "Calling find for $dirname, expanded to $fullDir, failed.";
+      for (@InstalledFiles) {
+	chomp;
+	s@^$rootDir/@@;
+	$DirComplete{$dirname} = 0 unless $SearchHash{$_};
+      };
+      if ( $DirComplete{$dirname} ) {
+	for (@{$filelist} ) {
+	  # replace the file by its directory name
+	  s@$dirname/.*@$dirname/*@;
 	};
-	if ( $DirComplete{$dirname} ) {
-	  for (@{$filelist} ) {
-	    # replace the file by its directory name
-	    s@$dirname/.*@$dirname/*@;
-	  };
-	};
-# 	print STDERR "Directory $_ is $DirComplete{$dirname}\n";
       };
+# 	print STDERR "Directory $_ is $DirComplete{$dirname}\n";
+    };
 
     # now the complete directories occur multiple times, remove duplicates again
     %UniqueHash = map { ("$_\n" , 1) } @{$filelist} ;
@@ -395,15 +395,5 @@
     
   }
 
-#   foreach $LocalTPM (<./texmf-doc/tpm/*.tpm>) {
-#      my $dat = $parser->parsefile($LocalTPM);
-#      if (defined($dat->getElementsByTagName("TPM:License")) &&
-#          defined($dat->getElementsByTagName("TPM:License")->item(0)) &&
-#	  defined($dat->getElementsByTagName("TPM:License")->item(0)->getFirstChild)) {
-#	  print &basename($LocalTPM,".tpm"), "\t", $dat->getElementsByTagName("TPM:License")->item(0)->getFirstChild->toString, "\n";
-#      } else {
-#          print &basename($LocalTPM,".tpm"), "\tnon-in-catalogue\n";
-#      }
-#   }
 }
 




More information about the Pkg-tetex-commits mailing list