Added hash file generation (#3697).

This commit is contained in:
Christian P. MOMON 2019-05-21 14:39:15 +02:00
parent 66ef7112b2
commit 0bef358d22

View File

@ -99,7 +99,9 @@ sub process {
}
}
my $command = "mv output.ogg $source_name-$short_chapter_name.ogg";
# renaming to target
my $target_name = "$source_name-$short_chapter_name.ogg";
my $command = "mv output.ogg $target_name";
if($dryrun) {
print "$command\n";
} else {
@ -113,6 +115,22 @@ sub process {
}
}
}
# hashing
my $command = "sha1sum $target_name > $target_name.sha1";
if($dryrun) {
print "$command\n";
} else {
my @ret = `$command`;
if($?) {
print "Error while hashing $target_name\n";
if($verbose) {
print Dumper @ret;
print Dumper $data;
return 0;
}
}
}
}
# putting metadata in main podcast
@ -131,6 +149,8 @@ sub process {
}
}
}
# renaming to target
my $command = "mv output.ogg $source_name.ogg";
if($dryrun) {
print "$command\n";
@ -145,6 +165,22 @@ sub process {
}
}
}
# hashing
my $command = "sha1sum $source_name.ogg > $source_name.ogg.sha1";
if($dryrun) {
print "$command\n";
} else {
my @ret = `$command`;
if($?) {
print "Error while hashing $source_name.ogg\n";
if($verbose) {
print Dumper @ret;
print Dumper $data;
return 0;
}
}
}
}
process($config,$verbose,$dryrun);