forked from lix-project/lix
Minor updates to inline comments
Add missing docstring on InstallableCommand. Also, some of these were wrapped when they're right next to a line longer than the unwrapped line, so we can just unwrap them to save vertical space.
This commit is contained in:
parent
e5319a87ce
commit
80d5ec6ff4
|
@ -45,9 +45,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,
|
||||||
|
|
||||||
if (!clean) {
|
if (!clean) {
|
||||||
|
|
||||||
/* This is an unclean working tree. So copy all tracked
|
/* This is an unclean working tree. So copy all tracked files. */
|
||||||
files. */
|
|
||||||
|
|
||||||
GitInfo gitInfo;
|
GitInfo gitInfo;
|
||||||
gitInfo.rev = "0000000000000000000000000000000000000000";
|
gitInfo.rev = "0000000000000000000000000000000000000000";
|
||||||
gitInfo.shortRev = std::string(gitInfo.rev, 0, 7);
|
gitInfo.shortRev = std::string(gitInfo.rev, 0, 7);
|
||||||
|
|
|
@ -3264,8 +3264,7 @@ void DerivationGoal::registerOutputs()
|
||||||
i.second.parseHashInfo(recursive, h);
|
i.second.parseHashInfo(recursive, h);
|
||||||
|
|
||||||
if (!recursive) {
|
if (!recursive) {
|
||||||
/* The output path should be a regular file without
|
/* The output path should be a regular file without execute permission. */
|
||||||
execute permission. */
|
|
||||||
if (!S_ISREG(st.st_mode) || (st.st_mode & S_IXUSR) != 0)
|
if (!S_ISREG(st.st_mode) || (st.st_mode & S_IXUSR) != 0)
|
||||||
throw BuildError(
|
throw BuildError(
|
||||||
format("output path '%1%' should be a non-executable regular file") % path);
|
format("output path '%1%' should be a non-executable regular file") % path);
|
||||||
|
@ -3343,8 +3342,7 @@ void DerivationGoal::registerOutputs()
|
||||||
% drvPath % path);
|
% drvPath % path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Since we verified the build, it's now ultimately
|
/* Since we verified the build, it's now ultimately trusted. */
|
||||||
trusted. */
|
|
||||||
if (!info.ultimate) {
|
if (!info.ultimate) {
|
||||||
info.ultimate = true;
|
info.ultimate = true;
|
||||||
worker.store.signPathInfo(info);
|
worker.store.signPathInfo(info);
|
||||||
|
@ -3354,8 +3352,7 @@ void DerivationGoal::registerOutputs()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For debugging, print out the referenced and unreferenced
|
/* For debugging, print out the referenced and unreferenced paths. */
|
||||||
paths. */
|
|
||||||
for (auto & i : inputPaths) {
|
for (auto & i : inputPaths) {
|
||||||
PathSet::iterator j = references.find(i);
|
PathSet::iterator j = references.find(i);
|
||||||
if (j == references.end())
|
if (j == references.end())
|
||||||
|
@ -3413,8 +3410,7 @@ void DerivationGoal::registerOutputs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this is the first round of several, then move the output out
|
/* If this is the first round of several, then move the output out of the way. */
|
||||||
of the way. */
|
|
||||||
if (nrRounds > 1 && curRound == 1 && curRound < nrRounds && keepPreviousRound) {
|
if (nrRounds > 1 && curRound == 1 && curRound < nrRounds && keepPreviousRound) {
|
||||||
for (auto & i : drv->outputs) {
|
for (auto & i : drv->outputs) {
|
||||||
Path prev = i.second.path + checkSuffix;
|
Path prev = i.second.path + checkSuffix;
|
||||||
|
|
|
@ -937,8 +937,7 @@ void LocalStore::registerValidPaths(const ValidPathInfos & infos)
|
||||||
not be valid yet. */
|
not be valid yet. */
|
||||||
for (auto & i : infos)
|
for (auto & i : infos)
|
||||||
if (isDerivation(i.path)) {
|
if (isDerivation(i.path)) {
|
||||||
// FIXME: inefficient; we already loaded the
|
// FIXME: inefficient; we already loaded the derivation in addValidPath().
|
||||||
// derivation in addValidPath().
|
|
||||||
Derivation drv = readDerivation(realStoreDir + "/" + baseNameOf(i.path));
|
Derivation drv = readDerivation(realStoreDir + "/" + baseNameOf(i.path));
|
||||||
checkDerivationOutputs(i.path, drv);
|
checkDerivationOutputs(i.path, drv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -632,8 +632,7 @@ static void opDelete(Strings opFlags, Strings opArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Dump a path as a Nix archive. The archive is written to standard
|
/* Dump a path as a Nix archive. The archive is written to stdout */
|
||||||
output. */
|
|
||||||
static void opDump(Strings opFlags, Strings opArgs)
|
static void opDump(Strings opFlags, Strings opArgs)
|
||||||
{
|
{
|
||||||
if (!opFlags.empty()) throw UsageError("unknown flag");
|
if (!opFlags.empty()) throw UsageError("unknown flag");
|
||||||
|
@ -646,8 +645,7 @@ static void opDump(Strings opFlags, Strings opArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Restore a value from a Nix archive. The archive is read from
|
/* Restore a value from a Nix archive. The archive is read from stdin. */
|
||||||
standard input. */
|
|
||||||
static void opRestore(Strings opFlags, Strings opArgs)
|
static void opRestore(Strings opFlags, Strings opArgs)
|
||||||
{
|
{
|
||||||
if (!opFlags.empty()) throw UsageError("unknown flag");
|
if (!opFlags.empty()) throw UsageError("unknown flag");
|
||||||
|
|
|
@ -34,7 +34,7 @@ struct Command : virtual Args
|
||||||
|
|
||||||
class Store;
|
class Store;
|
||||||
|
|
||||||
/* A command that require a Nix store. */
|
/* A command that requires a Nix store. */
|
||||||
struct StoreCommand : virtual Command
|
struct StoreCommand : virtual Command
|
||||||
{
|
{
|
||||||
StoreCommand();
|
StoreCommand();
|
||||||
|
@ -115,6 +115,7 @@ private:
|
||||||
std::vector<std::string> _installables;
|
std::vector<std::string> _installables;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* A command that operates on exactly one "installable" */
|
||||||
struct InstallableCommand : virtual Args, SourceExprCommand
|
struct InstallableCommand : virtual Args, SourceExprCommand
|
||||||
{
|
{
|
||||||
std::shared_ptr<Installable> installable;
|
std::shared_ptr<Installable> installable;
|
||||||
|
|
Loading…
Reference in a new issue