]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_installxfonts
r579: updates
[debhelper.git] / dh_installxfonts
index f8d9d4692853dc988882a99f7b5778ac0fdf5913..984144b474d6d67e0a7832bccd657e7db9cf093c 100755 (executable)
@@ -26,9 +26,10 @@ install them into the correct location under etc/X11/fonts in your package
 build directory.
 
 Your package should should depend on xutils (>= 4.0.3) so that the
-update-fonts-* commands are available.
+update-fonts-* commands are available. (This program adds that dependency to
+${misc:Depends}.)
 
-This programt automatically generates the postinst and postrm commands needed
+This program automatically generates the postinst and postrm commands needed
 to register X fonts.  See L<dh_installdeb(1)> for an explanation of how this
 works.
 
@@ -58,24 +59,30 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                # to call.
                my @cmds;
                foreach my $f (@fontdirs) {
+                       # This must come before update-fonts-dir.
+                       push @cmds, "update-fonts-scale $f"
+                               if -f "$tmp/etc/X11/fonts/$f/$package.scale";
                        push @cmds, "update-fonts-dir $f";
                        push @cmds, "update-fonts-alias $f"
                                if -f "$tmp/etc/X11/fonts/$f/$package.alias";
-                       # This must come _before_ mkfontdir, thus the unshift.
-                       unshift @cmds, "update-fonts-scale $f"
-                               if -f "$tmp/etc/X11/fonts/$f/$package.scale";
                }
 
                autoscript($package, "postinst", "postinst-xfonts",
-                       "s:#CMDS#:".join("\n", @cmds).":;");
+                       "s:#CMDS#:".join(";", @cmds).":;");
                autoscript($package, "postrm", "postrm-xfonts",
-                       "s:#CMDS#:".join("\n", @cmds).":;");
+                       "s:#CMDS#:".join(";", @cmds).":;");
+
+               addsubstvar($package, "misc:Depends", "xutils", ">= 4.0.3");
+       }
+       else {
+               # remove
+               addsubstvar($package, "misc:Depends", "xutils", ">= 4.0.3", 1);
        }
 }
 
 =head1 SEE ALSO
 
-L<debhelper(1)>
+L<debhelper(7)>
 
 This program is a part of debhelper.