#!/usr/bin/python # This script recalculates the vulnerability information in the # security database. import errno import os import os.path import string import sys def setup_paths(): check_file = 'lib/python/debian_support.py' path = os.getcwd() while 1: if os.path.exists("%s/%s" % (path, check_file)): sys.path = [path + '/lib/python'] + sys.path return path idx = string.rfind(path, '/') if idx == -1: raise ImportError, "could not setup paths" path = path[0:idx] root_path = setup_paths() import security_db db_file = root_path + '/data/security.db' assert os.path.exists(db_file) db = security_db.DB(db_file) c = db.writeTxn() db.calculateVulnerabilities(c) db.commit(c)