diff options
author | Florian Weimer <fw@deneb.enyo.de> | 2005-09-15 15:00:32 +0000 |
---|---|---|
committer | Florian Weimer <fw@deneb.enyo.de> | 2005-09-15 15:00:32 +0000 |
commit | 7dd036e8b2f5f568278748fc0480021bf8ba0b19 (patch) | |
tree | d28fd82edea02d4901ec79895dccee831ed3790a /bin/update-db | |
parent | 0c3bbeee0164bd4bb1b930ce1a1a72391ce3f2af (diff) |
Commit early if we are creating a new file. This means that the work is
not wasted if an error occurs later.
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@2000 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/update-db')
-rwxr-xr-x | bin/update-db | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/update-db b/bin/update-db index 273d9fa7e0..0c732cd4cb 100755 --- a/bin/update-db +++ b/bin/update-db @@ -25,9 +25,11 @@ import security_db db_file = 'data/security.db' try: db = security_db.DB(db_file, verbose=True) + new_file = False except security_db.SchemaMismatch: os.unlink(db_file) db = security_db.DB(db_file, verbose=True) + new_file = True cursor = db.writeTxn() @@ -51,6 +53,10 @@ if warnings: db.readPackages(cursor, 'data/packages') +if new_file: + db.commit(cursor) + cursor = db.writeTxn() + # Calculate vulnerability information. warnings = db.calculateVulnerabilities(cursor) |