94e3e4c69d
equivalence classes of the input derivations. * Set the equivalence class for paths produced through rewriting.
48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
#ifndef __MISC_H
|
|
#define __MISC_H
|
|
|
|
#include "derivations.hh"
|
|
#include "store.hh"
|
|
|
|
|
|
/* Read a derivation, after ensuring its existence through
|
|
ensurePath(). */
|
|
Derivation derivationFromPath(const Path & drvPath);
|
|
|
|
|
|
/* Place in `paths' the set of all store paths in the file system
|
|
closure of `storePath'; that is, all paths than can be directly or
|
|
indirectly reached from it. `paths' is not cleared. If
|
|
`flipDirection' is true, the set of paths that can reach
|
|
`storePath' is returned; that is, the closures under the `referers'
|
|
relation instead of the `references' relation is returned. */
|
|
void computeFSClosure(const Path & storePath,
|
|
PathSet & paths, bool flipDirection = false);
|
|
|
|
|
|
/* Return the output equivalence class denoted by `id' in the
|
|
derivation `drv'. */
|
|
OutputEqClass findOutputEqClass(const Derivation & drv,
|
|
const string & id);
|
|
|
|
|
|
/* Return anll trusted path (wrt to the given trust ID) in the given
|
|
output path equivalence class, or an empty set if no such paths
|
|
currently exist. */
|
|
PathSet findTrustedEqClassMembers(const OutputEqClass & eqClass,
|
|
const TrustId & trustId);
|
|
|
|
/* Like `findTrustedEqClassMembers', but returns an arbitrary trusted
|
|
path, or throws an exception if no such path currently exists. */
|
|
Path findTrustedEqClassMember(const OutputEqClass & eqClass,
|
|
const TrustId & trustId);
|
|
|
|
|
|
typedef map<Path, Path> Replacements;
|
|
|
|
PathSet consolidatePaths(const PathSet & paths, bool checkOnly,
|
|
Replacements & replacements);
|
|
|
|
|
|
#endif /* !__MISC_H */
|