summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmSystemTools: Provide quiet link creation methodsBrad King2022-10-061-4/+16
| | | | Offer variants that let the caller handle error messages.
* Merge topic 'parse-large-int'Brad King2022-09-211-2/+8
|\ | | | | | | | | | | | | | | | | 8fc822e13a file: Avoid strange istringstream crash in cmake.org binaries on Alpine Linux 31f158e4c8 cmStringAlgorithms: Add functions to parse strings to long long integers Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7698
| * file: Avoid strange istringstream crash in cmake.org binaries on Alpine LinuxBrad King2022-09-201-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | Somehow using `istringstream` and `operator >>` to parse an integer crashes on Alpine Linux, at least when compiled with the settings we use for the official `cmake.org` Linux binaries. Since commit fd0c285b12 (file: Fix types of the OFFSET and LIMIT arguments, 2022-01-04, v3.23.0-rc1~133^2), this causes the `file(READ)` command to crash when parsing its `LIMIT` or `OFFSET` argument. Parse the input string with our dedicated helper to avoid the crash. Fixes: #23872
* | file(DOWNLOAD): Fix message for existing file with matching hashMichael Hirsch2022-08-231-1/+1
| | | | | | | | | | | | | | | | | | file(DOWNLOAD STATUS) docs say the return list is of length 2. However, when an already downloaded file hash matches EXPECTED_HASH, the return message had a semicolon that made the return list length 3. Adjust the message to no longer contain the extra semicolon and to more clearly describe the situation.
* | cmFileCommand: Capture list of parsed keywords via bindingBrad King2022-07-251-7/+8
| |
* | cmArgumentParser: Drop unused keywordsMissingValue argument to Parse()Brad King2022-07-251-3/+2
| | | | | | | | | | All clients have been converted to encoding this requirement in their bindings.
* | cmFileCommand: Report keyword errors via argument parser resultsBrad King2022-07-221-97/+67
| |
* | cmFileCommand: Use cm::optional for keyword argument presenceBrad King2022-07-201-32/+18
| |
* | cmArgumentParser: Model maybe-missing string with wrapper typeBrad King2022-07-071-24/+14
| | | | | | | | | | | | Bindings to `std::string` require one value. Some clients have been filtering `keywordsMissingValue` to support keywords that tolerate a missing value. Offer them a type-safe way to achieve this instead.
* | cmArgumentParser: Model maybe-empty and non-empty lists with wrapper typesBrad King2022-07-071-44/+28
| | | | | | | | | | | | | | | | Previously bindings to `std::vector<std::string>` required at least one value. Some clients have been filtering `keywordsMissingValue` to support keywords followed by empty lists. Instead, require clients to specify whether a keyword's list can be empty as part of the binding type.
* | Merge topic 'file-TIMESTAMP-relative-path'Brad King2022-07-071-1/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | 733801b57f file(TIMESTAMP): Interpret relative paths w.r.t. the source tree Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7440
| * | file(TIMESTAMP): Interpret relative paths w.r.t. the source treeTheBrokenRail2022-07-061-1/+5
| | | | | | | | | | | | Fixes: #23610
* | | cmFileCommand: Use cm::optional for keyword argument presenceBrad King2022-07-051-83/+61
| | |
* | | cmArgumentParser: Require callers to consider unparsed argumentsBrad King2022-07-051-2/+4
| | |
* | | cmArgumentParser: Avoid allocating copies of keyword stringsBrad King2022-07-051-39/+39
|/ /
* | file(ARCHIVE*): Simplify acceptance of empty list argumentsBrad King2022-06-291-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `cmArgumentParser`, a keyword bound to a `std::vector<std::string>` value is reported in the list of keywords with missing values if the keyword appears followed by an empty list. For cases where we want to tolerate empty lists, clients need to filter out such keywords themselves before producing an error message. This may be improved in the future, but that is out of scope here. In commit c7e1198a23 (file: Add ARCHIVE_{CREATE|EXTRACT} subcommands, 2020-03-13, v3.18.0-rc1~530^2), a pattern for filtering out keywords that accept empty lists was copied from commit c998c8d560 (file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments, 2020-01-22, v3.17.0-rc1~111^2~1) incorrectly in two ways: * Keywords were included in the filter that do not accept empty lists. * Keywords were not in sorted order, breaking the filter operation. Those two bugs mostly canceled each other out, and the resulting behavior was to correctly report keywords with missing values. However, the `MTIME` keyword was accidentally accepted with no value by pretending the keyword was not given at all. Simplify the logic by removing keywords from the filters that should not be there. Leave `MTIME` in the filter for compatibility.
* | cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-39/+39
| | | | | | | | | | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* | Merge topic 'curl-debug-callback'Brad King2022-05-241-2/+2
|\ \ | | | | | | | | | | | | | | | | | | e243b379ca cmFileCommand: Fix signature of CURLOPT_DEBUGFUNCTION callback Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7288
| * | cmFileCommand: Fix signature of CURLOPT_DEBUGFUNCTION callbackBrad King2022-05-231-2/+2
| | | | | | | | | | | | Curl documents that the callback should return type `int`.
* | | cmFileCommand: remove an unnecessary castBen Boeckel2022-05-241-1/+1
| | | | | | | | | | | | `cmCryptoHash::New` already returns a `unique_ptr`.
* | | clang-tidy: fix `performance-unnecessary-copy-initialization` lintsBen Boeckel2022-05-241-1/+1
|/ /
* | cmake -E tar: Add --touch optionKasper Laudrup2022-03-231-3/+8
| | | | | | | | | | | | | | | | 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: #22746
* | file(DOWNLOAD): Add options to download a rangem.klimenko2022-02-151-0/+31
|/
* file: Fix types of the OFFSET and LIMIT argumentsAlexey Edelev2022-01-131-14/+9
| | | | | | | | | | OFFSET argument cannot handle offsets bigger than INT_MAX because of the atoi function, which is used to convert the argument string to integer. Same applies for the LIMIT argument. Use the steam based reading and 64-bit types to convert and store arguments to avoid invalid values stored in the corresponding variables. Fixes: #23076
* Merge topic 'file-READ_ELF-capture-error'Brad King2022-01-121-3/+8
|\ | | | | | | | | | | | | | | 41bebbe50a file: Restore error capture in undocumented READ_ELF mode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6853
| * file: Restore error capture in undocumented READ_ELF modeBrad King2022-01-111-3/+8
| | | | | | | | | | | | | | | | | | Revise the error message added by commit 115ff6a347 (cmELF: Include the ELF parsing code unconditionally, 2021-06-17, v3.22.0-rc1~557^2) to honor the `CAPTURE_ERROR` option. This is needed by the call site in `BundleUtilities` to suppress errors on non-ELF files. Fixes: #23074
* | cmFileCommand: Update for new signature of GetLineFromStreamBrad King2022-01-111-6/+4
| |
* | Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-3/+4
|/
* cmFileCommand: improve error messageSeth R Johnson2021-10-121-3/+6
| | | | | Print full list of unresolved dependencies and a phrase that indicates what about the file is unresolved.
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-1/+2
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-5/+5
|
* cmCurlSetCAInfo: use std::string as argumentMarc Chevrier2021-09-191-2/+2
|
* cmCurl: Adopt helper to fix file:// URLsBrad King2021-09-151-35/+2
| | | | | | Migrate and generalize the helper added by commit e63dcb1378 (Encoding: Use encoding libcurl expects with file: urls., 2014-11-05, v3.2.0-rc1~420^2).
* cmProp: refactoring: transform alias in classMarc Chevrier2021-08-081-2/+2
| | | | | | To handle safely the values used by CMake variables and properties, introduce the class cmProp as a replacement from the simple pointer to std::string instance.
* cmELF: Include the ELF parsing code unconditionallyAlex Richardson2021-06-241-14/+6
| | | | | Now that the ELF definitions are provided on all platforms there is no need to keep the CMake_USE_ELF_PARSER option.
* install(TARGETS): Add RUNTIME_DEPENDENCIES optionKyle Edwards2021-06-041-3/+2
|
* file: Add undocumented RPATH_SET commandKyle Edwards2021-06-041-0/+61
|
* Refactor: Modify file(RPATH_*) to use cmArgumentParserKyle Edwards2021-06-041-77/+61
|
* file(GET_RUNTIME_DEPENDENCIES): Add undocumented RPATH_PREFIX optionKyle Edwards2021-06-041-0/+7
|
* file(GET_RUNTIME_DEPENDENCIES): Add POST_{IN,EX}CLUDE_FILES argumentsKyle Edwards2021-06-011-10/+24
|
* cmFileCommand: Remove unused local variableBrad King2021-04-281-3/+0
|
* file(REAL_PATH): add option EXPAND_TILDEMarc Chevrier2021-04-211-3/+20
| | | | | This option enables the replacement of any leading tilde with the path to the user's home directory.
* cmSystemTools: Return KWSys Status from CreateLink and CreateSymlinkBrad King2021-04-151-2/+4
|
* Update CMake code using KWSys to account for Status return valuesBrad King2021-04-141-3/+6
| | | | | | KWSys as of 2021-04-14 changed the return type of `SystemTools` operations from `bool` to `Status`. Update our call sites. This may improve error reporting accuracy in a few places.
* Merge topic 'commands-file-permissions'Brad King2021-03-291-7/+7
|\ | | | | | | | | | | | | | | | | | | 769ff05483 Help: Clarify permission-related command options 900184616a Cleanup: Fix misspelt name of local C++ variable 635431a0c9 Tests: Check host platform instead of target for running stat 4ceb0ca59e Tests: Remove redundant files for configure_file() tests Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5945
| * Cleanup: Fix misspelt name of local C++ variableCraig Scott2021-03-261-7/+7
| |
* | file: add `COPY_FILE` subcommandBen Boeckel2021-03-101-0/+92
| | | | | | | | | | | | The `file(COPY)` subcommand is overloaded and busy for such a simple operation. Instead, make a simpler subcommand with error handling support.
* | file(RENAME): Add option to not replace existing pathBrad King2021-03-041-3/+14
| | | | | | | | | | Add a `NO_REPLACE` option that prevents overwriting `<newname>` if it exists.
* | cmSystemTools: Add RenameFile option to not replace destinationBrad King2021-03-041-1/+3
| |
* | file(RENAME): Add option to capture error message on failureBrad King2021-03-041-7/+34
|/