You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a marker .download file to validate the contents in cache directories.
Previously only the existence of the directory was used, so if the
download was aborted the cache directory had to be deleted manually if
this occurred (with a likely cryptic error message).
If the .download check file does not exist, the directory will be deleted
and downloaded again.
It is also possible to check the contents with a checksum.
If not matching, the directory will be deleted and downloaded again.
For Git repos the repos can be deleted if the status is not clean,
a checksum is not relevant (but used in the tests).
Copy file name to clipboardExpand all lines: README.md
+14
Original file line number
Diff line number
Diff line change
@@ -196,6 +196,12 @@ You can use `CPM_SOURCE_CACHE` on GitHub Actions workflows [cache](https://githu
196
196
The directory where the version for a project is stored is by default the hash of the arguments to `CPMAddPackage()`.
197
197
If for instance the patch command uses external files, the directory name can be set with the argument `CUSTOM_CACHE_KEY`.
198
198
199
+
It is possible to check the integrity of the downloaded content with a checksum by adding a [checksum command](test/unit/checksum_directory.sh) to `CPMAddPackage()`.
200
+
Checksum validation can be done in two ways:
201
+
202
+
- Setting the option `CPM_CHECK_CACHE_CHECKSUM` to validate to the checksum calculated when downloading the project.
203
+
- Providing the checksum in the call to `CPMAddPackage()`.
204
+
199
205
### CPM_DOWNLOAD_ALL
200
206
201
207
If set, CPM will forward all calls to `CPMFindPackage` as `CPMAddPackage`.
@@ -219,6 +225,14 @@ Note that this does not apply to dependencies that have been defined with a trut
219
225
If set, CPM use additional directory level in cache to improve readability of packages names in IDEs like CLion. It changes cache structure, so all dependencies are downloaded again. There is no problem to mix both structures in one cache directory but then there may be 2 copies of some dependencies.
220
226
This can also be set as an environmental variable.
221
227
228
+
### CPM_CHECK_CACHE_CHECKSUM
229
+
230
+
Enable validation of the checksum for a cache directory if a command to checksum the directory is provided. The validation is performed to a supplied checksum if provided, otherwise the checksum detected when downloading the dependency.
231
+
232
+
If `GIT_TAG` is set, `git-status` will check the status, checksum command is not required.
233
+
234
+
If the check fails, an existing directory will be deleted and downloaded again.
235
+
222
236
## Local package override
223
237
224
238
Library developers are often in the situation where they work on a locally checked out dependency at the same time as on a consumer project.
0 commit comments