From ca6a9f7c9fd6908beeeba370082c86543e76ade1 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sat, 27 May 2023 14:06:32 +0200 Subject: update-db: Allow to enable verbose logging of DB update operations Signed-off-by: Salvatore Bonaccorso --- bin/update-db | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/update-db b/bin/update-db index 46368096ba..63fee38e96 100755 --- a/bin/update-db +++ b/bin/update-db @@ -3,15 +3,23 @@ from __future__ import print_function import os import sys +import argparse import setup_paths import bugs import debian_support import security_db -db_file = sys.argv[1] +parser = argparse.ArgumentParser(description="Update Security Tracker Sqlite database") +parser.add_argument('--verbose', '-v', action='store_true', + help="Enable verbose messages for DB update operations") +parser.add_argument('file', nargs='?', help='Database file to process') +args = parser.parse_args() + +db_file = args.file + try: - db = security_db.DB(db_file) + db = security_db.DB(db_file, verbose=args.verbose) new_file = False except security_db.SchemaMismatch: os.unlink(db_file) -- cgit v1.2.3