summaryrefslogtreecommitdiff
path: root/lib/mk-ca-bundle.pl
diff options
context:
space:
mode:
authorMatteo Bignotti <gugoll@gmail.com>2018-06-13 13:45:23 -0700
committerDaniel Stenberg <daniel@haxx.se>2018-06-14 00:02:20 +0200
commit47762f55839268213cc79708b51edd7cbef2893a (patch)
tree2090eb4bd1dcefcfdef769329e3c40e7d5e859d1 /lib/mk-ca-bundle.pl
parent0680ec9e2c3e13c28eb5ca69de7477d417b2169c (diff)
downloadcurl-47762f55839268213cc79708b51edd7cbef2893a.tar.gz
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
Diffstat (limited to 'lib/mk-ca-bundle.pl')
-rwxr-xr-xlib/mk-ca-bundle.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl
index 3dc5b6538..33977f322 100755
--- a/lib/mk-ca-bundle.pl
+++ b/lib/mk-ca-bundle.pl
@@ -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;
}