From 47762f55839268213cc79708b51edd7cbef2893a Mon Sep 17 00:00:00 2001 From: Matteo Bignotti Date: Wed, 13 Jun 2018 13:45:23 -0700 Subject: 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 --- lib/mk-ca-bundle.pl | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.1