File: sum-release

package info (click to toggle)
debmirror 1%3A2.47
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 488 kB
  • sloc: perl: 2,765; sh: 93; makefile: 19
file content (25 lines) | stat: -rwxr-xr-x 612 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl
use warnings;
use strict;
use integer;
use FindBin;

our @kind = (
    { cmd => 'md5sum'   , name => 'MD5Sum' },
    { cmd => 'sha1sum'  , name => 'SHA1'   },
    { cmd => 'sha256sum', name => 'SHA256' },
);

chdir "${FindBin::RealBin}/debian";
my @file = grep { !m%^dists/[^/]+/Release$% }
  map { my $f = $_; chomp $f; $f =~ s%^\./%%; $f; }
  sort `find . -mindepth 2 -type f`;

for my $kind (@kind) {
    print $kind->{name} . ":\n";
    for my $file (@file) {
        my $cmd = "${FindBin::RealBin}/calculate-sum Release "
          . $kind->{cmd} . " $file";
        print `${cmd}`;
    }
}