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.
This commit is contained in:
Brad King 2015-01-19 14:14:18 -05:00
parent 2e71d92ef2
commit 90f9c42732

View File

@ -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;
}