summaryrefslogtreecommitdiff
path: root/Source/cmFileCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-5/+5
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Merge topic 'install-case-sensitive-mac'David Cole2012-06-141-2/+4
|\ | | | | | | | | a41557a install: Fix FILES_MATCHING on case-sensitive Mac filesystems (#13177)
| * install: Fix FILES_MATCHING on case-sensitive Mac filesystems (#13177)Brad King2012-06-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows and Apple machines have predominantly used case-insensitive filesystems so our file(INSTALL) command uses case-insensitive pattern matching. It is implemented by converting the pattern and file path to lower case before matching. The FILES_MATCHING option is implemented by excluding a path that does not match any pattern unless it is a directory that must be searched recursively. However, the test that an excluded path is a directory is executed on the lower-case path and therefore fails on mixed-case input paths on case-sensitive filesystems. Fix the file(INSTALL) implementation to use the lower-case path only for pattern matching and preserve the original path for tests against the real filesystem.
* | Workaround IBM XL v6 streams seekg bug (#13149)Jim Hague2012-04-191-1/+1
|/ | | | | | It seems that file.seekg(0) will, in some circumstances, cause the next file.getline() to omit the first character it reads. Workaround the bug by seeking from ios::beg explicitly.
* Factor cmInstallType out of cmTarget::TargetTypeBrad King2012-02-271-16/+17
| | | | | | The purpose of the TargetType enumeration was overloaded for install type because install rules were once recorded as targets. Factor the install types out into their own enumeration.
* Disable file() and string() hash commands during bootstrapBrad King2011-11-161-0/+7
| | | | | We do not compile support for the cryptographic hashes during bootstrap. Disable the APIs that use them.
* cmCryptoHash: Provide factory "New" methodBrad King2011-11-161-13/+1
| | | | | Construct a cmCryptoHash subclass instance based on the name of the desired hash algorithm.
* Add file(SHA*) commands to compute cryptographic hashesBrad King2011-11-161-1/+16
| | | | Add a file() command API for SHA1, SHA224, SHA256, SHA384, and SHA512.
* Add file(MD5) command to compute cryptographic hashBrad King2011-11-161-0/+36
| | | | | Provide a CMake-language binding to the md5sum function previously available only by "cmake -E md5sum".
* Make file(DOWNLOAD) fail on http errorBrad King2011-09-191-0/+4
| | | | | | | | If a http server responds with a result code greater than 400 then the data returned from the download probably do not match that expected. Teach file(DOWNLOAD) to fail with an error in this case instead of silently pretending that the download worked. The file(UPLOAD) command already does this.
* Fix file() command descriptor leak on errorThomas Jarosch2011-09-021-0/+2
| | | | | | Credit goes to "cppcheck". Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
* Teach file(DOWNLOAD|UPLOAD) to timeout after inactivityBrad King2011-06-011-0/+42
| | | | | Add option INACTIVITY_TIMEOUT to terminate the operation if there is no progress for more than a given amount of time.
* Merge topic 'require-cmake-2.6.3'Brad King2011-03-011-23/+7
|\ | | | | | | | | c3e452e Require at least CMake 2.6.3 to build current CMake
| * Require at least CMake 2.6.3 to build current CMakeBrad King2011-02-241-23/+7
| | | | | | | | Remove some cruft left for supporting builds with CMake 2.4.
* | Fix KWStyle line too long error (#11286)David Cole2011-02-281-1/+2
| |
* | Implement file(UPLOAD (#11286)David Cole2011-02-251-111/+306
|/ | | | Including documentation and testing, of course.
* Make file DOWNLOAD less noisy (#11761)David Cole2011-02-091-4/+0
| | | | Thanks to Daniel Nelson for the suggestion and the patch.
* file(DOWNLOAD): Fix error message formattingBrad King2010-09-101-58/+45
| | | | | | | The SetError method automatically starts the message with the name of the command. Fix up calls to it so that we get "file DOWNLOAD..." instead of "file FILE(DOWNLOAD ...". Also reduce length of long lines containing these calls.
* Merge branch 'file-write-umask'Brad King2010-06-071-12/+9
|\
| * Borland: No S_IWGRP is availableBrad King2010-06-031-0/+2
| |
| * Really trust umask in file(WRITE) command (#10789, #10126)Brad King2010-06-031-12/+7
| | | | | | | | | | | | | | | | | | Commit 8d0161c8 (Trust umask for file permissions, 2010-01-12) taught these commands to set permissions to 0666 explicitly. The intention was to let the open() call inside ofstream handle permsisions so that umask would be honored. Now we set permissions only when we need to preserve those on an existing file. New files will be created with umask-based permissions.
* | Merge branch 'improve-file-download'Brad King2010-06-071-16/+243
|\ \ | | | | | | | | | | | | Conflicts: Modules/ExternalProject.cmake
| * | Allow redirects: set CURLOPT_FOLLOWLOCATION to 1David Cole2010-06-041-0/+9
| | | | | | | | | | | | | | | | | | Enable file(DOWNLOAD ...) to follow redirects. Thanks to Michael Wild for requesting the addition and providing the majority of the patch.
| * | Fix unused variable warning in new code.David Cole2010-05-271-0/+3
| | |
| * | Improve FILE(DOWNLOAD) and ExternalProject.David Cole2010-05-271-16/+231
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve FILE(DOWNLOAD ...): - Add percent complete progress output to the FILE DOWNLOAD command. This progress output is off by default to preserve existing behavior. To turn it on, pass SHOW_PROGRESS as an argument. - Add EXPECTED_MD5 argument. Verify that the downloaded file has the expected md5 sum after download is complete. - Add documentation for SHOW_PROGRESS and EXPECTED_MD5. When the destination file exists already and has the expected md5 sum, then do not bother re-downloading the file. ("Short circuit" return.) Also, add a test that checks for the status output indicating that the short circuit behavior is actually occurring. Use a binary file for the test so that the md5 sum is guaranteed to be the same on all platforms regardless of "shifting text file line ending" issues. Improve ExternalProject: - Add argument URL_MD5. - Add verify step that compares md5 sum of .tar.gz file before extracting it. - Add md5 check to download step, too, to prevent unnecessary downloads. - Emit a warning message when a file is not verified. Indicate that the file may be corrupt or that no checksum was specified.
* | Avoid use of CopyAFile "copyPermissions" parameterBrad King2010-06-031-1/+8
|/ | | | | | | Commit 0fafdb7e (Do not copy permissions of files when making the copy in an install rule, 2008-12-18) added special behavior to KWSys file copy methods for this special case. Use a local solution to avoid use of the special behavior so it can be removed later.
* Handle non-ASCII terminators in file(STRINGS)Brad King2010-04-141-31/+19
| | | | | | | | | | Commit "Support more special characters in file(STRINGS)" (2009-10-06) attempted to support parsing strings from binaries produced by the Portland Group Fortran compiler. The compiler seems to put an extra byte just at the end of its string literals. Previously we dealt with this by explicitly enumerating bytes known to occur, but it seems that many such possibilities exist. Now we support extraction of strings that end in any non-ASCII character.
* Trust umask for file permissionsBrad King2010-01-121-4/+2
| | | | | Open output files with mode 0666 so that permissions are not more strict than umask permits. See issue #10126.
* Fix up download a bit, better error checking and uses of long not double for ↵Bill Hoffman2009-10-221-37/+124
| | | | timeout as curl needs, bug# 9748
* Fixed issues with message text in FILE command error situations. Added many ↵David Cole2009-10-171-8/+9
| | | | new test cases to increase the coverage of the FILE command even further.
* Use integer literal instead of characterBrad King2009-10-061-1/+1
| | | | | | | The commit "Support more special characters in file(STRINGS)" added code using a 'char' literal as an array index. Some compilers warn about this because char might be a signed type, leading to negative indices. We replace the literal with an integer to avoid the warning.
* Support more special characters in file(STRINGS)Brad King2009-10-061-1/+8
| | | | | | | | | The commits "Teach Fortran compiler identification about the Portland Group compiler" and "Fix previous change to file(STRINGS) command" taught file(STRINGS) to recognize the form-feed '\f' character as part of string literals. The Portland Group Fortran compiler also puts 0x14 bytes at the end of string literals in some cases. We generalize the previous solution and add the new character in this commit.
* Fix warnings in CMake source code. Suppress warnings in Lexer and Parser ↵David Cole2009-09-301-1/+3
| | | | files that are 'too hard' to fix.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* Add parentheses around '&&' between '||' for gccBrad King2009-09-111-2/+2
| | | | | | | The GNU compiler warns about possible operator precedence mistakes and asks for explicit parentheses (-Wparentheses). We add the parentheses to silence the warning. This also fixes one real logic error in the find_package() implementation by correcting expression evaluation order.
* Try to fix the failing new StringFileTest on HP-UXAlexander Neundorf2009-09-061-2/+2
| | | | | | | | | | It seems that while(i=file.get(), file) iterates one character too much on HP-UX, let's see whether while(file.get(c)) works, at least this is given as example on http://h30097.www3.hp.com/cplus/ifstream_3c__std.htm Alex
* fix #9316: when converting binary data to hex, also print the leading 0'sAlexander Neundorf2009-09-061-1/+1
| | | | Alex
* COMP: Avoid unused arg warnings in cmFileCommandBrad King2009-04-291-1/+1
| | | | | The default cmFileCopier::ReportCopy implementation is empty, so we should leave out the argument names.
* COMP: Fix nested class member accessBrad King2009-04-291-0/+2
| | | | | | Nested classes have no special access to other members of their enclosing class. In cmFileCopier the nested class MatchRule must use MatchProperties, so we grant friendship to it.
* COMP: Fix non-virtual destructor warningBrad King2009-04-291-0/+1
| | | | | | This gives cmFileCopier a virtual destructor since it has virtual methods. While we never actually delete through a base pointer (or dynamically at all), the compiler doesn't know and warns anyway.
* ENH: Create file(COPY) command signatureBrad King2009-04-291-14/+108
| | | | | | | | The file(INSTALL) command has long been undocumented and used only to implement install() scripts. We now document it and provide a similar file(COPY) signature which is useful in general-purpose scripts. It provides the capabilities of install(DIRECTORY) and install(FILES) but operates immediately instead of contributing to install scripts.
* ENH: Teach file(INSTALL) relative pathsBrad King2009-04-291-2/+19
| | | | | | | | | | | This teaches the undocumented file(INSTALL) command to deal with relative paths. Relative input file paths are evaluated with respect to the current source directory. Relative output file paths are evaluated with respect to the current binary directory. While this command is currently used only in cmake_install.cmake scripts (in -P script mode), this cleans up its interface in preparation for a documented signature.
* ENH: Refactor file(INSTALL) implementationBrad King2009-04-291-498/+583
| | | | | | The undocumented file(INSTALL) is implemented by a cmFileInstaller class inside cmFileCommand. This refactors the class to split out code not specific to installation into a cmFileCopier base class.
* ENH: Send all file installations through one pathBrad King2009-04-291-96/+79
| | | | | | This creates a single cmFileInstaller method to dispatch installation of symlinks, directories, and files. The change removes duplicate tests of input file type and makes the decision more consistent.
* ENH: Better error on file perm or time failureBrad King2009-04-291-26/+16
| | | | | This improves the error message produced during installation when CMake cannot set file modification time or permissions.
* BUG: Error when install dir cannot be createdBrad King2009-04-291-0/+4
| | | | | This teaches the undocumented file(INSTALL) command to report an error when it cannot create the destination directory.
* ENH: Simplify CMAKE_INSTALL_ALWAYS implementationBrad King2009-04-291-27/+20
| | | | | | This simplifies cmFileInstaller internally by storing the 'always' mark as an instance variable instead of passing it through all method signatures.
* ENH: Simplify construction of cmFileInstallerBrad King2009-04-291-3/+4
| | | | This cleans up the cmFileInstaller constructor signature.
* BUG: Fix required permissions check againBrad King2009-04-281-1/+1
| | | | | | While copying a directory the destination must have owner rwx permissions. This corrects our check, this time with correct operator precedence using parenthesis.
* ENH: Remove unused PROPERTIES from file(INSTALL)Brad King2009-04-271-37/+8
| | | | | The undocumented file(INSTALL) command used to support a PROPERTIES option, but no install code still uses it. This removes the option.