mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
Garbage Collection for state paths now works. (altough we don't set locks on state paths or handle cyclic references)
This commit is contained in:
parent
a699c6b330
commit
2d84c9e50c
2 changed files with 5 additions and 2 deletions
|
|
@ -710,7 +710,7 @@ void LocalStore::collectGarbage(GCAction action, const PathSet & pathsToDelete,
|
||||||
bytesFreed += freed;
|
bytesFreed += freed;
|
||||||
} catch (PathInUse & e) {
|
} catch (PathInUse & e) {
|
||||||
printMsg(lvlError, format("warning: %1%") % e.msg());
|
printMsg(lvlError, format("warning: %1%") % e.msg());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __CYGWIN__
|
#ifndef __CYGWIN__
|
||||||
if (fdLock != -1)
|
if (fdLock != -1)
|
||||||
|
|
|
||||||
|
|
@ -551,7 +551,8 @@ void removeAllStatePathRevisions(Database & nixDB, const Transaction & txn, Tabl
|
||||||
//Remove all revisions
|
//Remove all revisions
|
||||||
nixDB.delPair(txn, revisions_table, statePath);
|
nixDB.delPair(txn, revisions_table, statePath);
|
||||||
RevisionInfos revisions;
|
RevisionInfos revisions;
|
||||||
store->queryAvailableStateRevisions(statePath, revisions);
|
queryAvailableStateRevisions(nixDB, txn, revisions_table, revisions_comments, statePath, revisions);
|
||||||
|
|
||||||
for (RevisionInfos::iterator i = revisions.begin(); i != revisions.end(); ++i){
|
for (RevisionInfos::iterator i = revisions.begin(); i != revisions.end(); ++i){
|
||||||
unsigned int rev = (*i).first;
|
unsigned int rev = (*i).first;
|
||||||
nixDB.delPair(txn, revisions_table, mergeToDBKey(statePath, rev));
|
nixDB.delPair(txn, revisions_table, mergeToDBKey(statePath, rev));
|
||||||
|
|
@ -705,6 +706,8 @@ bool queryAvailableStateRevisions(Database & nixDB, const Transaction & txn, Tab
|
||||||
|
|
||||||
for (Strings::const_iterator i = keys.begin(); i != keys.end(); ++i) {
|
for (Strings::const_iterator i = keys.begin(); i != keys.end(); ++i) {
|
||||||
|
|
||||||
|
printMsg(lvlError, format("QQQQ %1%") % *i);
|
||||||
|
|
||||||
if((*i).substr(0, statePath.length()) != statePath || (*i).length() == statePath.length()) //dont check the new-revision key or other keys
|
if((*i).substr(0, statePath.length()) != statePath || (*i).length() == statePath.length()) //dont check the new-revision key or other keys
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue