This is an automated email from the git hooks/post-receive script. abe pushed a commit to branch master in repository debsums.
commit abb370c4b9ddc58f96c096aad2d6692c7aa6e53e Author: Anders Kaseorg <ande...@mit.edu> Date: Fri Jul 8 02:52:22 2011 -0400 Read and write .md5sums files at multiarch paths when needed Signed-off-by: Anders Kaseorg <ande...@mit.edu> --- debsums | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/debsums b/debsums index 855fbf7..d64a5e7 100755 --- a/debsums +++ b/debsums @@ -151,6 +151,8 @@ my @debpath = '.'; @debpath = map +(length) ? $_ : '.', split /:/, $debpath, -1 if $debpath; my $arch; +chomp ($arch = `/usr/bin/dpkg --print-architecture`); + my %generate; if ($gen_opt) { @@ -172,8 +174,6 @@ if ($gen_opt) $generate{missing}++ unless $generate{all} or $generate{missing}; $generate{keep}++ if $generate{nocheck}; - chomp ($arch = `/usr/bin/dpkg --print-architecture`); - # ensure generated files are world readable umask 022; } @@ -254,6 +254,23 @@ sub dpkg_cmp !system '/usr/bin/dpkg', '--compare-versions', $ver, $op, $testver; } +sub md5sums_path +{ + # Calling dpkg-query --control-path for every package is too slow, + # so we cheat a little bit. + + my ($pack) = @_; + if (-e "$DPKG/info/$pack.list") { + return "$DPKG/info/$pack.md5sums"; + } elsif ($pack !~ /:/ and -e "$DPKG/info/$pack:$arch.list") { + return "$DPKG/info/$pack:$arch.md5sums"; + } elsif ($pack =~ /^(.*):/ and -e "$DPKG/info/$1.list") { + return "$DPKG/info/$1.md5sums"; + } else { + die "Cannot find md5sums path for $pack\n"; + } +} + sub is_replaced { my ($pack, $path, $sum) = @_; @@ -273,7 +290,7 @@ sub is_replaced for my $p (@{$installed{$pack}{ReplacedBy} || []}) { - open S, "$DPKG/info/$p.md5sums" or next; + open S, md5sums_path($p) or next; while (<S>) { if ($_ eq "$sum $path\n") @@ -460,7 +477,7 @@ for (@ARGV) } else { - $sums = "$DPKG/info/$pack.md5sums"; + $sums = md5sums_path($pack); unless (-f $sums or $config) { if ($missing) @@ -626,7 +643,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"; } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/debsums.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits