summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoeyh <joeyh>2007-04-20 17:41:58 +0000
committerjoeyh <joeyh>2007-04-20 17:41:58 +0000
commitd21d3fea239cae53fbd0ff8a24e9580ff5060384 (patch)
treeadf662dc07e6e880f94634a7e3992cd13c038ea4
parent7e41b73a4ba707bce3c84f0c6d9f6f826ed0e37e (diff)
r1997: * dh_installwm: Fix several stupid bugs, including:
- man page handling was supposed to be v6 only and was not - typo in alternatives call - use the basename of the wm to get the man page name Closes: #420158 * dh_installwm: Also make the code to find the man page more robust and fall back to not registering a man page if it is not found.
-rw-r--r--autoscripts/postinst-wm2
-rw-r--r--autoscripts/postinst-wm-noman4
-rw-r--r--debhelper.pod4
-rw-r--r--debian/changelog12
-rwxr-xr-xdh_installwm23
5 files changed, 37 insertions, 8 deletions
diff --git a/autoscripts/postinst-wm b/autoscripts/postinst-wm
index d47aefab..ee636287 100644
--- a/autoscripts/postinst-wm
+++ b/autoscripts/postinst-wm
@@ -2,5 +2,5 @@ if [ "$1" = "configure" ]; then
update-alternatives --install /usr/bin/x-window-manager \
x-window-manager #WM# #PRIORITY# \
--slave /usr/share/man/man1/x-window-manager.1.gz \
- x-window-manager /usr/share/man/man1/#WM#.1.gz
+ x-window-manager.1.gz #WMMAN#
fi
diff --git a/autoscripts/postinst-wm-noman b/autoscripts/postinst-wm-noman
new file mode 100644
index 00000000..aef412a3
--- /dev/null
+++ b/autoscripts/postinst-wm-noman
@@ -0,0 +1,4 @@
+if [ "$1" = "configure" ]; then
+ update-alternatives --install /usr/bin/x-window-manager \
+ x-window-manager #WM# #PRIORITY#
+fi
diff --git a/debhelper.pod b/debhelper.pod
index b13dbcdc..0fe76f17 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -367,7 +367,9 @@ fragements in reverse order for the prerm and postrm scripts.
=item -
-dh_installwm will install a slave manpage link for x-window-manager.1.gz.
+dh_installwm will install a slave manpage link for x-window-manager.1.gz,
+if it sees the man page in usr/share/man/man1 in the package build
+directory.
=item -
diff --git a/debian/changelog b/debian/changelog
index 060167c9..ef9805c5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+debhelper (5.0.49) UNRELEASED; urgency=low
+
+ * dh_installwm: Fix several stupid bugs, including:
+ - man page handling was supposed to be v6 only and was not
+ - typo in alternatives call
+ - use the basename of the wm to get the man page name
+ Closes: #420158
+ * dh_installwm: Also make the code to find the man page more robust and
+ fall back to not registering a man page if it is not found.
+
+ -- Joey Hess <joeyh@debian.org> Fri, 20 Apr 2007 13:29:39 -0400
+
debhelper (5.0.48) unstable; urgency=low
* Remove use of #SECTION# from dh_installinfo postinst snippet
diff --git a/dh_installwm b/dh_installwm
index 1989056d..ebe6d1e2 100755
--- a/dh_installwm
+++ b/dh_installwm
@@ -18,8 +18,8 @@ B<dh_installwm> [S<I<debhelper options>>] [B<-n>] [B<--priority=>I<n>] [S<I<wm .
dh_installwm is a debhelper program that is responsible for
generating the postinst and postrm commands that register a window manager
with L<update-alternatives(8)>. The window manager's man page is also
-registered as a slave symlink (in v6 mode and up), and is assumed to be
-located in /usr/share/man/man1/<wm>.1.gz.
+registered as a slave symlink (in v6 mode and up), if it is found in
+usr/share/man/man1/ in the package build directory.
Any window manager programs specified as parameters will be registered in
the first package dh_installwm is told to act on. By default, this is the
@@ -73,7 +73,7 @@ if (@ARGV) {
}
foreach my $package (@{$dh{DOPACKAGES}}) {
-# my $tmp=tmpdir($package);
+ my $tmp=tmpdir($package);
my $file=pkgfile($package,"wm");
my @wm;
@@ -86,9 +86,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
if (! $dh{NOSCRIPTS}) {
- foreach (@wm) {
- autoscript($package,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",);
- autoscript($package,"prerm","prerm-wm","s:#WM#:$_:");
+WM: foreach my $wm (@wm) {
+ autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:");
+
+ my $wmman;
+ if (! compat(5)) {
+ foreach my $ext (".1", ".1x") {
+ $wmman="/usr/share/man/man1/".basename($wm).$ext;
+ if (-e "$tmp$wmman" || -e "$tmp$wmman.gz") {
+ autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:;s:#WMMAN#:$wmman.gz:;s/#PRIORITY#/$dh{PRIORITY}/",);
+ next WM;
+ }
+ }
+ }
+ autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:;s/#PRIORITY#/$dh{PRIORITY}/",);
}
}
}