[Debian-tex-commits] SVN tex-common commit + diffs: r2495 - tex-common/trunk/scripts

Frank Küster frank at alioth.debian.org
Tue Feb 20 14:41:32 CET 2007


Author: frank
Date: 2007-02-20 14:41:31 +0100 (Tue, 20 Feb 2007)
New Revision: 2495

Modified:
   tex-common/trunk/scripts/dh_installtex
Log:
- use doit() for the linking
- respect $dh{ONLYSCRIPTS}


Modified: tex-common/trunk/scripts/dh_installtex
===================================================================
--- tex-common/trunk/scripts/dh_installtex	2007-02-20 13:05:20 UTC (rev 2494)
+++ tex-common/trunk/scripts/dh_installtex	2007-02-20 13:41:31 UTC (rev 2495)
@@ -450,9 +450,10 @@
 		if ($pkgfileoncmdline && ($pkgprovidedfile || ($#cmdlinearguments >= 0))) {
 			error("This call would create multiple copies of $priority$package.$configfileext{$_}.\nPlease read the man page on how this should be fixed!\n");
 		}
+
         	if ( ! -d "$tmp/etc/texmf/$configdir{$type}/") {
 			doit("install","-d","$tmp/etc/texmf/$configdir{$type}/");
-        	}
+        	} unless ($dh{ONLYSCRIPTS});
 		#
 		# the cmd line cfg files
 		#
@@ -460,6 +461,7 @@
 			$bn=basename($_);
 			$pr=$cmdlinefilespriority{$type}{$_};
 			$dofilen = "$tmp/etc/texmf/$configdir{$type}/$pr$bn";
+		      WRITECMDLINECFGFILE: do {
 			-r $dofilen &&
 				error("The config file $dofilen already exists! Cannot recreate it, please call dh_clean -k!");
 			open(CFGFILE, ">$dofilen") ||
@@ -480,12 +482,13 @@
 			close(CFGFILE);
 			$bn =~ s/\.$configfileext{$type}$//;
 			push @listlines, "$pr$bn";
+		      } unless ($dh{ONLYSCRIPTS});
 		}
 		#
 		# now debian/package.maps and/or debian/maps formats languages
 		# merge in the cmd line arguments
 		#
-		if ($pkgprovidedfile || ($#cmdlinearguments >= 0)) {
+		if ( ! $dh{ONLYSCRIPTS} && ( $pkgprovidedfile || ($#cmdlinearguments >= 0) )) {
 			$dofilen = "$tmp/etc/texmf/$configdir{$type}/$priority$package.$configfileext{$type}";
 			-r $dofilen && 
 				error("The config file $dofilen already exists! Cannot recreate it, please call dh_clean -k!");
@@ -510,12 +513,12 @@
 			}
 			close(CFGFILE);
 			push @listlines, "$priority$package";
-		}
-		
+		} unless ($dh{ONLYSCRIPTS});
+
+	      WRITELISTFILE: do {
         	if ( ! -d "$tmp/var/lib/tex-common/$managedir{$type}/") {
             		doit("install","-d","$tmp/var/lib/tex-common/$managedir{$type}/");
-        	}
-		$dofilen = "$tmp/var/lib/tex-common/$managedir{$type}/$package.list";
+        	}		$dofilen = "$tmp/var/lib/tex-common/$managedir{$type}/$package.list";
 		open(LISTFILE, ">>$dofilen")||
 			error("Cannot open $dofilen for writing/appending!");
 		verbose_print("Writing $dofilen");
@@ -523,8 +526,8 @@
 			print LISTFILE "$_\n";
 		}
 		close(LISTFILE);
+	      }  unless ($dh{ONLYSCRIPTS});
 	}
-
 	
 	my @mapdata = ();
 	if (defined($data{"map"})) {
@@ -532,11 +535,11 @@
 	}
 	if ($#mapdata >= 0) {
 		doit("install","-d","$tmp/usr/share/texmf/dvips/config/");
-	}
+	} unless ($dh{ONLYSCRIPTS});
 	foreach $i (@mapdata) {
-		my $f = $i;
-		$f =~ s/\.map$//;
-		$dofilen = "$tmp/usr/share/texmf/dvips/config/config.$f";
+		my $font = $i;
+		$font =~ s/\.map$//;
+		$dofilen = "$tmp/usr/share/texmf/dvips/config/config.$font";
 		-r $dofilen &&
 			error("The dvips config file $dofilen already exists!\nYou may have to call dh_clean -k!\n");
 		open(CNFFILE, ">$dofilen") ||
@@ -544,23 +547,26 @@
 		verbose_print("Writing $dofilen");
 		print CNFFILE "p +$i\n";
 		close(CNFFILE);
-	}
+        } unless ($dh{ONLYSCRIPTS});
 
 	my @fmtpairs = ();
 	my @fmtdata = ();
 	if (defined($data{"format"})) {
 		@fmtpairs = @{$data{"format"}};
 	}
-	foreach my $ab (@fmtpairs) {
-		$ab =~ m/^(.*)\t(.*)$/;
-		push @fmtdata, $1;
+	foreach my $pair (@fmtpairs) {
+		my ($format,$engine) = $pair =~ m/^(.*)\t(.*)$/;
+		push @fmtdata, $format;
 		if ($doformatlinks) {
-			# the following should be done in a
-			# better way!!!!!!!!!!!!!!!!!!!!!!!
-			# but it is too late ...
-			`ln -s $2 $tmp/usr/bin/$1`
+		  my $formatlink = "$tmp/usr/bin/$format";
+		  if ( -e $formatlink ) {
+		    warning("/usr/bin/$format already exists, skipping");
+		  } else {
+		    doit("ln","-s","$engine",$formatlink);
+		  };
 		}
-	}
+	} unless ($dh{ONLYSCRIPTS});
+
 	if ($#addbuildformats >= 0) {
 		push @fmtdata, @addbuildformats;
 	}




More information about the Debian-tex-commits mailing list