summaryrefslogtreecommitdiff
path: root/dh_compress
diff options
context:
space:
mode:
authorjoey <joey>2003-08-22 19:40:51 +0000
committerjoey <joey>2003-08-22 19:40:51 +0000
commit917726187d01b79c7aa454a953f2e483a5171061 (patch)
tree7f614ae4c96f9cd3facf2f25e1be5c49a2c7ff15 /dh_compress
parent5dd373940d0348cc4dce74d0b0aa148d35b29934 (diff)
r1596: * Remove duplicate packages from DOPACKAGES after argument processing.
Closes: #112950 * dh_compress: deal with links pointing to links pointing to compressed files, no matter what order find returns them. Closes: #204169 * dh_installmodules, dh_installpam, dh_installcron, dh_installinit, dh_installogrotate: add --name= option, that can be used to specify the name to use for the file(s) installed by these commands. For example, dh_installcron --name=foo will install debian/package.foo.cron.daily to etc/cron.daily/foo. Closes: #138202, #101003, #68545, #148844 (Thanks to Thomas Hood for connecting these bug reports.) * dh_installinit: deprecated --init-script option in favor of the above. * Add dh_installppp. Closes: #43403
Diffstat (limited to 'dh_compress')
-rwxr-xr-xdh_compress26
1 files changed, 17 insertions, 9 deletions
diff --git a/dh_compress b/dh_compress
index 9d287af..cbdf627 100755
--- a/dh_compress
+++ b/dh_compress
@@ -166,16 +166,24 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
chdir($olddir);
# Fix up symlinks that were pointing to the uncompressed files.
- open (FIND,"find $tmp -type l |");
- while (<FIND>) {
- chomp;
- my ($directory)=m:(.*)/:;
- my $linkval=readlink($_);
- if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") {
- doit("rm","-f",$_);
- doit("ln","-sf","$linkval.gz","$_.gz");
+ my %links = map { chomp; $_ => 1 } `find $tmp -type l`;
+ my $changed;
+ # Keep looping through looking for broken links until no more
+ # changes are made. This is done in case there are links pointing
+ # to links, pointing to compressed files.
+ do {
+ $changed = 0;
+ foreach my $link (keys %links) {
+ my ($directory) = $link =~ m:(.*)/:;
+ my $linkval = readlink($link);
+ if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") {
+ doit("rm","-f",$link);
+ doit("ln","-sf","$linkval.gz","$link.gz");
+ delete $links{$link};
+ $changed++;
+ }
}
- }
+ } while $changed;
}
=head1 SEE ALSO