mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
* Merge addToStore and addToStoreFixed.
* addToStore now adds unconditionally, it doesn't use readOnlyMode. Read-only operation is up to the caller (who can call computeStorePathForPath).
This commit is contained in:
parent
ceb982a1be
commit
a824d58b56
11 changed files with 40 additions and 96 deletions
|
@ -63,14 +63,11 @@ public:
|
|||
PathSet & referrers) = 0;
|
||||
|
||||
/* Copy the contents of a path to the store and register the
|
||||
validity the resulting path. The resulting path is
|
||||
returned. */
|
||||
virtual Path addToStore(const Path & srcPath) = 0;
|
||||
|
||||
/* Like addToStore(), but for pre-adding the outputs of
|
||||
fixed-output derivations. */
|
||||
virtual Path addToStoreFixed(bool recursive, string hashAlgo,
|
||||
const Path & srcPath) = 0;
|
||||
validity the resulting path. The resulting path is returned.
|
||||
If `fixed' is true, then the output of a fixed-output
|
||||
derivation is pre-loaded into the Nix store. */
|
||||
virtual Path addToStore(const Path & srcPath, bool fixed = false,
|
||||
bool recursive = false, string hashAlgo = "") = 0;
|
||||
|
||||
/* Like addToStore, but the contents written to the output path is
|
||||
a regular file containing the given string. */
|
||||
|
@ -119,8 +116,8 @@ Path makeFixedOutputPath(bool recursive,
|
|||
it computes the store path to which srcPath is to be copied.
|
||||
Returns the store path and the cryptographic hash of the
|
||||
contents of srcPath. */
|
||||
std::pair<Path, Hash> computeStorePathForPath(bool fixed, bool recursive,
|
||||
string hashAlgo, const Path & srcPath);
|
||||
std::pair<Path, Hash> computeStorePathForPath(const Path & srcPath,
|
||||
bool fixed = false, bool recursive = false, string hashAlgo = "");
|
||||
|
||||
/* Preparatory part of addTextToStore().
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue