mirror of https://github.com/Kitware/CMake.git
Browse Source
cmake -E tar: Add --touch option
cmake -E tar: Add --touch option
Similar to GNU tar add a --touch option to the tar extract command to skip extracting the timestamps from the files in the archive effectively touching them as if they were just created. Issue: #22746pull/349/head

9 changed files with 69 additions and 12 deletions
-
7Help/command/file.rst
-
6Help/manual/cmake.1.rst
-
6Help/release/dev/cmake-E-tar-touch.rst
-
11Source/cmFileCommand.cxx
-
18Source/cmSystemTools.cxx
-
10Source/cmSystemTools.h
-
7Source/cmcmd.cxx
-
3Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake
-
13Tests/RunCMake/CommandLineTar/touch-mtime.cmake
@ -0,0 +1,6 @@ |
|||
cmake-E-tar-touch |
|||
----------------- |
|||
|
|||
* The :manual:`cmake(1)` ``-E tar`` command gained the ``--touch`` option |
|||
to keep the current local timestamp instead of extracting file timestamps |
|||
from the archive. |
@ -0,0 +1,13 @@ |
|||
include(${CMAKE_CURRENT_LIST_DIR}/mtime-tests.cmake) |
|||
|
|||
set(DECOMPRESSION_OPTIONS --touch) |
|||
|
|||
include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) |
|||
|
|||
foreach(file ${CHECK_FILES}) |
|||
file(TIMESTAMP ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file} MTIME UTC) |
|||
if(MTIME STREQUAL ARCHIVE_MTIME_RFC3339) |
|||
message(FATAL_ERROR |
|||
"File has unexpected timestamp ${MTIME}") |
|||
endif() |
|||
endforeach() |
Write
Preview
Loading…
Cancel
Save
Reference in new issue