diff options
author | Brad King <brad.king@kitware.com> | 2013-11-02 14:54:51 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-11-02 14:54:51 (GMT) |
commit | 6f6caee388483c913c54f69a75c16b7652449cdd (patch) | |
tree | 089d2115d6fdb04acbb6efae108c05d717062e3a /Source | |
parent | 8ada96a39f181fe372489c784539d19700590ee7 (diff) | |
parent | 4c383b52d0611c56679f96cbc99fc1d6683b5ca9 (diff) | |
download | CMake-6f6caee388483c913c54f69a75c16b7652449cdd.zip CMake-6f6caee388483c913c54f69a75c16b7652449cdd.tar.gz CMake-6f6caee388483c913c54f69a75c16b7652449cdd.tar.bz2 |
Merge topic 'archive-skip-symlink-on-windows'
4c383b5 cmake: Avoid '-E tar' failure to extract symlinks on Windows (#13251)
0d8552c cmSystemTools: Re-order extract_tar logic
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmSystemTools.cxx | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 8320ecf..1ecda88 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1619,18 +1619,23 @@ bool extract_tar(const char* outFileName, bool verbose, archive_error_string(a)); break; } - if (verbose && extract) + if(verbose) { - cmSystemTools::Stdout("x "); - cmSystemTools::Stdout(archive_entry_pathname(entry)); - } - if(verbose && !extract) - { - list_item_verbose(stdout, entry); + if(extract) + { + cmSystemTools::Stdout("x "); + cmSystemTools::Stdout(archive_entry_pathname(entry)); + } + else + { + list_item_verbose(stdout, entry); + } + cmSystemTools::Stdout("\n"); } else if(!extract) { cmSystemTools::Stdout(archive_entry_pathname(entry)); + cmSystemTools::Stdout("\n"); } if(extract) { @@ -1644,15 +1649,7 @@ bool extract_tar(const char* outFileName, bool verbose, } r = archive_write_header(ext, entry); - if (r != ARCHIVE_OK) - { - cmSystemTools::Error("Problem with archive_write_header(): ", - archive_error_string(ext)); - cmSystemTools::Error("Current file: ", - archive_entry_pathname(entry)); - break; - } - else + if (r == ARCHIVE_OK) { copy_data(a, ext); r = archive_write_finish_entry(ext); @@ -1663,10 +1660,22 @@ bool extract_tar(const char* outFileName, bool verbose, break; } } - } - if (verbose || !extract) - { - cmSystemTools::Stdout("\n"); +#ifdef _WIN32 + else if(const char* linktext = archive_entry_symlink(entry)) + { + std::cerr << "cmake -E tar: warning: skipping symbolic link \"" + << archive_entry_pathname(entry) << "\" -> \"" + << linktext << "\"." << std::endl; + } +#endif + else + { + cmSystemTools::Error("Problem with archive_write_header(): ", + archive_error_string(ext)); + cmSystemTools::Error("Current file: ", + archive_entry_pathname(entry)); + break; + } } } archive_read_close(a); |