[subversion-commit] SVN tetex commit + diffs: r269 - tex-common/trunk/scripts

Norbert Preining preining-guest at costa.debian.org
Tue Oct 18 15:27:06 UTC 2005


Author: preining-guest
Date: 2005-10-18 15:27:06 +0000 (Tue, 18 Oct 2005)
New Revision: 269

Modified:
   tex-common/trunk/scripts/dh_installtexfonts
Log:
optional priorities to cfg files on cmdline are possible, so
	dh_installtexfonts Map=foo.map foo.cfg=42 bar.cfg 


Modified: tex-common/trunk/scripts/dh_installtexfonts
===================================================================
--- tex-common/trunk/scripts/dh_installtexfonts	2005-10-18 15:16:06 UTC (rev 268)
+++ tex-common/trunk/scripts/dh_installtexfonts	2005-10-18 15:27:06 UTC (rev 269)
@@ -11,7 +11,7 @@
 
 =head1 SYNOPSIS
 
-B<dh_installtexfonts> [S<I<debhelper options>>] [B<--priority=>I<n>] [S<I<maptype=mapfile ...>>] [S<I<cfg-file ...>>] 
+B<dh_installtexfonts> [S<I<debhelper options>>] [B<--priority=>I<n>] [S<I<maptype=mapfile ...>>] [S<I<cfg-file[=I<n>] ...>>] 
 
 =head1 DESCRIPTION
 
@@ -23,9 +23,11 @@
 ${misc:Depends}.)
 
 Registering map files for TeX can be done in the following ways:
-1) You can specify cfg files on the cmd line. These cfg files will be 
-installed into etc/texmf/updmap.d/ with the standard priority 10 (but
-see below) and their original name (foo.cfg installs into 10foo.cfg).
+1) You can specify cfg files on the cmd line, optionally providing a 
+priority by affixing =n to it. These cfg files will be 
+installed into etc/texmf/updmap.d/ with the specified priority, if present,
+or with the standard priority 10 (but see below) and their original name 
+(foo.cfg installs into 10foo.cfg, bar.cfg=42 installs into 42bar.cfg).
 
 2) You can specify map lines on the cmdline, where the map type and the
 map files is connected with =. These map lines are stored in a cfg file
@@ -41,7 +43,8 @@
 
 The command line maps (Variant 2) are merged into the debian/package.maps 
 file and the merged file is installed as 10package.cfg. If you specify 
-an additional package.cfg (Variant 1) on the cmd line, this will raise
+an additional package.cfg (Variant 1) without a different priority then
+the standard one on the cmd line, this will raise
 an error since both files would be installed as 10package.cfg. You can
 only specify package.cfg on the cmd line if no debian/package.maps nor any
 cmd line Map files are present.
@@ -93,6 +96,7 @@
 	my $priority=10;
 	my @pkgcfg;
 	my @cmdlinemaps;
+	my %cmdcfgshash;
 	my @cmdlinecfgs;
 	my $pkgfileoncmdline = 0;
 	my @listlines;
@@ -109,18 +113,21 @@
 		foreach my $entry (@ARGV) {
 			if ($entry =~ m/^(Map|MixedMap)=(.*)$/) {
 				push @cmdlinemaps, "$1 $2";
-			} elsif ($entry =~ m/\.cfg$/) {
-				my $bn=basename($entry);
-				if ($entry eq "$package.cfg") {
+			} elsif ($entry =~ m/^(.*\.cfg)(=([[:digit:]]+))?$/) {
+				my $fn=$1;
+				my $pr= ($3 eq "")?$priority:$3;
+				my $bn=basename($fn);
+				if ($bn eq "$package.cfg" && $pr == $priority) {
 					$pkgfileoncmdline = 1;
 				}
-				push @cmdlinecfgs, $entry;
+				$cmdcfgshash{$fn}=$pr;
 			} else {
-				error("$entry is neither of the form Map=filename.map, MixedMap=filename.map, or filename.cfg.");
+				error("$entry is neither of the form Map=filename.map, MixedMap=filename.map, or filename.cfg(=priority).");
 			}
 		}
 	}
 
+	@cmdlinecfgs = keys(%cmdcfgshash);
 	if (!$file && ($#cmdlinemaps < 0) && ($#cmdlinecfgs < 0)) {
 		# we have nothing to do here, skip to the next one!
 		next;
@@ -136,20 +143,21 @@
 	#
 	# the cmd line cfg files
 	#
-	foreach my $cfg (@cmdlinecfgs) {
-		my $bn=basename($cfg);
-		open(CFGFILE, ">$tmp/etc/texmf/updmap.d/$priority$bn") ||
-			error("Cannot open $tmp/etc/texmf/updmap.d/$priority$bn for writing!");
-		if (!magic_comment_present($cfg)) {
-			print CFGFILE "# $priority$bn\n";
+	foreach my $fn (@cmdlinecfgs) {
+		my $bn=basename($fn);
+		my $pr=$cmdcfgshash{$fn};
+		open(CFGFILE, ">$tmp/etc/texmf/updmap.d/$pr$bn") ||
+			error("Cannot open $tmp/etc/texmf/updmap.d/$pr$bn for writing!");
+		if (!magic_comment_present($fn)) {
+			print CFGFILE "# $pr$bn\n";
 			print CFGFILE $magicheader;
 		}
-		open(FOO,"<$cfg") || error("Cannot open $cfg for reading!");
+		open(FOO,"<$fn") || error("Cannot open $fn for reading!");
 		while (<FOO>) { print CFGFILE $_; }
 		close(FOO);
 		close(CFGFILE);
 		$bn =~ s/\.cfg$//;
-		push @listlines, "$priority$bn";
+		push @listlines, "$pr$bn";
 	}
 	#
 	# now debian/package.maps and/or debian/maps




More information about the Pkg-tetex-commits mailing list