From d21d3fea239cae53fbd0ff8a24e9580ff5060384 Mon Sep 17 00:00:00 2001 From: joeyh Date: Fri, 20 Apr 2007 17:41:58 +0000 Subject: 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. --- autoscripts/postinst-wm | 2 +- autoscripts/postinst-wm-noman | 4 ++++ debhelper.pod | 4 +++- debian/changelog | 12 ++++++++++++ dh_installwm | 23 +++++++++++++++++------ 5 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 autoscripts/postinst-wm-noman 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 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 [S>] [B<-n>] [B<--priority=>I] [S. 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/.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}/",); } } } -- cgit v1.2.3