From 0bef358d22337c39e8f535b40bf51b50be8bdaee Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Tue, 21 May 2019 14:39:15 +0200 Subject: [PATCH] Added hash file generation (#3697). --- podcasts/scripts/make-all-podcasts.pl | 38 ++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/podcasts/scripts/make-all-podcasts.pl b/podcasts/scripts/make-all-podcasts.pl index 7e6c413..dedc91a 100755 --- a/podcasts/scripts/make-all-podcasts.pl +++ b/podcasts/scripts/make-all-podcasts.pl @@ -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);