python () {
if not bb.data.inherits_class("cve-check", d):
raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
-
- if os.path.exists("%s-journal" % cve_check_db_file ):
- os.remove("%s-journal" % cve_check_db_file)
-
- if os.path.exists(cve_check_db_file):
- os.remove(cve_check_db_file)
}
python do_fetch() {
db_dir = os.path.dirname(db_file)
json_tmpfile = os.path.join(db_dir, 'nvd.json.gz')
+ if os.path.exists("{0}-journal".format(db_file)):
+ # If a journal is present the last update might have been interrupted. In that case,
+ # just wipe any leftovers and force the DB to be recreated.
+ os.remove("{0}-journal".format(db_file))
+
+ if os.path.exists(db_file):
+ os.remove(db_file)
+
# Don't refresh the database more than once an hour
try:
import time