* Automatically remove temporary root files.
This commit is contained in:
@@ -13,6 +13,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
#include "globals.hh"
|
||||
#include "gc.hh"
|
||||
#include "shared.hh"
|
||||
|
||||
#include "config.h"
|
||||
@@ -55,6 +56,15 @@ void checkStoreNotSymlink(Path path)
|
||||
}
|
||||
|
||||
|
||||
struct RemoveTempRoots
|
||||
{
|
||||
~RemoveTempRoots()
|
||||
{
|
||||
removeTempRoots();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void initDerivationsHelpers();
|
||||
|
||||
|
||||
@@ -171,6 +181,10 @@ static void initAndRun(int argc, char * * argv)
|
||||
else remaining.push_back(arg);
|
||||
}
|
||||
|
||||
/* Automatically clean up the temporary roots file when we
|
||||
exit. */
|
||||
RemoveTempRoots removeTempRoots;
|
||||
|
||||
run(remaining);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user