]> git.donarmstrong.com Git - debhelper.git/blob - dh_installwm
r397: horribly broke everything I touched :-)
[debhelper.git] / dh_installwm
1 #!/usr/bin/perl -w
2 #
3 # Add to postinst and postrm to register a window manager.
4
5 use Debian::Debhelper::Dh_Lib;
6 init();
7
8 if (! defined $dh{PRIORITY}) {
9         $dh{PRIORITY}=20;
10 }
11
12 if (@ARGV) {
13         # This is here for backwards comatability. If the filename doesn't
14         # include a path, assume it's in /usr/X11R6/bin.
15         if ($ARGV[0] !~ m:/:) {
16                 $ARGV[0]="/usr/X11R6/bin/$ARGV[0]";
17         }
18 }
19
20 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
21         $TMP=tmpdir($PACKAGE);
22         $file=pkgfile($PACKAGE,"wm");
23
24         if ($file) {
25                 @wm=filearray($file, $TMP);
26         }
27
28         if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
29                 push @wm, @ARGV;
30         }
31
32         if (@wm && ! $dh{NOSCRIPTS}) {
33                 foreach (@wm) {
34                         autoscript($PACKAGE,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",);
35                         autoscript($PACKAGE,"postrm","postrm-wm","s:#WM#:$_:");
36                 }
37         }
38 }
39