Package: dpkg-dev
Version: 1.13.11
Severity: minor

So I was trying, in my madness, to build xorg packages over NFS recently,
and I noticed that the build was spending a ridiculously long time running
dh_shlibdeps (as opposed to the ridiculously long time it was spending
doing... anything else), and I decided to poke and see why this was.

I found an entertaining answer.

# Now: See if it is in this package.  See if it is in any other package.
sub searchdir {
    my $dir = shift;
    if(opendir(DIR, $dir)) {
        my @dirents = readdir(DIR);
        closedir(DIR);
        for (@dirents) {
            if ( -f "$dir/$_/DEBIAN/shlibs" ) {
                push(@curshlibs, "$dir/$_/DEBIAN/shlibs");
                next;
            } elsif ( $_ !~ /^\./ && -d "$dir/$_" && ! -l "$dir/$_" ) {
                &searchdir("$dir/$_");
            }
        }
    }
}

This function apparently isn't content to look for
debian/$pkg/DEBIAN/shlibs; it feels a need to look for things like
debian/xfonts-75dpi-transcoded/usr/X11R6/lib/X11/fonts/75dpi/helvB24-ISO8859-9.pcf.gz/DEBIAN/shlibs
as well.

Based on how this function is invoked, a more appropriate implementation may
be:

sub searchdir {
    my $dir = shift;
    if (opendir(DIR, $dir)) {
        my @dirents = readdir(DIR);
        closedir(DIR);
        for (@dirents) {
            if ( -f "$dir/$_/DEBIAN/shlibs" ) {
                push(@curshlibs, "$dir/$_/DEBIAN/shlibs");
            }
        }
    }
}

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[EMAIL PROTECTED]                                   http://www.debian.org/

Attachment: signature.asc
Description: Digital signature

Reply via email to