Add SHA256 in the Packages files too

This commit is contained in:
Steve McIntyre 2017-08-05 16:27:41 +01:00
parent c8e8c0b10b
commit 6261303061
1 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@ $version="1.9.17"; # diverted from dpkg 1.9.17
'Filename', 'Filename',
'Size', 'Size',
'MD5sum', 'MD5sum',
'SHA256',
'Description'); 'Description');
$written=0; $written=0;
@ -132,6 +133,12 @@ while (<F>) {
s/\ .*$//; s/\ .*$//;
$tv{'MD5sum'}= $_; $tv{'MD5sum'}= $_;
open(C,"sha256sum $fn |") || die "$fn $!";
chop($_=<C>); close(C); $? and die "\`sha256sum < $fn' exited with $?\n";
/^[0-9a-f]{32}/ or die "Strange text from \`sha256sum < $fn': \`$_'\n";
s/\ .*$//;
$tv{'SHA256'}= $_;
@stat= stat($fn) or die "Couldn't stat $fn: $!\n"; @stat= stat($fn) or die "Couldn't stat $fn: $!\n";
$stat[7] or die "$fn is empty\n"; $stat[7] or die "$fn is empty\n";
$tv{'Size'}= $stat[7]; $tv{'Size'}= $stat[7];