Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (3)
lts-cve-triage: display lts' nodsa sub-state
· 2437a255
Sylvain Beucler
authored
Jul 02, 2019
2437a255
lts-cve-triage: hint that color output is available
· b8b0b9b3
Sylvain Beucler
authored
Jul 02, 2019
b8b0b9b3
lts-cve-triage: fix formatting with no-colors output
· d9e8c731
Sylvain Beucler
authored
Jul 02, 2019
d9e8c731
Show whitespace changes
Inline
Side-by-side
bin/lts-cve-triage.py
View file @
d9e8c731
...
...
@@ -24,11 +24,14 @@ from unsupported_packages import UnsupportedPackages, LimitedSupportPackages
def
colored
(
x
,
*
args
,
**
kwargs
):
return
x
colored_on
=
False
try
:
if
sys
.
stdout
.
isatty
():
from
termcolor
import
colored
colored_on
=
True
except
ImportError
:
print
(
"
Note: you can install python-termcolor for colored output
"
)
pass
TRACKER_URL
=
'
https://security-tracker.debian.org/tracker/
'
...
...
@@ -149,12 +152,15 @@ for key, desc in LIST_NAMES:
continue
print
(
'
\n
{}:
'
.
format
(
colored
(
desc
,
attrs
=
(
'
bold
'
,))))
for
pkg
in
sorted
(
lists
[
key
].
keys
()):
print
(
'
\n
* {:<35s} {}
'
.
format
(
formatstring
=
'
\n
* {:<18s} {}
'
if
colored_on
:
formatstring
=
'
\n
* {:<35s} {}
'
print
(
formatstring
.
format
(
colored
(
pkg
,
'
red
'
,
attrs
=
(
'
bold
'
,
'
underline
'
)),
colored
(
'
{}source-package/{}
'
.
format
(
TRACKER_URL
,
pkg
),
'
blue
'
),
))
for
x
in
sorted
(
lists
[
key
][
pkg
],
key
=
lambda
x
:
x
.
name
):
url
=
'
{}{}
'
.
format
(
TRACKER_URL
,
x
.
name
)
print
(
'
- {:<16s} {}
'
.
format
(
x
.
name
,
colored
(
url
,
'
blue
'
)))
print
(
'
- {:<16s}
{}
{}
'
.
format
(
x
.
name
,
colored
(
url
,
'
blue
'
)
,
(
key
==
'
unexpected_nodsa
'
and
x
.
data
[
'
releases
'
][
RELEASES
[
'
lts
'
]][
'
nodsa_reason
'
]
or
''
)
))
print
(
''
)