aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r--src/libexpr/primops/flake.cc11
-rw-r--r--src/libexpr/primops/flake.hh7
2 files changed, 8 insertions, 10 deletions
diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc
index 6998536ec..c08c30c9c 100644
--- a/src/libexpr/primops/flake.cc
+++ b/src/libexpr/primops/flake.cc
@@ -482,9 +482,8 @@ ResolvedFlake resolveFlake(EvalState & state, const FlakeRef & topRef, HandleLoc
return resFlake;
}
-void updateLockFile(EvalState & state, const FlakeUri & flakeUri, bool recreateLockFile)
+void updateLockFile(EvalState & state, const FlakeRef & flakeRef, bool recreateLockFile)
{
- FlakeRef flakeRef(flakeUri);
resolveFlake(state, flakeRef, recreateLockFile ? RecreateLockFile : UpdateLockFile);
}
@@ -551,10 +550,8 @@ static void prim_getFlake(EvalState & state, const Pos & pos, Value * * args, Va
static RegisterPrimOp r2("getFlake", 1, prim_getFlake);
-void gitCloneFlake (std::string flakeUri, EvalState & state, Registries registries,
- Path endDirectory)
+void gitCloneFlake(FlakeRef flakeRef, EvalState & state, Registries registries, const Path & destDir)
{
- FlakeRef flakeRef(flakeUri);
flakeRef = lookupFlake(state, flakeRef, registries);
std::string uri;
@@ -576,8 +573,8 @@ void gitCloneFlake (std::string flakeUri, EvalState & state, Registries registri
}
}
- if (endDirectory != "")
- args.push_back(endDirectory);
+ if (destDir != "")
+ args.push_back(destDir);
runProgram("git", true, args);
}
diff --git a/src/libexpr/primops/flake.hh b/src/libexpr/primops/flake.hh
index e43b860ee..8eaac9d96 100644
--- a/src/libexpr/primops/flake.hh
+++ b/src/libexpr/primops/flake.hh
@@ -64,7 +64,7 @@ typedef std::vector<std::shared_ptr<FlakeRegistry>> Registries;
Path getUserRegistryPath();
-enum HandleLockFile
+enum HandleLockFile : unsigned int
{ AllPure // Everything is handled 100% purely
, TopRefUsesRegistries // The top FlakeRef uses the registries, apart from that, everything happens 100% purely
, UpdateLockFile // Update the existing lockfile and write it to file
@@ -133,7 +133,8 @@ struct ResolvedFlake
ResolvedFlake resolveFlake(EvalState &, const FlakeRef &, HandleLockFile);
-void updateLockFile(EvalState &, const FlakeUri &, bool recreateLockFile);
+void updateLockFile(EvalState &, const FlakeRef & flakeRef, bool recreateLockFile);
+
+void gitCloneFlake(FlakeRef flakeRef, EvalState &, Registries, const Path & destDir);
-void gitCloneFlake (std::string flakeUri, EvalState &, Registries, Path);
}