mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-05 06:40:26 -06:00
cmake -E tar: Improve error message formatting
Do not print file paths with our prose line wrapping, which breaks on spaces.
This commit is contained in:
@@ -448,8 +448,9 @@ bool cmArchiveWrite::AddFile(char const* file, size_t skip, char const* prefix)
|
||||
cm_archive_entry_copy_pathname(e, dest);
|
||||
if (archive_read_disk_entry_from_file(this->Disk, e, -1, nullptr) !=
|
||||
ARCHIVE_OK) {
|
||||
this->Error = cmStrCat("Unable to read from file '", file,
|
||||
"': ", cm_archive_error_string(this->Disk));
|
||||
this->Error =
|
||||
cmStrCat("Unable to read from file:\n ", file, "\nbecause:\n ",
|
||||
cm_archive_error_string(this->Disk));
|
||||
return false;
|
||||
}
|
||||
if (!this->MTime.empty()) {
|
||||
|
||||
@@ -3901,7 +3901,7 @@ bool HandleArchiveExtractCommand(std::vector<std::string> const& args,
|
||||
parsedArgs.Touch ? cmSystemTools::cmTarExtractTimestamps::No
|
||||
: cmSystemTools::cmTarExtractTimestamps::Yes,
|
||||
parsedArgs.Verbose)) {
|
||||
status.SetError(cmStrCat("failed to extract: ", inFile));
|
||||
status.SetError(cmStrCat("failed to extract:\n ", inFile));
|
||||
cmSystemTools::SetFatalErrorOccurred();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2715,8 +2715,8 @@ bool extract_tar(std::string const& outFileName,
|
||||
# endif
|
||||
else {
|
||||
ArchiveError("Problem with archive_write_header(): ", ext);
|
||||
cmSystemTools::Error("Current file: " +
|
||||
cm_archive_entry_pathname(entry));
|
||||
cmSystemTools::Error(
|
||||
cmStrCat("Current file:\n ", cm_archive_entry_pathname(entry)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1790,13 +1790,14 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
|
||||
if (!cmSystemTools::CreateTar(outFile, files, {}, compress, verbose,
|
||||
mtime, format, compressionLevel,
|
||||
numThreads)) {
|
||||
cmSystemTools::Error("Problem creating tar: " + outFile);
|
||||
cmSystemTools::Error(cmStrCat("Problem creating tar:\n ", outFile));
|
||||
return 1;
|
||||
}
|
||||
} else if (action == cmSystemTools::TarActionExtract) {
|
||||
if (!cmSystemTools::ExtractTar(outFile, files, extractTimestamps,
|
||||
verbose)) {
|
||||
cmSystemTools::Error("Problem extracting tar: " + outFile);
|
||||
cmSystemTools::Error(
|
||||
cmStrCat("Problem extracting tar:\n ", outFile));
|
||||
return 1;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
^CMake Error: Zstd is not supported for 7zip. Please, build CMake with libarchive 3.8.0 or newer if you want to use it.
|
||||
CMake Error: Problem creating tar: bad.7z$
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.7z$
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
^CMake Error: Unable to read from file 'badfile\.txt': .*
|
||||
CMake Error: Problem creating tar: bad\.tar$
|
||||
^CMake Error: Unable to read from file:
|
||||
badfile\.txt
|
||||
because:
|
||||
[^
|
||||
]*
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.tar$
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
^CMake Error: Unable to read from file 'does-not-exist':.*
|
||||
CMake Error: Problem creating tar: bad\.tar$
|
||||
^CMake Error: Unable to read from file:
|
||||
does-not-exist
|
||||
because:
|
||||
[^
|
||||
]*
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.tar$
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
^CMake Error: Unable to read from file 'does-not-exist':.*
|
||||
CMake Error: Problem creating tar: bad\.tar$
|
||||
^CMake Error: Unable to read from file:
|
||||
does-not-exist
|
||||
because:
|
||||
[^
|
||||
]*
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.tar$
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
^CMake Error: unable to parse mtime 'bad'
|
||||
CMake Error: Problem creating tar: bad\.tar$
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.tar$
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
^CMake Error: Unable to read from file '--bad':.*
|
||||
CMake Error: Problem creating tar: bad\.tar$
|
||||
^CMake Error: Unable to read from file:
|
||||
--bad
|
||||
because:
|
||||
[^
|
||||
]*
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.tar$
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
^CMake Error: BZip2 is not supported for zip. Please, build CMake with libarchive 3.8.0 or newer if you want to use it.
|
||||
CMake Error: Problem creating tar: bad.zip$
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.zip$
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
^CMake Error: LZMA is not supported for zip. Please, build CMake with libarchive 3.8.0 or newer if you want to use it.
|
||||
CMake Error: Problem creating tar: bad.zip$
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.zip$
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
^CMake Error: LZMA2 \(XZ\) is not supported for zip. Please, build CMake with libarchive 3.8.0 or newer if you want to use it.
|
||||
CMake Error: Problem creating tar: bad.zip$
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.zip$
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
^CMake Error: Zstd is not supported for zip. Please, build CMake with libarchive 3.8.0 or newer if you want to use it.
|
||||
CMake Error: Problem creating tar: bad.zip$
|
||||
CMake Error: Problem creating tar:
|
||||
bad\.zip$
|
||||
|
||||
Reference in New Issue
Block a user