]> git.donarmstrong.com Git - debhelper.git/commitdiff
r1997: * dh_installwm: Fix several stupid bugs, including:
authorjoeyh <joeyh>
Fri, 20 Apr 2007 17:41:58 +0000 (17:41 +0000)
committerjoeyh <joeyh>
Fri, 20 Apr 2007 17:41:58 +0000 (17:41 +0000)
  - 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
autoscripts/postinst-wm-noman [new file with mode: 0644]
debhelper.pod
debian/changelog
dh_installwm

index d47aefab7e6df9799a70b8ff3a13b5bad7e2420e..ee636287af06639d2e2fc7485ba1325f21a73a24 100644 (file)
@@ -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 (file)
index 0000000..aef412a
--- /dev/null
@@ -0,0 +1,4 @@
+if [ "$1" = "configure" ]; then
+       update-alternatives --install /usr/bin/x-window-manager \
+               x-window-manager #WM# #PRIORITY#
+fi
index b13dbcdce93c08bd36c8e99b0fee3ae8388b231f..0fe76f1734f9884005f66d78ce2178b3cd6cdc03 100644 (file)
@@ -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 -
 
index 060167c96becbd69c49080616d5c16b9b3068bdc..ef9805c50862fbdec51adbd66cc07a1e636b9d59 100644 (file)
@@ -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
index 1989056d0296cbc0da9cb777d5c8c997beaf12a9..ebe6d1e2f096e3db9386157cdfd95ec36ba8216e 100755 (executable)
@@ -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}/",);
                }
        }
 }