summaryrefslogtreecommitdiffstats
path: root/bin/update-nvd
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu@debian.org>2020-08-13 11:47:12 +0200
committerEmilio Pozuelo Monfort <pochu@debian.org>2020-08-13 11:49:08 +0200
commita51f0ac2888bb7da475af291f77a79fb7f7cd5e0 (patch)
treea967b015199565bf5c8738cc940e936ef1494059 /bin/update-nvd
parentc741ea438ed32b771bc176bafd9db7af98a55c5e (diff)
De-duplicate setup_path
All the scripts in bin/ can share the definition. Also setup_paths.py calls setup_path so one just has to import that module before importing those from lib/python/. Additionally this helps some scripts work better under Python 3, as one variant of setup_paths that we had called string.rfind, which is not present there.
Diffstat (limited to 'bin/update-nvd')
-rwxr-xr-xbin/update-nvd16
1 files changed, 1 insertions, 15 deletions
diff --git a/bin/update-nvd b/bin/update-nvd
index 19b1cbfcda..6573b9139f 100755
--- a/bin/update-nvd
+++ b/bin/update-nvd
@@ -1,23 +1,9 @@
#!/usr/bin/python3
-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]
-setup_paths()
-
+import setup_paths
import nvd
import security_db

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