Hi,

On Tue, 16 Aug 2011, Anders Kaseorg wrote:
> +sub md5sums_path
> +{
> +    # Calling dpkg-query --control-path for every package is too slow,
> +    # so we cheat a little bit.
> +
> +    my ($path) = @_;
> +    return "$DPKG/info/$path.md5sums" if -e "$DPKG/info/$path.list";
> +    return "$DPKG/info/$path:$arch.md5sums" if $path !~ /:/ and -e 
> "$DPKG/info/$path:$arch.list";
> +    die "Cannot find md5sums path for $path\n";
> +}

You're only returning the path of an existing file, or you're dying...

>      {
> -     open S, "$DPKG/info/$p.md5sums" or next;
> +     open S, md5sums_path($p) or next;

Which means that the "or next" will never trigger for a non-existing file
since you will immediately die.

>       else
>       {
> -         $sums = "$DPKG/info/$pack.md5sums";
> +         $sums = md5sums_path($pack);
>           unless (-f $sums or $config)

And this -f $sums is guaranteed to return true since otherwise you
will have died just before...

> @@ -626,7 +637,7 @@ for (@ARGV)
>  
>       if ($generate{keep})
>       {
> -         my $target = "$DPKG/info/$pack.md5sums";
> +         my $target = md5sums_path($pack);
>           copy $sums, $target
>               or die "$self: can't copy sums to $target ($!)\n";
>       }

And you can't use md5sums_path() to find out the correct location either
since the function will die if the target is not already existing.

The rest looks ok from a quick look.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to