1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

* Merge critical bug fixes from trunk (r2536, r2537).

This commit is contained in:
Eelco Dolstra 2005-04-12 10:56:02 +00:00
parent 20cb2d80c6
commit 937a54ae4a
2 changed files with 5 additions and 5 deletions

View file

@ -76,7 +76,7 @@ addToQueue $targetPath;
sub isValidPath { sub isValidPath {
my $p = shift; my $p = shift;
system "@bindir@/nix-store --isvalid '$p' 2> /dev/null"; system "@bindir@/nix-store --check-validity '$p' 2> /dev/null";
return $? == 0; return $? == 0;
} }

View file

@ -737,10 +737,10 @@ void deleteFromStore(const Path & _path)
Transaction txn(nixDB); Transaction txn(nixDB);
if (isValidPathTxn(txn, path)) { if (isValidPathTxn(txn, path)) {
PathSet referers = getReferers(txn, path); PathSet referers = getReferers(txn, path);
if (referers.size() > 1 || for (PathSet::iterator i = referers.begin();
(referers.size() == 1 && i != referers.end(); ++i)
*referers.begin() != path)) if (*i != path && isValidPathTxn(txn, *i))
throw Error(format("cannot delete path `%1%' because it is in use") % path); throw Error(format("cannot delete path `%1%' because it is in use by path `%2%'") % path % *i);
invalidatePath(txn, path); invalidatePath(txn, path);
} }
txn.commit(); txn.commit();