X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_installchangelogs;h=4bf97dcc680a82ce84156034e89f8bd726050916;hb=e275962725279a6254bddf55b11d16c8ddd65c9c;hp=27e433c00f92e254ddeb3c0358f2fdde6aa6e35f;hpb=a243946176b92b5fafd84f43d5a455551cf27210;p=debhelper.git diff --git a/dh_installchangelogs b/dh_installchangelogs index 27e433c..4bf97dc 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -119,12 +119,22 @@ foreach my $package (@{$dh{DOPACKAGES}}) { error("could not find changelog $changelog"); } - if (! -d "$tmp/usr/share/doc/$package") { - # If it is a dangling symlink, then don't do anything. - # Think multi-binary packages that depend on each other and - # want to link doc dirs. - next if -l "$tmp/usr/share/doc/$package"; + # If it is a symlink to a documentation directory from the same + # source package, then don't do anything. Think multi-binary + # packages that depend on each other and want to link doc dirs. + if (-l "$tmp/usr/share/doc/$package") { + my $linkval=readlink("$tmp/usr/share/doc/$package"); + my %allpackages=map { $_ => 1 } getpackages(); + if ($allpackages{basename($linkval)}) { + next; + } + # Even if the target doesn't seem to be a doc dir from the + # same source package, don't do anything if it's a dangling + # symlink. + next unless -d "$tmp/usr/share/doc/$package"; + } + if (! -d "$tmp/usr/share/doc/$package") { doit("install","-d","$tmp/usr/share/doc/$package"); } doit("install","-o",0,"-g",0,"-p","-m644",$changelog,