summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Fix cmSystemTools::RenameFile race on WindowsBrad King2013-02-041-31/+20
| | | | | | | | | | | | | | | Since commit d46d8df0 (Re-implemented cmGeneratedFileStream to look like a real stream and replace the destination file atomically, 2004-11-03) our RenameFile implementation tries to deal with MoveFile not replacing read-only files. In order to avoid the Get/SetFileAttributes pair we used stat to test for existence of the destination file. This has a race in which the destination could be created between the test for existence and the MoveFile call. Remove the stat call and use GetFileAttributes to detect whether the file exists. This shortens the race but does not eliminate it. Use a loop to try multiple times in case we lose the race. While at it, drop Win9x support and always use MoveFileEx.
* Merge topic 'use-cmsys-auto_ptr'Brad King2012-11-271-1/+0
|\ | | | | | | | | ddc0520 Always use the auto_ptr from cmsys.
| * Always use the auto_ptr from cmsys.Stephen Kelly2012-11-211-1/+0
| | | | | | | | | | | | This is for consistency throughout cmake. The cmsys version exists becaues uses of auto_ptr types as return types does not work with some implementations in ancient compilers.
* | CMake: Fix infinite loop untarring corrupt tar fileDavid Cole2012-11-261-2/+5
|/ | | | Suggested-by: Robert Maynard <robert.maynard@kitware.com>
* Merge topic 'kwsys-environ-cleanup'David Cole2012-05-011-35/+14
|\ | | | | | | | | | | e48796b KWSys: Fix SystemTools environment memory handling (#13156) b10c5cb CTest: Simplify environment save/restore
| * CTest: Simplify environment save/restoreBrad King2012-04-241-35/+14
| | | | | | | | | | | | | | | | Replace use of AppendEnv/RestoreEnv pairs with instances of SaveRestoreEnvironment. Simplify the signature of AppendEnv and use it in place of similar loops elsewhere. Move the RestoreEnv implementation inside the SaveRestoreEnvironment destructor which is the only place left that calls it.
* | Merge topic 'mac_environ'David Cole2012-04-251-0/+3
|\ \ | |/ |/| | | | | a90d478 [OSX] Fixed undefined symbol when linking CMakeLib into shared library
| * [OSX] Fixed undefined symbol when linking CMakeLib into shared libraryKonstantin Tokarev2012-03-031-0/+3
| |
* | Merge branch 'target-include-directories' into ninja-generatorDavid Cole2012-02-221-0/+16
|\ \ | |/
| * Merge topic 'interrupt-bug-12649'David Cole2012-02-141-0/+16
| |\ | | | | | | | | | | | | 131eed6 cmake-gui: Improve interrupt granularity to fix bug 12649.
| | * cmake-gui: Improve interrupt granularity to fix bug 12649.Clinton Stimpson2012-01-021-0/+16
| | | | | | | | | | | | | | | | | | | | | Instead of enabling interrupt only when a progress or message callback is called, add a new callback specifically for interrupt. This new callback is called from GetFatalErrorOccured() so cmake-gui can immediately report interrupt status instead of calling queuing a call to cmSystemTools::SetFatalErrorOccured() and waiting for the progress or message callback to be called to process that queued call.
* | | Add cmSystemTools::TrimWhitespace functionPeter Collingbourne2012-02-021-0/+14
|/ /
* | Handle libarchive API change in archive_read_data_blockBrad King2011-12-221-0/+4
|/ | | | The offset argument type depends on the libarchive version.
* Factor Compute(File|String)MD5 into cmCryptoHash helperBrad King2011-11-161-50/+7
| | | | | | Define an abstract API around the backend hash algorithm. Expose ifstream errors to HashFile callers. Always try opening the file. Succeed only if the end of file is reached without error.
* RunSingleCommand: Avoid assignment in conditionBrad King2011-07-281-1/+1
| | | | | Several compilers warn about this case even when an extra layer of parenthesis surrounds the assignment. Make the condition explicit.
* RunSingleCommand: Add a OUTPUT_NORMAL flag.Johan Björk2011-07-281-1/+21
| | | | | OUTPUT_NORMAL does no processing of the output streams, it just passes them through the same streams as they were received on.
* RunSingleCommand: Replace verbose boolean with enumJohan Björk2011-07-281-11/+13
| | | | | No behaviour change, this prepares for adding a flag to skip the merging of output streams.
* RunSingleCommand: Fix indentationBrad King2011-07-281-18/+18
|
* cmSystemTools: Remove trailing whitespaceBrad King2011-07-281-81/+81
|
* Merge topic 'xcode-source_groups-folders-issue-10039'Brad King2011-06-081-0/+32
|\ | | | | | | | | | | | | | | f09ba0f Fix style errors added by parent and grandparent eeeeca1 XCode: Support target folders on XCode. 59ed84e Xcode: Support multiple level nesting of XCode folders (#10039) d0a403f CMake: Move tokenize to cmSystemTools
| * CMake: Move tokenize to cmSystemToolsJohan Björk2011-06-071-0/+32
| |
* | Merge topic 'dont-compress-memcheck-output'Brad King2011-06-021-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 0e591ed Fix type conversion warning 9c3a0b9 We will actually compress memcheck output if the server supports it. 8024c53 Dynamic analysis test output should not be compressed.
| * | We will actually compress memcheck output if the server supports it.Zach Mullen2011-05-261-1/+1
| |/ | | | | | | | | This change won't be functional until the next release of CDash due to the version comparison.
* | Merge topic 'output-compile-lines'Brad King2011-05-241-0/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cdc2b41 Fix CompileCommandOutput test build on Windows 7039d1f Fix CompileCommandOutput test for Make tools not supporting spaces 4268e3d run_compile_commands: Cast istream::get() result to char c45c60b run_compile_commands: Avoid extra stl vector conversion 7c5be51 run_compile_commands: Avoid shadow in std::map<>::at workaround 169bb05 Provide std::map<>::at for use in run_compile_commands 4e2185c Make std::map usage more portable in language=>flags/defines maps a7e7a04 Fix run_compile_commands build on Apple GCC 3.3 c9174c0 Fix signed/unsigned comparison in EscapeJSON 8346a28 Only offer the compile command output feature on unix systems 0e6b05f Adds a test for the compile command line output. 5674844 make compile command output optional fe07b05 implement cxx command output 65c0c24 cache flags and defines 3f064ef refactor flags and defines
| * | run_compile_commands: Avoid extra stl vector conversionBrad King2011-05-181-0/+16
| |/ | | | | | | | | | | | | The Sun compiler does not provide the proper vector constructor to initialize it from an iterator pair of a non-matching type. Extend the ParseUnixCommandLine API to provide a vector of the proper type so no conversion is needed.
* | Explicitly cast time value in cmSystemTools::RandomSeedBrad King2011-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | Use static_cast to avoid warnings like conversion to ‘unsigned int’ from ‘__time_t’ may alter its value conversion to ‘unsigned int’ from ‘__suseconds_t’ may alter its value We do not care if the value is truncated because we are looking for just 32 bits anyway.
* | VS 6: Define _WIN32_WINNT to load wincrypt.h correctlyBrad King2011-05-181-0/+6
| |
* | Improve string(RANDOM) default seedBrad King2011-05-171-0/+64
|/ | | | | | The naive time(0) seed is unique only within one second. Instead try to read a real source of entropy and otherwise fall back to a combination of the process id and high-resolution time.
* Merge topic 'style-line-length'Brad King2010-09-141-1/+2
|\ | | | | | | | | | | 9d21281 Fix line-too-long style errors 86025d3 file(DOWNLOAD): Fix error message formatting
| * Fix line-too-long style errorsBrad King2010-09-101-1/+2
| |
* | Preserve timestamps on files on tar extract.David Cole2010-09-091-2/+10
|/ | | | | Conversion to libarchive changed the behavior of cmake -E tar xzf. This commit fixes that oversight.
* CPack Backward-compatibly enforce DESTDIR for DEB and RPMEric NOULARD2010-08-231-1/+16
|
* Remove cmSystemTools::EscapeSpaces methodBrad King2010-08-181-43/+0
| | | | | | The last remaining call to this method exists only for compatibility. Remove the method and put its implementation inline in place of the last call.
* Add ZIP archive format and LZMA compress support to libarchive-wrapperEric NOULARD2010-08-131-1/+2
| | | | | | | This will be needed to use cmArchiveWrire in cmCPackArchiveGenerator with the same feature set as before. Note that adding zip support to libarchive-wrapper would also makes it easy to add a new -E zip command to cmake commands.
* Include entries for directories in tarballs (#11020)Brad King2010-08-061-123/+22
| | | | | | Use libarchive through class cmArchiveWrite to implement the method cmSystemTools::CreateTar. The class includes entries for directories by automatically traversing the tree on disk.
* Include headers from chosen libarchive (#10923)Brad King2010-08-051-2/+1
| | | | | When CMAKE_USE_SYSTEM_LIBARCHIVE is on we must include the system libarchive headers to match the library that will be linked.
* Fix or cast more integer conversions in cmakeBrad King2010-06-291-4/+4
| | | | | These were revealed by GCC's -Wconversion option. Fix types where it is easy to do so. Cast in cases we know the integer will not be truncated.
* Fix or cast integer conversions in cmakeBrad King2010-06-251-3/+3
| | | | | These were revealed by GCC's -Wconversion option. Fix types where it is easy to do so. Cast in cases we know the integer will not be truncated.
* CPack: Try harder to remove temporary dir (#10793)Brad King2010-06-041-0/+15
| | | | | Windows filesystems sometimes lock files temporarily. Try removing the CPack temp install folder multiple times before giving up.
* Do not list file names during 'cmake -E tar xz'Brad King2010-05-051-1/+2
| | | | | | | Since commit "Switch to using libarchive from libtar" (2009-10-30) the the implementation of "tar xz" has printed all paths from the tarball as a single line with no separator. This fixes the logic to extract silently as expected.
* Add missing archive_read_finish calls to fix some of the presently reported ↵David Cole2009-12-281-1/+1
| | | | valgrind memory leaks.
* Preserve environment variables across calls to ↵David Cole2009-12-231-0/+12
| | | | cmCTestScriptHandler::RunConfigurationScript. This will help prevent problems like we are currently experiencing (regarding CMake continuous dashboards only running once each day because the HOME environment variable is modified indirectly by a command in a called script, but affects the environment in the calling script).
* Move cURL dependent code out of CMakeLib to fix complex tests.Zach Mullen2009-12-221-53/+0
|
* Fix broken bootstrap testZach Mullen2009-12-221-2/+1
|
* Make new web api safe for bootstrap build.Zach Mullen2009-12-211-0/+2
|
* Added functionality to allow CTest to easily access web APIs. This will be ↵Zach Mullen2009-12-211-0/+52
| | | | used for better communication with CDash.
* Added support for CTest awareness of the CDash version. This will help ↵Zach Mullen2009-12-211-0/+27
| | | | forward compatibility for both tools. Note that this changeset effectively makes the default to disable output compression. Now, to enable output compression, the CDASH_CTEST_VERSION must be explicity set to >= 1.6. Automated detection of the CDash version is the next step.
* use different tar format to handle longer file namesBill Hoffman2009-11-141-1/+1
|
* Show the current file when there is a tar errorBill Hoffman2009-11-131-0/+2
|
* fix warning for borlandBill Hoffman2009-11-131-0/+3
|