]> git.donarmstrong.com Git - debhelper.git/commitdiff
r155: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 05:07:00 +0000 (05:07 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 05:07:00 +0000 (05:07 +0000)
debian/changelog
dh_clean
dh_compress
doc/TODO

index 993f0fa732aad771be5d8fbb07a2213c856a30b1..ddd852690c06e8edd5e58814310b13ca5fb0395a 100644 (file)
@@ -1,3 +1,16 @@
+debhelper (1.2.19) unstable; urgency=low
+
+  * dh_listpackages: new command. Takes the standard options taken by other
+    debhelper commands, and just outputs a list of the binary packages a
+    debhelper command would act on. Added because of bug #30626, and because
+    of wn's truely ugly use of debhelper internals to get the same info (and
+    because it's just 4 lines of code ;-).
+  * dh_compress: is now smart about compressing files that are hardlinks.
+    When possible, will only compress one file, delete the hardlinks, and
+    re-make hardlinks to the compressed file, saving some disk space.
+
+ -- Joey Hess <joeyh@master.debian.org>  Fri, 18 Dec 1998 22:26:41 -0500
+
 debhelper (1.2.18) unstable; urgency=medium
 
   * dh_fixperms: was not fixing permissions of files in usr/doc/ to 644,
index 821a54dc111bb39664380e27a5d5782d06daad33..73f8af2e971f59a3c0d0249ae78f922a53d0f757 100755 (executable)
--- a/dh_clean
+++ b/dh_clean
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 #
-# Clean up $TMP and other tepmorary files generated by the 
+# Clean up $TMP and other tepmorary files generated by the
 # build process.
 
 BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
index 0cc79c785669aa05d060ce5ed239e27878fc369b..2933e516312829d2658a7080dc695147ef6c1f57 100755 (executable)
@@ -53,10 +53,38 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                }
                @files=@new;
        }
+       
+       # Look for files with hard links. If we are going to compress both,
+       # we can preserve the hard link across the compression and save
+       # space in the end.
+       foreach (@files) {
+               ($dev, $inode, undef, $nlink)=stat($_);
+               if ($nlink > 1) {
+                       @{$hardlinks{$_}}=($dev,$inode);
+               }
+       }
+       # TODO: with the info we have now, we could remove the hard link files
+       # from the list of files to compress and save some time.
 
        if (@files) {
                doit("gzip","-9f",@files);
        }
+       
+       # Now change over any files we can that used to be hard links so
+       # they are again.
+       my $old_dev='';
+       my $old_inode='';
+       my $old_fn='';
+       foreach (sort keys %hardlinks) {
+               if ($hardlinks{$_}[0] eq $old_dev &&
+                   $hardlinks{$_}[1] eq $old_inode) {
+                       doit("rm","-f","$_.gz");
+                       doit("ln","$old_fn.gz","$_.gz");
+               }       
+               $old_dev=$hardlinks{$_}[0];
+               $old_inode=$hardlinks{$_}[1];
+               $old_fn=$_;
+       }
 
        chdir($olddir);
 
index dcac71342a77708a19bb34312d859ab00aed5001..282c24ed399c586c541441bdc40f1e61fa42bf94 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -6,7 +6,6 @@ Bugs:
 * all commands should print a warning message if non-cumulative parameters
   are given more than once (ie, two -u's to dh_gencontrol). (#22588)
   (Bug currently under dispute, I think this is bogus).
-* dh_compress doesn't preserve hard links
 
 Wishlist items: