aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/path.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-12-16 19:11:47 +0100
committerEelco Dolstra <edolstra@gmail.com>2019-12-16 19:11:47 +0100
commit54bf5ba4227a234f8cd5102634b9a3b535e6fbdb (patch)
tree39878e4f41297705b5a8b637ed094c0998e8eca1 /src/libstore/path.hh
parent14d82baba4ebb82df28c2d4e9517f8c3a81d8f6c (diff)
nix-store -r: Handle symlinks to store paths
Fixes #3270.
Diffstat (limited to 'src/libstore/path.hh')
-rw-r--r--src/libstore/path.hh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libstore/path.hh b/src/libstore/path.hh
index 273808f02..5ebb57480 100644
--- a/src/libstore/path.hh
+++ b/src/libstore/path.hh
@@ -7,6 +7,8 @@ namespace nix {
/* See path.rs. */
struct StorePath;
+struct Store;
+
extern "C" {
void ffi_StorePath_drop(void *);
bool ffi_StorePath_less_than(const StorePath & a, const StorePath & b);
@@ -67,6 +69,28 @@ const size_t storePathHashLen = 32; // i.e. 160 bits
/* Extension of derivations in the Nix store. */
const std::string drvExtension = ".drv";
+struct StorePathWithOutputs
+{
+ StorePath path;
+ std::set<std::string> outputs;
+
+ StorePathWithOutputs(const StorePath & path, const std::set<std::string> & outputs = {})
+ : path(path.clone()), outputs(outputs)
+ { }
+
+ StorePathWithOutputs(StorePath && path, std::set<std::string> && outputs)
+ : path(std::move(path)), outputs(std::move(outputs))
+ { }
+
+ StorePathWithOutputs(const StorePathWithOutputs & other)
+ : path(other.path.clone()), outputs(other.outputs)
+ { }
+
+ std::string to_string(const Store & store) const;
+};
+
+std::pair<std::string_view, StringSet> parsePathWithOutputs(std::string_view s);
+
}
namespace std {