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
This commit is contained in:
commit
6f6caee388
@ -1619,18 +1619,23 @@ bool extract_tar(const char* outFileName, bool verbose,
|
|||||||
archive_error_string(a));
|
archive_error_string(a));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (verbose && extract)
|
if(verbose)
|
||||||
|
{
|
||||||
|
if(extract)
|
||||||
{
|
{
|
||||||
cmSystemTools::Stdout("x ");
|
cmSystemTools::Stdout("x ");
|
||||||
cmSystemTools::Stdout(archive_entry_pathname(entry));
|
cmSystemTools::Stdout(archive_entry_pathname(entry));
|
||||||
}
|
}
|
||||||
if(verbose && !extract)
|
else
|
||||||
{
|
{
|
||||||
list_item_verbose(stdout, entry);
|
list_item_verbose(stdout, entry);
|
||||||
}
|
}
|
||||||
|
cmSystemTools::Stdout("\n");
|
||||||
|
}
|
||||||
else if(!extract)
|
else if(!extract)
|
||||||
{
|
{
|
||||||
cmSystemTools::Stdout(archive_entry_pathname(entry));
|
cmSystemTools::Stdout(archive_entry_pathname(entry));
|
||||||
|
cmSystemTools::Stdout("\n");
|
||||||
}
|
}
|
||||||
if(extract)
|
if(extract)
|
||||||
{
|
{
|
||||||
@ -1644,15 +1649,7 @@ bool extract_tar(const char* outFileName, bool verbose,
|
|||||||
}
|
}
|
||||||
|
|
||||||
r = archive_write_header(ext, entry);
|
r = archive_write_header(ext, entry);
|
||||||
if (r != ARCHIVE_OK)
|
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
|
|
||||||
{
|
{
|
||||||
copy_data(a, ext);
|
copy_data(a, ext);
|
||||||
r = archive_write_finish_entry(ext);
|
r = archive_write_finish_entry(ext);
|
||||||
@ -1663,10 +1660,22 @@ bool extract_tar(const char* outFileName, bool verbose,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
#ifdef _WIN32
|
||||||
if (verbose || !extract)
|
else if(const char* linktext = archive_entry_symlink(entry))
|
||||||
{
|
{
|
||||||
cmSystemTools::Stdout("\n");
|
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);
|
archive_read_close(a);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user