X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_installxfonts;h=25e073bcd94e26044dbcf70732bf40f7659a4117;hb=d687f06403910b86076e821b52ad7a444a781e39;hp=d1ced88e0d2b2eead4958fb9fc1565ae8f800fd5;hpb=f57a9a0f741a3d249e9b025fab9bb417f0c3e5e6;p=debhelper.git diff --git a/dh_installxfonts b/dh_installxfonts index d1ced88..25e073b 100755 --- a/dh_installxfonts +++ b/dh_installxfonts @@ -30,8 +30,9 @@ update-fonts-* commands are available. (This program adds that dependency to ${misc:Depends}.) This program automatically generates the postinst and postrm commands needed -to register X fonts. See L for an explanation of how this -works. +to register X fonts. These commands are inserted into the maintainer +scripts by dh_installdeb. See L for an explanation of how +this works. =head1 NOTES @@ -50,8 +51,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # Find all font directories in the package build directory. my @fontdirs; - foreach my $parentdir ("$tmp/usr/X11R6/lib/X11/fonts/", "$tmp/usr/share/fonts/X11/") { - opendir DIR, $parentdir || next; + foreach my $parentdir ("$tmp/usr/share/fonts/X11/") { + opendir(DIR, $parentdir) || next; @fontdirs = grep { -d "$parentdir/$_" && !/^\./ } (readdir DIR); closedir DIR; } @@ -60,26 +61,27 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # Figure out what commands the postinst and postrm will need # to call. my @cmds; + my @cmds_postinst; + my @cmds_postrm; 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 --x11r7-layout $f"; - push @cmds, "update-fonts-alias $f" - if -f "$tmp/etc/X11/fonts/$f/$package.alias"; + if (-f "$tmp/etc/X11/fonts/$f/$package.alias") { + push @cmds_postinst, "update-fonts-alias --include /etc/X11/fonts/$f/$package.alias $f"; + push @cmds_postrm, "update-fonts-alias --exclude /etc/X11/fonts/$f/$package.alias $f"; + addsubstvar($package, "misc:Depends", "xfonts-utils (>= 1:7.5+2)"); + } } autoscript($package, "postinst", "postinst-xfonts", - "s:#CMDS#:".join(";", @cmds).":;"); + "s:#CMDS#:".join(";", @cmds, @cmds_postinst).":"); autoscript($package, "postrm", "postrm-xfonts", - "s:#CMDS#:".join(";", @cmds).":;"); + "s:#CMDS#:".join(";", @cmds, @cmds_postrm).":"); addsubstvar($package, "misc:Depends", "xfonts-utils"); } - else { - # remove - addsubstvar($package, "misc:Depends", "xfonts-utils", "", 1); - } } =head1 SEE ALSO