aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derived-path.hh
diff options
context:
space:
mode:
authorRaphael Robatsch <raphael-git@tapesoftware.net>2023-04-13 16:22:45 +0200
committerRaphael Robatsch <raphael-git@tapesoftware.net>2023-04-14 10:32:03 +0200
commit9e8f2090365a509656dead69bc91fb6615cf9d05 (patch)
tree08c6f9a17689f6166a76e0fe82c0d52e48391195 /src/libstore/derived-path.hh
parentef0b48377d0fc79d70455c402ed4df4b18cb93dd (diff)
Display valid installable in InstallableDerivedPath::parse warning
The warning message should produce an installable name that can be passed to `nix build`, `nix path-info`, etc. again. Since the CLI expects that the .drv path and the output names are separated by a caret, the warning message must also separate the .drv path and output names with a caret. However, `DerivedPath::Built.to_string()` uses an exclamation point as the separator instead. This commit adds a `separator` argument to the to_string method. This changes the warning message from: If this command is now failing try again with '/nix/store/foo.drv!*' to: If this command is now failing try again with '/nix/store/foo.drv^*'
Diffstat (limited to 'src/libstore/derived-path.hh')
-rw-r--r--src/libstore/derived-path.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/derived-path.hh b/src/libstore/derived-path.hh
index 2155776b1..9fc64e2f2 100644
--- a/src/libstore/derived-path.hh
+++ b/src/libstore/derived-path.hh
@@ -48,7 +48,7 @@ struct DerivedPathBuilt {
StorePath drvPath;
OutputsSpec outputs;
- std::string to_string(const Store & store) const;
+ std::string to_string(const Store & store, char separator = '!') const;
static DerivedPathBuilt parse(const Store & store, std::string_view, std::string_view);
nlohmann::json toJSON(ref<Store> store) const;
@@ -81,7 +81,7 @@ struct DerivedPath : _DerivedPathRaw {
return static_cast<const Raw &>(*this);
}
- std::string to_string(const Store & store) const;
+ std::string to_string(const Store & store, char separator = '!') const;
static DerivedPath parse(const Store & store, std::string_view);
};