summaryrefslogtreecommitdiffstats
path: root/bin/update-db
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2005-09-15 15:00:32 +0000
committerFlorian Weimer <fw@deneb.enyo.de>2005-09-15 15:00:32 +0000
commit7e85e7beb8ed2bb5cab8707054554cec5cf05d4d (patch)
tree253a962d3212ea984c8ed794eba846042eac2594 /bin/update-db
parent426b9e248a9057ce9061fc585a15f9780c3a3881 (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-xbin/update-db6
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)

© 2014-2024 Faster IT GmbH | imprint | privacy policy