From: Matteo Bignotti Date: Wed, 13 Jun 2018 20:45:23 +0000 (-0700) Subject: mk-ca-bundle.pl: make -u delete certdata.txt if found not changed X-Git-Tag: curl-7_61_0~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47762f55839268213cc79708b51edd7cbef2893a;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl index 3dc5b6538c..33977f3226 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; }