]> granicus.if.org Git - curl/commitdiff
mk-ca-bundle.pl: make -u delete certdata.txt if found not changed
authorMatteo Bignotti <gugoll@gmail.com>
Wed, 13 Jun 2018 20:45:23 +0000 (13:45 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 13 Jun 2018 22:02:20 +0000 (00:02 +0200)
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

lib/mk-ca-bundle.pl

index 3dc5b6538c3eb17520eb8bc8988f786de926911f..33977f322691a1f57a1090b2cd31f2accf13686e 100755 (executable)
@@ -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;
 }