diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-03 21:02:28 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-03 21:02:28 +0000 |
commit | 062533f7cdb74026096ca8c7d5b6e393893d59ef (patch) | |
tree | cca64de7b3581072d1d9ecd11a31b053de68f6d5 /src/libstore/path-info.hh | |
parent | d92d4f85a5c8a2a2385c084500a8b6bd54b54e6c (diff) | |
parent | a2842588ec86a0f488a385d453eda86e1f52f05a (diff) |
Merge remote-tracking branch 'upstream/master' into path-info-header
Diffstat (limited to 'src/libstore/path-info.hh')
-rw-r--r-- | src/libstore/path-info.hh | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/libstore/path-info.hh b/src/libstore/path-info.hh index f5dee00a6..2a015ea3c 100644 --- a/src/libstore/path-info.hh +++ b/src/libstore/path-info.hh @@ -1,17 +1,9 @@ #pragma once -// TODO many of thes eare not needed. #include "path.hh" #include "hash.hh" #include "content-address.hh" -#include "serialise.hh" -#include "crypto.hh" -#include "lru-cache.hh" -#include "sync.hh" -#include "globals.hh" -#include "config.hh" - -#include <limits> + #include <string> #include <optional> @@ -20,11 +12,24 @@ namespace nix { class Store; + +struct SubstitutablePathInfo +{ + std::optional<StorePath> deriver; + StorePathSet references; + uint64_t downloadSize; /* 0 = unknown or inapplicable */ + uint64_t narSize; /* 0 = unknown */ +}; + +typedef std::map<StorePath, SubstitutablePathInfo> SubstitutablePathInfos; + + struct ValidPathInfo { StorePath path; std::optional<StorePath> deriver; - Hash narHash; + // TODO document this + std::optional<Hash> narHash; StorePathSet references; time_t registrationTime = 0; uint64_t narSize = 0; // 0 = unknown @@ -75,6 +80,12 @@ struct ValidPathInfo /* Return true iff the path is verifiably content-addressed. */ bool isContentAddressed(const Store & store) const; + /* Functions to view references + hasSelfReference as one set, mainly for + compatibility's sake. */ + StorePathSet referencesPossiblyToSelf() const; + void insertReferencePossiblyToSelf(StorePath && ref); + void setReferencesPossiblyToSelf(StorePathSet && refs); + static const size_t maxSigs = std::numeric_limits<size_t>::max(); /* Return the number of signatures on this .narinfo that were @@ -96,4 +107,5 @@ struct ValidPathInfo }; typedef list<ValidPathInfo> ValidPathInfos; + } |