From 35e3686ae9a536a4b91ccc97f9b1c8dbf6593af6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:00 +0000 Subject: [PATCH] r155: Initial Import --- debian/changelog | 13 +++++++++++++ dh_clean | 2 +- dh_compress | 28 ++++++++++++++++++++++++++++ doc/TODO | 1 - 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 993f0fa..ddd8526 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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, diff --git a/dh_clean b/dh_clean index 821a54d..73f8af2 100755 --- 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" } diff --git a/dh_compress b/dh_compress index 0cc79c7..2933e51 100755 --- a/dh_compress +++ b/dh_compress @@ -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); diff --git a/doc/TODO b/doc/TODO index dcac713..282c24e 100644 --- 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: -- 2.39.5