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