From 4862f3b2c88e37187c9a5e323f8881b24dbdabef Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 27 Oct 2021 12:58:29 -0400 Subject: cmcmd: Write progress and tar errors directly to stderr In these code paths, `cmSystemTools::Message` never has a callback set. Inline the non-callback implementation at call sites. --- Source/cmcmd.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 265c1fd..8376d4d 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1112,7 +1112,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args, int count; if (countFile) { if (1 != fscanf(countFile, "%i", &count)) { - cmSystemTools::Message("Could not read from count file."); + std::cerr << "Could not read from count file.\n"; } fclose(countFile); } else { @@ -1426,8 +1426,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args, action = cmSystemTools::TarActionExtract; } break; default: { - cmSystemTools::Message( - std::string("tar: Unknown argument: ") + flag, "Warning"); + std::cerr << "tar: Unknown argument: " << flag << "\n"; } } } @@ -1448,8 +1447,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args, } } else if (action == cmSystemTools::TarActionCreate) { if (files.empty()) { - cmSystemTools::Message("tar: No files or directories specified", - "Warning"); + std::cerr << "tar: No files or directories specified\n"; } if (!cmSystemTools::CreateTar(outFile, files, compress, verbose, mtime, format)) { @@ -1688,7 +1686,7 @@ static void cmcmdProgressReport(std::string const& dir, std::string const& num) return; } if (1 != fscanf(progFile, "%i", &count)) { - cmSystemTools::Message("Could not read from progress file."); + std::cerr << "Could not read from progress file.\n"; } fclose(progFile); -- cgit v0.12