* Allow unprivileged users to do `nix-store --clear-failed-paths' and
`nix-store --query-failed-paths'.
This commit is contained in:
parent
7fa338f4ba
commit
f92c9a0ac5
7 changed files with 51 additions and 5 deletions
|
|
@ -184,11 +184,8 @@ public:
|
|||
/* Query whether `path' previously failed to build. */
|
||||
bool hasPathFailed(const Path & path);
|
||||
|
||||
/* Return the set of paths that have failed to build.*/
|
||||
PathSet queryFailedPaths();
|
||||
|
||||
/* Clear the "failed" status of the given paths. The special
|
||||
value `*' causes all failed paths to be cleared. */
|
||||
void clearFailedPaths(const PathSet & paths);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -451,6 +451,25 @@ void RemoteStore::collectGarbage(const GCOptions & options, GCResults & results)
|
|||
}
|
||||
|
||||
|
||||
PathSet RemoteStore::queryFailedPaths()
|
||||
{
|
||||
openConnection();
|
||||
writeInt(wopQueryFailedPaths, to);
|
||||
processStderr();
|
||||
return readStorePaths(from);
|
||||
}
|
||||
|
||||
|
||||
void RemoteStore::clearFailedPaths(const PathSet & paths)
|
||||
{
|
||||
openConnection();
|
||||
writeInt(wopClearFailedPaths, to);
|
||||
writeStringSet(paths, to);
|
||||
processStderr();
|
||||
readInt(from);
|
||||
}
|
||||
|
||||
|
||||
void RemoteStore::processStderr(Sink * sink, Source * source)
|
||||
{
|
||||
unsigned int msg;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ public:
|
|||
|
||||
void collectGarbage(const GCOptions & options, GCResults & results);
|
||||
|
||||
PathSet queryFailedPaths();
|
||||
|
||||
void clearFailedPaths(const PathSet & paths);
|
||||
|
||||
private:
|
||||
AutoCloseFD fdSocket;
|
||||
FdSink to;
|
||||
|
|
|
|||
|
|
@ -209,6 +209,13 @@ public:
|
|||
|
||||
/* Perform a garbage collection. */
|
||||
virtual void collectGarbage(const GCOptions & options, GCResults & results) = 0;
|
||||
|
||||
/* Return the set of paths that have failed to build.*/
|
||||
virtual PathSet queryFailedPaths() = 0;
|
||||
|
||||
/* Clear the "failed" status of the given paths. The special
|
||||
value `*' causes all failed paths to be cleared. */
|
||||
virtual void clearFailedPaths(const PathSet & paths) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ typedef enum {
|
|||
wopQuerySubstitutablePathInfo = 21,
|
||||
wopQueryDerivationOutputs = 22,
|
||||
wopQueryValidPaths = 23,
|
||||
wopQueryFailedPaths = 24,
|
||||
wopClearFailedPaths = 25,
|
||||
} WorkerOp;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue