소스 검색

cmake: Avoid '-E tar' failure to extract symlinks on Windows (#13251)

If a symlink fails to extract and the host system is Windows then report
a warning and skip the entry instead of failing.  This will allow
archives containing symbolic links to be extracted on Windows with
somewhat gracefully degraded behavior.
Brad King 12 년 전
부모
커밋
4c383b52d0
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      Source/cmSystemTools.cxx

+ 8 - 0
Source/cmSystemTools.cxx

@@ -1660,6 +1660,14 @@ bool extract_tar(const char* outFileName, bool verbose,
           break;
           }
         }
+#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(): ",