mirror of
https://github.com/NixOS/nix.git
synced 2025-12-16 14:01:05 +01:00
WIP: still need to adapt flakeref parsing
This commit is contained in:
parent
4588a6ff3c
commit
eba85e2367
3 changed files with 19 additions and 15 deletions
|
|
@ -69,7 +69,7 @@ namespace nix {
|
|||
https://example.org/my/repo.git
|
||||
https://example.org/my/repo.git?ref=release-1.2.3
|
||||
https://example.org/my/repo.git?rev=e72daba8250068216d79d2aeef40d4d95aff6666
|
||||
git://github.com/edolstra/dwarffs.git\?ref=flake\&rev=2efca4bc9da70fb001b26c3dc858c6397d3c4817
|
||||
git://github.com/edolstra/dwarffs.git?ref=flake&rev=2efca4bc9da70fb001b26c3dc858c6397d3c4817
|
||||
|
||||
* /path.git(\?attr(&attr)*)?
|
||||
|
||||
|
|
@ -144,17 +144,18 @@ struct FlakeRef
|
|||
|
||||
std::optional<std::string> ref;
|
||||
std::optional<Hash> rev;
|
||||
Path subdir = ""; // This is a relative path pointing at the flake.nix file's directory, relative to the git root.
|
||||
|
||||
bool operator<(const FlakeRef & flakeRef) const
|
||||
{
|
||||
return std::make_tuple(this->data, ref, rev) <
|
||||
std::make_tuple(flakeRef.data, flakeRef.ref, flakeRef.rev);
|
||||
return std::make_tuple(data, ref, rev, subdir) <
|
||||
std::make_tuple(flakeRef.data, flakeRef.ref, flakeRef.rev, subdir);
|
||||
}
|
||||
|
||||
bool operator==(const FlakeRef & flakeRef) const
|
||||
{
|
||||
return std::make_tuple(this->data, ref, rev) ==
|
||||
std::make_tuple(flakeRef.data, flakeRef.ref, flakeRef.rev);
|
||||
return std::make_tuple(data, ref, rev, subdir) ==
|
||||
std::make_tuple(flakeRef.data, flakeRef.ref, flakeRef.rev, flakeRef.subdir);
|
||||
}
|
||||
|
||||
// Parse a flake URI.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue