mk-ca-bundle.pl: make -u delete certdata.txt if found not changed

certdata.txt should be deleted also when the process is interrupted by
"same certificate downloaded, exiting"

The certdata.txt is currently kept on disk even if you give the -u
option

Closes #2655
This commit is contained in:
Matteo Bignotti 2018-06-13 13:45:23 -07:00 committed by Daniel Stenberg
parent 0680ec9e2c
commit 47762f5583
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 3 additions and 0 deletions

View File

@ -377,6 +377,9 @@ my $newhash= sha256($txt);
if(!$opt_f && $oldhash eq $newhash) {
report "Downloaded file identical to previous run\'s source file. Exiting";
if($opt_u && -e $txt && !unlink($txt)) {
report "Failed to remove $txt: $!\n";
}
exit;
}