1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-26 20:20:58 +01:00

Merged R9063

This commit is contained in:
Wouter den Breejen 2007-10-08 10:41:41 +00:00
parent 546ca6e8bc
commit 00602dd20c
8 changed files with 30 additions and 38 deletions

View file

@ -59,6 +59,8 @@ public:
void queryStateReferrers(const Path & path, PathSet & stateReferrers, const unsigned int revision);
Path queryDeriver(const Path & path);
Path addToStore(const Path & srcPath, bool fixed = false,
bool recursive = false, string hashAlgo = "",
PathFilter & filter = defaultPathFilter);
@ -104,8 +106,6 @@ public:
Snapshots commitStatePath(const Path & statePath);
Path queryDeriver(const Path & path);
PathSet queryDerivers(const Path & storePath, const string & identifier, const string & user); //should these be in here ????
void scanAndUpdateAllReferences(const Path & statePath, const bool recursive);

View file

@ -261,6 +261,14 @@ void RemoteStore::queryStateReferrers(const Path & path,
stateReferrers.insert(stateReferrers2.begin(), stateReferrers2.end());
}
Path RemoteStore::queryDeriver(const Path & path)
{
writeInt(wopQueryDeriver, to);
writeString(path, to);
processStderr();
return readStorePath(from);
}
Path RemoteStore::addToStore(const Path & _srcPath, bool fixed,
bool recursive, string hashAlgo, PathFilter & filter)
@ -274,8 +282,9 @@ Path RemoteStore::addToStore(const Path & _srcPath, bool fixed,
writeString(hashAlgo, to);
dumpPath(srcPath, to, filter);
processStderr();
Path path = readStorePath(from);
return path;
return readStorePath(from);
//Path path = readStorePath(from); //TODO REMOVE CODE
//return path;
}
@ -392,14 +401,6 @@ void RemoteStore::collectGarbage(GCAction action, const PathSet & pathsToDelete,
bytesFreed = (((unsigned long long) hi) << 32) | lo;
}
Path RemoteStore::queryDeriver(const Path & path)
{
writeInt(wopQueryDeriver, to);
writeString(path, to);
processStderr();
return readStorePath(from);
}
PathSet RemoteStore::queryDerivers(const Path & storePath, const string & identifier, const string & user)
{
writeInt(wopQueryDerivers, to);

View file

@ -47,6 +47,8 @@ public:
void queryStateReferrers(const Path & path, PathSet & stateReferrers, const unsigned int revision);
Path queryDeriver(const Path & path);
Path addToStore(const Path & srcPath, bool fixed = false,
bool recursive = false, string hashAlgo = "",
PathFilter & filter = defaultPathFilter);
@ -90,8 +92,6 @@ public:
Snapshots commitStatePath(const Path & statePath);
Path queryDeriver(const Path & path);
PathSet queryDerivers(const Path & storePath, const string & identifier, const string & user);
void scanAndUpdateAllReferences(const Path & statePath, const bool recursive);

View file

@ -96,6 +96,10 @@ public:
The result is not cleared. */
virtual void queryStateReferrers(const Path & path, PathSet & stateReferrers, const unsigned int revision) = 0;
/* Query the deriver of a store path. Return the empty string if
no deriver has been set. */
virtual Path queryDeriver(const Path & path) = 0;
/* Copy the contents of a path to the store and register the
validity the resulting path. The resulting path is returned.
If `fixed' is true, then the output of a fixed-output
@ -226,10 +230,6 @@ public:
/* TODO */
virtual Snapshots commitStatePath(const Path & statePath) = 0;
/* Query the deriver of a store path. Return the empty string if
no deriver has been set. */
virtual Path queryDeriver(const Path & path) = 0;
/* TODO */
virtual PathSet queryDerivers(const Path & storePath, const string & identifier, const string & user) = 0;