mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-31 15:36:47 +02:00
Rename UnionInputAccessor to MountedInputAccessor
This commit is contained in:
parent
21140c987b
commit
7f576f5dfe
4 changed files with 19 additions and 19 deletions
|
@ -9,7 +9,7 @@
|
||||||
#include "processes.hh"
|
#include "processes.hh"
|
||||||
#include "git.hh"
|
#include "git.hh"
|
||||||
#include "fs-input-accessor.hh"
|
#include "fs-input-accessor.hh"
|
||||||
#include "union-input-accessor.hh"
|
#include "mounted-input-accessor.hh"
|
||||||
#include "git-utils.hh"
|
#include "git-utils.hh"
|
||||||
|
|
||||||
#include "fetch-settings.hh"
|
#include "fetch-settings.hh"
|
||||||
|
@ -587,7 +587,7 @@ struct GitInputScheme : InputScheme
|
||||||
|
|
||||||
auto accessor = repo->getAccessor(rev);
|
auto accessor = repo->getAccessor(rev);
|
||||||
|
|
||||||
/* If the repo has submodules, fetch them and return a union
|
/* If the repo has submodules, fetch them and return a mounted
|
||||||
input accessor consisting of the accessor for the top-level
|
input accessor consisting of the accessor for the top-level
|
||||||
repo and the accessors for the submodules. */
|
repo and the accessors for the submodules. */
|
||||||
if (repoInfo.submodules) {
|
if (repoInfo.submodules) {
|
||||||
|
@ -611,7 +611,7 @@ struct GitInputScheme : InputScheme
|
||||||
|
|
||||||
if (!mounts.empty()) {
|
if (!mounts.empty()) {
|
||||||
mounts.insert_or_assign(CanonPath::root, accessor);
|
mounts.insert_or_assign(CanonPath::root, accessor);
|
||||||
accessor = makeUnionInputAccessor(std::move(mounts));
|
accessor = makeMountedInputAccessor(std::move(mounts));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -636,7 +636,7 @@ struct GitInputScheme : InputScheme
|
||||||
ref<InputAccessor> accessor =
|
ref<InputAccessor> accessor =
|
||||||
makeFSInputAccessor(CanonPath(repoInfo.url), repoInfo.workdirInfo.files, makeNotAllowedError(repoInfo.url));
|
makeFSInputAccessor(CanonPath(repoInfo.url), repoInfo.workdirInfo.files, makeNotAllowedError(repoInfo.url));
|
||||||
|
|
||||||
/* If the repo has submodules, return a union input accessor
|
/* If the repo has submodules, return a mounted input accessor
|
||||||
consisting of the accessor for the top-level repo and the
|
consisting of the accessor for the top-level repo and the
|
||||||
accessors for the submodule workdirs. */
|
accessors for the submodule workdirs. */
|
||||||
if (repoInfo.submodules && !repoInfo.workdirInfo.submodules.empty()) {
|
if (repoInfo.submodules && !repoInfo.workdirInfo.submodules.empty()) {
|
||||||
|
@ -660,7 +660,7 @@ struct GitInputScheme : InputScheme
|
||||||
}
|
}
|
||||||
|
|
||||||
mounts.insert_or_assign(CanonPath::root, accessor);
|
mounts.insert_or_assign(CanonPath::root, accessor);
|
||||||
accessor = makeUnionInputAccessor(std::move(mounts));
|
accessor = makeMountedInputAccessor(std::move(mounts));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!repoInfo.workdirInfo.isDirty) {
|
if (!repoInfo.workdirInfo.isDirty) {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#include "union-input-accessor.hh"
|
#include "mounted-input-accessor.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
struct UnionInputAccessor : InputAccessor
|
struct MountedInputAccessor : InputAccessor
|
||||||
{
|
{
|
||||||
std::map<CanonPath, ref<InputAccessor>> mounts;
|
std::map<CanonPath, ref<InputAccessor>> mounts;
|
||||||
|
|
||||||
UnionInputAccessor(std::map<CanonPath, ref<InputAccessor>> _mounts)
|
MountedInputAccessor(std::map<CanonPath, ref<InputAccessor>> _mounts)
|
||||||
: mounts(std::move(_mounts))
|
: mounts(std::move(_mounts))
|
||||||
{
|
{
|
||||||
// Currently we require a root filesystem. This could be relaxed.
|
// Currently we require a root filesystem. This could be relaxed.
|
||||||
|
@ -71,9 +71,9 @@ struct UnionInputAccessor : InputAccessor
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ref<InputAccessor> makeUnionInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts)
|
ref<InputAccessor> makeMountedInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts)
|
||||||
{
|
{
|
||||||
return make_ref<UnionInputAccessor>(std::move(mounts));
|
return make_ref<MountedInputAccessor>(std::move(mounts));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
9
src/libfetchers/mounted-input-accessor.hh
Normal file
9
src/libfetchers/mounted-input-accessor.hh
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "input-accessor.hh"
|
||||||
|
|
||||||
|
namespace nix {
|
||||||
|
|
||||||
|
ref<InputAccessor> makeMountedInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts);
|
||||||
|
|
||||||
|
}
|
|
@ -1,9 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "input-accessor.hh"
|
|
||||||
|
|
||||||
namespace nix {
|
|
||||||
|
|
||||||
ref<InputAccessor> makeUnionInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts);
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue