From 90f9c42732a18e53943c3aa27de76c2511c5a0c6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 19 Jan 2015 14:14:18 -0500 Subject: [PATCH] cmake: Teach "-E tar" to report file name on failure to read from disk The libarchive-provided error message does not always include the file name, so add it to the message ourselves to ensure users know which file fails. --- Source/cmArchiveWrite.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a2aecac00..16f67f49d 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -271,7 +271,9 @@ bool cmArchiveWrite::AddFile(const char* file, cm_archive_entry_copy_pathname(e, dest); if(archive_read_disk_entry_from_file(this->Disk, e, -1, 0) != ARCHIVE_OK) { - this->Error = "archive_read_disk_entry_from_file: "; + this->Error = "archive_read_disk_entry_from_file '"; + this->Error += file; + this->Error += "': "; this->Error += cm_archive_error_string(this->Disk); return false; }