On Tue, Sep 08, 2009 at 03:54:07PM -0400, Joey Hess wrote:
> Colin Watson wrote:
> > - 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") {
>
> Why does it need to check that the link points to a binary package from
> the same source? The result seems to be the same whether or not that is
> the case.
The behaviour is different if the target of the symlink actually exists.
Consider a package foo that makes /usr/share/doc/foo a link to an
upstream-installed directory /usr/share/foo/doc, for example. I wanted
to avoid creating conflicting files, while keeping the behaviour change
in dh_installchangelogs to an absolute minimum (I suspect this situation
is rare but haven't regression-tested it to prove it).
In the case of a dangling symlink, the result is indeed the same either
way, and perhaps it would be more efficient to reverse the order of the
two checks in the -l block.
--
Colin Watson [[email protected]]
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]