"previously run?"
sys.exit(-1)
- # Remove reference results.
- runCmd('git rm -r "%s"' % (RefResultsPath,))
+ # Remove reference results: in git, and then again for a good measure
+ # with rm, as git might not remove things fully if there are empty
+ # directories involved.
+ runCmd('git rm -r -q "%s"' % (RefResultsPath,))
+ runCmd('rm -rf "%s"' % (RefResultsPath,))
# Replace reference results with a freshly computed once.
runCmd('cp -r "%s" "%s"' % (CreatedResultsPath, RefResultsPath,))
SATestBuild.cleanupReferenceResults(RefResultsPath)
# Remove the created .diffs file before adding.
- runCmd('rm -f "%s/*/%s"' % (
- RefResultsPath, SATestBuild.DiffsSummaryFileName))
+ removeDiffsSummaryFiles(RefResultsPath)
runCmd('git add "%s"' % (RefResultsPath,))
+def removeDiffsSummaryFiles(RefResultsPath):
+ """
+ Remove all auto-generated .diffs files in reference data.
+ """
+ for (Dirpath, Dirnames, Filenames) in os.walk(RefResultsPath):
+ if SATestBuild.DiffsSummaryFileName in Filenames:
+ runCmd("rm '%s'" % os.path.join(
+ Dirpath, SATestBuild.DiffsSummaryFileName))
+
+
def main(argv):
if len(argv) == 2 and argv[1] in ('-h', '--help'):
print >> sys.stderr, "Update static analyzer reference results based "\