Switch state.py to use sqlite3 instead of filesystem-based stamps.

It passes all tests when run serialized, but still gives weird errors
(OperationalError: database is locked) when run with -j5.  sqlite3 shouldn't
be barfing just because the database is locked, since the default timeout is
5 seconds, and it's dying *way* faster than that.
This commit is contained in:
Avery Pennarun 2010-12-07 02:17:22 -08:00
commit a62bd50d44
6 changed files with 220 additions and 157 deletions

View file

@ -5,11 +5,12 @@ from helpers import err, mkdirp
try:
me = state.File(name=vars.TARGET)
for t in sys.argv[1:]:
if os.path.exists(t):
err('redo-ifcreate: error: %r already exists\n' % t)
sys.exit(1)
else:
state.add_dep(vars.TARGET, 'c', t)
me.add_dep('c', t)
except KeyboardInterrupt:
sys.exit(200)