diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2023-05-27 14:06:32 +0200 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2023-05-27 20:54:08 +0200 |
commit | ca6a9f7c9fd6908beeeba370082c86543e76ade1 (patch) | |
tree | 53fdeb5f5a37aad23ab2dd90e5806b24492579c8 /bin | |
parent | 96456343efc628764a2785b170cc295f19fd5bb0 (diff) |
update-db: Allow to enable verbose logging of DB update operations
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/update-db | 12 |
1 files changed, 10 insertions, 2 deletions
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) |