Author: preining-guest
Date: 2005-10-15 22:27:29 +0000 (Sat, 15 Oct 2005)
New Revision: 235

Modified:
   dh-installtexfonts/trunk/dh_installtexfonts
Log:
implement cmd line arguments with map type, and variable priority


Modified: dh-installtexfonts/trunk/dh_installtexfonts
===================================================================
--- dh-installtexfonts/trunk/dh_installtexfonts 2005-10-15 22:02:35 UTC (rev 
234)
+++ dh-installtexfonts/trunk/dh_installtexfonts 2005-10-15 22:27:29 UTC (rev 
235)
@@ -11,7 +11,7 @@
 
 =head1 SYNOPSIS
 
-B<dh_installtexfonts> [S<I<debhelper options>>]
+B<dh_installtexfonts> [S<I<debhelper options>>] [B<-o>I<order>] [S<I<maptype 
mapfile ...>>]
 
 =head1 DESCRIPTION
 
@@ -22,10 +22,29 @@
 update-* commands are available. (This program adds that dependency to
 ${misc:Depends}.)
 
+The map files to be registered can be specified in two ways. A file named
+debian/package.maps can list lines which go into the updmap.d cfg file
+as is. So you have to include the full lines including the Map type.
+Map files can also specified as parameters, the parameters always have to
+come in pairs, first a map type, then a map file (without path). These maps
+will only be included in the package of the first package dh_link is told
+to act on. By default, this is the first binary package in debian/control,
+but if you use -p, -i, or -a flags, it will be the first package specified
+by those flags.
+
 This program automatically generates the postinst and postrm commands needed
 to register TeX fonts.  See L<dh_installdeb(1)> for an explanation of how this
 works.
 
+=head1 OPTIONS
+
+=over 4
+
+=item B<-o>I<order>, B<--order=>I<order>
+
+Instead of using the default ordering at 10 for the updmap-config file,
+use the order specified after the -o parameter.
+
 =head1 NOTES
 
 See Debian TeX policy, section 4.1.1. for details about doing fonts for TeX 
@@ -38,8 +57,12 @@
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
        my $file=pkgfile($package,"maps");
+       my $order=10;
+       my @maps;
 
-       my @maps;
+       if (defined($dh{O_PARAMS}) && $dh{O_PARAMS} ne '') {
+               $order=$dh{O_PARAMS};
+       }
        if ($file) {
                open(FOO, "<$file") || error("$file cannot be opened.");
                @maps = <FOO>;
@@ -47,17 +70,24 @@
                chomp @maps;
        }
        if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
-               push @maps, @ARGV;
+               if (int($#ARGV/2) eq $#ARGV/2) {
+                       error("parameters must come in maptype mapfile pairs.");
+               }
+               while (@ARGV) {
+                       my $maptype = pop @ARGV;
+                       my $mapfile = pop @ARGV;
+                       push @maps, "$maptype mapfile";
+               }
        }
 
 
         if ( ! -d "$tmp/etc/texmf/updmap.d/") {
             doit("install","-d","$tmp/etc/texmf/updmap.d/");
         }
-       open(CFGFILE, ">$tmp/etc/texmf/updmap.d/50$package.cfg") || 
-               error("Cannot open $tmp/etc/texmf/updmap.d/10$package.cfg for 
writing!");
+       open(CFGFILE, ">$tmp/etc/texmf/updmap.d/$order$package.cfg") || 
+               error("Cannot open $tmp/etc/texmf/updmap.d/$order$package.cfg 
for writing!");
        print CFGFILE <<EOF;
-# 50$package.cfg
+# $order$package.cfg
 # You can change/add entries to this file and changes will be preserved
 # over upgrades, even if you have removed the main package prior
 # (not if you purged it). YOu should leave the following pseudo comment
@@ -74,7 +104,7 @@
         }
        open(LISTFILE, ">$tmp/var/lib/tex-common/fontmap-cfg/$package.list")||
                error("Cannot open 
$tmp/var/lib/tex-common/fmtutil-cnf/$package.list for writing!");
-       print LISTFILE "50$package";
+       print LISTFILE "$order$package";
        close(LISTFILE);
 
        autoscript($package, "postinst", "postinst-texfonts", "");
@@ -87,8 +117,6 @@
 
 L<debhelper(7)>
 
-This program is till now not a part of debhelper.
-
 =head1 AUTHOR
 
 Norbert Preining <[EMAIL PROTECTED]>


_______________________________________________
Pkg-tetex-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-tetex-commits

Reply via email to