versioning the database
This commit is contained in:
parent
44f089508b
commit
11b62114bb
2 changed files with 8 additions and 4 deletions
|
@ -60,7 +60,7 @@
|
|||
_db_dirname = '.spack-db'
|
||||
|
||||
# DB version. This is stuck in the DB file to track changes in format.
|
||||
_db_version = Version('0.9')
|
||||
_db_version = Version('0.9.1')
|
||||
|
||||
# Default timeout for spack database locks is 5 min.
|
||||
_db_lock_timeout = 60
|
||||
|
@ -250,8 +250,10 @@ def check(cond, msg):
|
|||
|
||||
# TODO: better version checking semantics.
|
||||
version = Version(db['version'])
|
||||
if version != _db_version:
|
||||
if version > _db_version:
|
||||
raise InvalidDatabaseVersionError(_db_version, version)
|
||||
elif version < _db_version:
|
||||
self.reindex(spack.install_layout)
|
||||
|
||||
# Iterate through database and check each record.
|
||||
installs = db['installs']
|
||||
|
@ -343,6 +345,7 @@ def _write(self):
|
|||
temp_file = self._index_path + (
|
||||
'.%s.%s.temp' % (socket.getfqdn(), os.getpid()))
|
||||
|
||||
|
||||
# Write a temporary database file them move it into place
|
||||
try:
|
||||
with open(temp_file, 'w') as f:
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
class Ghostscript(Package):
|
||||
"""an interpreter for the PostScript language and for PDF. """
|
||||
homepage = "http://ghostscript.com/"
|
||||
url = "http://downloads.ghostscript.com/public/ghostscript-9.16.tar.gz"
|
||||
url = "http://downloads.ghostscript.com/public/old-gs-releases/ghostpdl-9.16.tar.gz"
|
||||
|
||||
version('9.16', '829319325bbdb83f5c81379a8f86f38f')
|
||||
# version('9.16', '829319325bbdb83f5c81379a8f86f38f')
|
||||
version('9.16', '818c87e31f7562aaa97397d3d0cc20a1')
|
||||
|
||||
parallel = False
|
||||
|
||||
|
|
Loading…
Reference in a new issue