summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* file: Avoid using deprecated curl progress callbackBrad King2023-01-271-9/+21
|
* file(MAKE_DIRECTORY): Provide a more descriptive error messageTerence Noone2022-12-081-2/+4
| | | | | | Previously, MAKE_DIRECTORY would print `problem creating directory: {}`, which was very unhelpful for debugging. Extend the message with the OS error string.
* file(COPY_FILE): Add option to retry on Windows if input access failsBrad King2022-11-171-1/+7
| | | | | | | | On Windows, a file may be inaccessible for a short time after it is created. This occurs for various reasons, including indexing, antivirus tools, and NTFS's asynchronous semantics. Add an `INPUT_MAY_BE_RECENT` option to tell CMake that the input file may have been recently created so that we can retry a few times to read it.
* file(ARCHIVE_CREATE): Allow higher compression level for ZstdAmir Masoud Abdol2022-11-161-7/+16
| | | | | | | | This allows the Zstd compression-level to be set between 0-19. I've adjusted some of the tests, and error messages to indicates the selected algorithm, and min/max of its compression-level. Fixes: #24160
* cmGeneratorExpression: Require cmake instanceKyle Edwards2022-11-111-2/+4
|
* file(DOWNLOAD EXPECTED_HASH): better error message when download failedAurelien Regat-Barrel2022-11-091-5/+9
|
* file(DOWNLOAD): Fix LOG with EXPECTED_HASH on download failureAurelien Regat-Barrel2022-10-301-5/+7
| | | | | | | | | When `file(DOWNLOAD <url> EXPECTED_HASH <hash> LOG <logs>)` fails to download the requested file, the hash check will also fail and make the command exit without actually returning the curl logs as requested by the `LOG` argument. Report the log before checking the hash. Issue: #24093
* 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
|