* Bug fixes.
This commit is contained in:
parent
a7154c5b14
commit
4df6dc28c3
|
@ -275,7 +275,7 @@ void LocalStore::registerValidPath(const Path & path,
|
|||
}
|
||||
|
||||
|
||||
void LocalStore::registerValidPath(const ValidPathInfo & info)
|
||||
void LocalStore::registerValidPath(const ValidPathInfo & info, bool ignoreValidity)
|
||||
{
|
||||
Path infoFile = infoFileFor(info.path);
|
||||
|
||||
|
@ -300,7 +300,7 @@ void LocalStore::registerValidPath(const ValidPathInfo & info)
|
|||
if (!refs.empty()) refs += " ";
|
||||
refs += *i;
|
||||
|
||||
if (*i != info.path && !isValidPath(*i))
|
||||
if (!ignoreValidity && *i != info.path && !isValidPath(*i))
|
||||
throw Error(format("cannot register `%1%' as valid, because its reference `%2%' isn't valid")
|
||||
% info.path % *i);
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ private:
|
|||
/* Store paths for which the referrers file must be purged. */
|
||||
PathSet delayedUpdates;
|
||||
|
||||
void registerValidPath(const ValidPathInfo & info);
|
||||
void registerValidPath(const ValidPathInfo & info, bool ignoreValidity = false);
|
||||
|
||||
ValidPathInfo queryPathInfo(const Path & path);
|
||||
|
||||
|
|
|
@ -267,6 +267,7 @@ struct ValidPathInfo
|
|||
Hash hash;
|
||||
PathSet references;
|
||||
time_t registrationTime;
|
||||
ValidPathInfo() : registrationTime(0) { }
|
||||
};
|
||||
|
||||
typedef list<ValidPathInfo> ValidPathInfos;
|
||||
|
|
|
@ -58,19 +58,20 @@ void LocalStore::upgradeStore12()
|
|||
nixDB.enumTable(noTxn, dbValidPaths, paths);
|
||||
|
||||
for (Paths::iterator i = paths.begin(); i != paths.end(); ++i) {
|
||||
PathSet references;
|
||||
Paths references2;
|
||||
nixDB.queryStrings(noTxn, dbReferences, *i, references2);
|
||||
references.insert(references2.begin(), references2.end());
|
||||
ValidPathInfo info;
|
||||
info.path = *i;
|
||||
|
||||
Paths references;
|
||||
nixDB.queryStrings(noTxn, dbReferences, *i, references);
|
||||
info.references.insert(references.begin(), references.end());
|
||||
|
||||
string s;
|
||||
nixDB.queryString(noTxn, dbValidPaths, *i, s);
|
||||
Hash hash =parseHashField(*i, s);
|
||||
info.hash = parseHashField(*i, s);
|
||||
|
||||
Path deriver;
|
||||
nixDB.queryString(noTxn, dbDerivers, *i, deriver);
|
||||
nixDB.queryString(noTxn, dbDerivers, *i, info.deriver);
|
||||
|
||||
registerValidPath(*i, hash, references, deriver);
|
||||
registerValidPath(info, true);
|
||||
std::cerr << ".";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue