]> git.donarmstrong.com Git - debhelper.git/commitdiff
r1980: * prerm and postrm scripts are now generated in a reverse order than
authorjoeyh <joeyh>
Mon, 9 Apr 2007 19:31:44 +0000 (19:31 +0000)
committerjoeyh <joeyh>
Mon, 9 Apr 2007 19:31:44 +0000 (19:31 +0000)
  preinst and postinst scripts. For example, if a package uses
  dh_pysupport before dh_installinit, the prerm will first stop the init
  script and then remove the python files.
* Introducing beginning of v6 mode.
* dh_installwm: In v6 mode, install a slave manpage link for
  x-window-manager.1.gz. Done in v6 mode because some window managers
  probably work around this longstanding debhelper bug by registering the
  slave on their own. This bug was only fixable once programs moved out of
  /usr/X11R6. Closes: #85963
* dh_builddeb: In v6 mode, fix bug in DH_ALWAYS_EXCLUDE handling, to work
  the same as all the other code in debhelper. This could only be fixed in
  v6 mode because packages may potentially legitimately rely on the old
  buggy behavior. Closes: #242834
* dh_installman: In v6 mode, overwrite exsiting man pages. Closes: #288250

Debian/Debhelper/Dh_Lib.pm
autoscripts/postinst-wm
debhelper.pod
debian/changelog
debian/compat
dh_builddeb
dh_installman
dh_installwm
doc/TODO

index 64b8b7973cb4b62b223e1ab0951c6342eec9430f..9767959048bde46329c21c613dc214a8f8ed356d 100644 (file)
@@ -16,7 +16,7 @@ use vars qw(@ISA @EXPORT %dh);
            &compat &addsubstvar &delsubstvar &excludefile &package_arch
            &is_udeb &udeb_filename &debhelper_script_subst &escape_shell);
 
-my $max_compat=5;
+my $max_compat=6;
 
 sub init {
        # If DH_OPTIONS is set, prepend it @ARGV.
@@ -405,7 +405,7 @@ sub autoscript {
        my $filename=shift;
        my $sed=shift || "";
 
-       # This is the file we will append to.
+       # This is the file we will modify.
        my $outfile="debian/".pkgext($package)."$script.debhelper";
 
        # Figure out what shell script snippet to use.
@@ -423,9 +423,19 @@ sub autoscript {
                }
        }
 
-       complex_doit("echo \"# Automatically added by ".basename($0)."\">> $outfile");
-       complex_doit("sed \"$sed\" $infile >> $outfile");
-       complex_doit("echo '# End automatically added section' >> $outfile");
+       if (-e $outfile && ($script eq 'postrm' || $script eq 'prerm')) {
+               # Add fragments to top so they run in reverse order when removing.
+               complex_doit("echo \"# Automatically added by ".basename($0)."\"> $outfile.new");
+               complex_doit("sed \"$sed\" $infile >> $outfile.new");
+               complex_doit("echo '# End automatically added section' >> $outfile.new");
+               complex_doit("cat $outfile >> $outfile.new");
+               complex_doit("mv $outfile.new $outfile");
+       }
+       else {
+               complex_doit("echo \"# Automatically added by ".basename($0)."\">> $outfile");
+               complex_doit("sed \"$sed\" $infile >> $outfile");
+               complex_doit("echo '# End automatically added section' >> $outfile");
+       }
 }
 
 # Removes a whole substvar line.
index aef412a35601355ecd3764cbadd4677adcd68916..d47aefab7e6df9799a70b8ff3a13b5bad7e2420e 100644 (file)
@@ -1,4 +1,6 @@
 if [ "$1" = "configure" ]; then
        update-alternatives --install /usr/bin/x-window-manager \
-               x-window-manager #WM# #PRIORITY#
+               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
 fi
index bf932f0281def80188b9d4602e9286e9caa246ea..123f72675d3434305eec5ccb08557ea41d9d8535 100644 (file)
@@ -353,6 +353,28 @@ dh_install errors out if wildcards expand to nothing.
 
 =back
 
+=item V6
+
+This mode is still under development. Currently it has these differences
+compared to V5:
+
+=over 8
+
+=item -
+
+dh_installwm will install a slave manpage link for x-window-manager.1.gz.
+
+=item -
+
+dh_builddeb did not previously delete everything matching
+DH_ALWAYS_EXCLUDE, if it was set to a list of things to exclude, such as
+"CVS:.svn". Now it does.
+
+=item -
+
+dh_installman allows overwriting existing man pages in the package build
+directory. In previous compatability levels it silently refuses to do this.
+
 =back
 
 =head2 Doc directory symlinks
index 1a78315fe57a4b670c228bba31e0b25dfdb6d566..7df38da8242f9501d7465f4ded434c16cee164c9 100644 (file)
@@ -2,8 +2,23 @@ debhelper (5.0.44) UNRELEASED; urgency=low
 
   * dh_installudev: Don't fail if the link already somehow exists on initial
     package install. Closes: #415717
-
- -- Joey Hess <joeyh@debian.org>  Mon, 09 Apr 2007 14:37:48 -0400
+  * prerm and postrm scripts are now generated in a reverse order than
+    preinst and postinst scripts. For example, if a package uses
+    dh_pysupport before dh_installinit, the prerm will first stop the init
+    script and then remove the python files.
+  * Introducing beginning of v6 mode.
+  * dh_installwm: In v6 mode, install a slave manpage link for
+    x-window-manager.1.gz. Done in v6 mode because some window managers
+    probably work around this longstanding debhelper bug by registering the
+    slave on their own. This bug was only fixable once programs moved out of
+    /usr/X11R6. Closes: #85963
+  * dh_builddeb: In v6 mode, fix bug in DH_ALWAYS_EXCLUDE handling, to work
+    the same as all the other code in debhelper. This could only be fixed in
+    v6 mode because packages may potentially legitimately rely on the old
+    buggy behavior. Closes: #242834
+  * dh_installman: In v6 mode, overwrite exsiting man pages. Closes: #288250
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 09 Apr 2007 15:18:22 -0400
 
 debhelper (5.0.43) unstable; urgency=low
 
index 7ed6ff82de6bcc2a78243fc9c54d3ef5ac14da69..1e8b314962144c26d5e0e50fd29d2ca327864913 100644 (file)
@@ -1 +1 @@
-5
+6
index 31bcdc67d2b9aeb015ab4b4e2066427ec85590a8..dcc5af56832283d19ca77270d9b7bc7b24894cb7 100755 (executable)
@@ -60,8 +60,15 @@ else {
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
        if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) {
-               complex_doit("find $tmp -name $_ | xargs rm -rf")
-                       foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
+               if (! compat(5)) {
+                       complex_doit("find $tmp $dh{EXCLUDE_FIND} | xargs rm -rf");
+               }
+               else {
+                       # Old broken code here for compatability. Does not
+                       # remove everything.
+                       complex_doit("find $tmp -name $_ | xargs rm -rf")
+                               foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
+               }
        }
        if (! is_udeb($package)) {
                doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
index 7f39b9348ef06a221edb33615d00b729b9c10f8b..6dbafb820d9baf20aa7f56bfd1b8fb3febd79486 100755 (executable)
@@ -163,14 +163,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                }
                $destdir=~tr:/:/:s; # just for looks
 
-               if (! -e "$destdir/$instname.$section" && 
-                   ! -l "$destdir/$instname.$section") {
-                       if (! -d $destdir) {
-                               doit "install","-d",$destdir;
-                       }
-                       doit "install","-p","-m644",$page,
-                               "$destdir$instname.$section$gz";
+               next if -l "$destdir/$instname.$section";
+               next if compat(5) && -e "$destdir/$instname.$section";
+
+               if (! -d $destdir) {
+                       doit "install","-d",$destdir;
                }
+               doit "install","-p","-m644",$page,
+                       "$destdir$instname.$section$gz";
                
        }
 
index 31ce63c604733069bff7c9767182613a504b5295..1989056d0296cbc0da9cb777d5c8c997beaf12a9 100755 (executable)
@@ -17,7 +17,9 @@ 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)>
+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.
 
 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
index b790a60edf289207279e5a846c6fd614b312bbc9..c3df66e516f9e1fb32ab9d3bd83cfbe73254acaa 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -33,16 +33,12 @@ Wishlist items:
 v6:
 
 * escaping in config files (for whitespace)?
-* make dh_installman set up slave links. X11 stuff is no longer 
-  a problem due to X reorg. #85963
-* fix dh_builddeb DH_ALWAYS_EXCLUDE support to operate same as other
-  commands, see #242834
-* Fix #288250
 
 Deprecated:
 
-* DH_COMPAT 1, 2. Can be removed once all packages are seen to be using 3 or
-  higher. I won't hold my breath. Now with evil warning messages though.
+* DH_COMPAT 1, 2, 3. Can be removed once all packages are seen to be using
+  a newer version. I won't hold my breath. Now with evil warning messages
+  though.
 * Also, grep the entire archive for all dh_* command lines,
   and check to see what other switches are not being used, and maybe remove
   some of them. I'd also like to deprecate/remove debian/compress files, -X is