mirror of
https://github.com/NixOS/nix.git
synced 2025-11-28 13:11:00 +01:00
Generations API cleanup
This commit is contained in:
parent
8807ff902e
commit
5517eee17e
3 changed files with 59 additions and 75 deletions
|
|
@ -9,37 +9,32 @@
|
|||
namespace nix {
|
||||
|
||||
|
||||
typedef unsigned int GenerationNumber;
|
||||
|
||||
struct Generation
|
||||
{
|
||||
int number;
|
||||
GenerationNumber number;
|
||||
Path path;
|
||||
time_t creationTime;
|
||||
Generation()
|
||||
{
|
||||
number = -1;
|
||||
}
|
||||
operator bool() const
|
||||
{
|
||||
return number != -1;
|
||||
}
|
||||
};
|
||||
|
||||
typedef list<Generation> Generations;
|
||||
typedef std::list<Generation> Generations;
|
||||
|
||||
|
||||
/* Returns the list of currently present generations for the specified
|
||||
profile, sorted by generation number. */
|
||||
Generations findGenerations(Path profile, int & curGen);
|
||||
profile, sorted by generation number. Also returns the number of
|
||||
the current generation. */
|
||||
std::pair<Generations, std::optional<GenerationNumber>> findGenerations(Path profile);
|
||||
|
||||
class LocalFSStore;
|
||||
|
||||
Path createGeneration(ref<LocalFSStore> store, Path profile, Path outPath);
|
||||
|
||||
void deleteGeneration(const Path & profile, unsigned int gen);
|
||||
void deleteGeneration(const Path & profile, GenerationNumber gen);
|
||||
|
||||
void deleteGenerations(const Path & profile, const std::set<unsigned int> & gensToDelete, bool dryRun);
|
||||
void deleteGenerations(const Path & profile, const std::set<GenerationNumber> & gensToDelete, bool dryRun);
|
||||
|
||||
void deleteGenerationsGreaterThan(const Path & profile, const int max, bool dryRun);
|
||||
void deleteGenerationsGreaterThan(const Path & profile, GenerationNumber max, bool dryRun);
|
||||
|
||||
void deleteOldGenerations(const Path & profile, bool dryRun);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue