Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (4)
bin/lts-cve-triage.py: Move to Python 3
· 020ae58b
Chris Lamb
authored
Aug 05, 2019
020ae58b
bin/lts-cve-triage.py: Drop unnecessary "pass" statement
· 6f686477
Chris Lamb
authored
Aug 05, 2019
6f686477
bin/lts-cve-triage.py: Print notice to standard error, not stdout
· 76f08cc1
Chris Lamb
authored
Aug 05, 2019
76f08cc1
bin/lts-cve-triage.py: Fix flake8 (3.7.8-3) warnings
· 28db1e4b
Chris Lamb
authored
Aug 05, 2019
28db1e4b
Show whitespace changes
Inline
Side-by-side
bin/lts-cve-triage.py
View file @
28db1e4b
#!/usr/bin/python
#!/usr/bin/
env
python
3
# Copyright 2015 Raphael Hertzog <hertzog@debian.org>
#
...
...
@@ -22,17 +22,18 @@ import collections
from
tracker_data
import
TrackerData
,
RELEASES
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
from
termcolor
import
colored
# noqa
colored_on
=
True
except
ImportError
:
print
(
"
Note: you can install python-termcolor for colored output
"
)
pass
print
(
"
Note: you can install python3-termcolor for colored output
"
,
file
=
sys
.
stderr
)
colored_on
=
False
def
colored
(
x
,
*
args
,
**
kwargs
):
return
x
TRACKER_URL
=
'
https://security-tracker.debian.org/tracker/
'
...
...
@@ -42,28 +43,27 @@ LIST_NAMES = (
(
'
triage_limited_support
'
,
'
Issues on packages with limited support (review support rules)
'
),
(
'
triage_already_in_dsa_needed
'
,
(
'
Issues to triage for {lts} that are already in dsa-needed
'
)
.
format
(
**
RELEASES
)),
(
'
Issues to triage for {lts} that are already in dsa-needed
'
)
.
format
(
**
RELEASES
)),
(
'
triage_likely_nodsa
'
,
(
'
Issues to triage for {lts} that are no-dsa in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
Issues to triage for {lts} that are no-dsa in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
triage_possible_easy_fixes
'
,
(
'
Issues not yet triaged for {lts}, but already fixed in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
Issues not yet triaged for {lts}, but already fixed in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
triage_other_not_triaged_in_next_lts
'
,
(
'
Other issues to triage for {lts} (not yet triaged for {next_lts})
'
)
.
format
(
**
RELEASES
)),
(
'
Other issues to triage for {lts} (not yet triaged for {next_lts})
'
)
.
format
(
**
RELEASES
)),
(
'
triage_other
'
,
'
Other issues to triage (no special status)
'
),
(
'
unexpected_nodsa
'
,
(
'
Issues tagged no-dsa in {lts} that are open in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
Issues tagged no-dsa in {lts} that are open in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
possible_easy_fixes
'
,
(
'
Issues from dla-needed.txt that are already fixed in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
Issues from dla-needed.txt that are already fixed in {next_lts}
'
)
.
format
(
**
RELEASES
)),
(
'
undetermined
'
,
(
'
Undetermined issues in {lts}
'
).
format
(
**
RELEASES
)),
(
'
Undetermined issues in {lts}
'
).
format
(
**
RELEASES
)),
)
lists
=
collections
.
defaultdict
(
lambda
:
collections
.
defaultdict
(
lambda
:
[]))
...
...
@@ -81,7 +81,8 @@ parser.add_argument('--exclude', nargs='+', choices=[x[0] for x in LIST_NAMES],
args
=
parser
.
parse_args
()
tracker
=
TrackerData
(
update_cache
=
not
args
.
skip_cache_update
)
unsupported
=
UnsupportedPackages
(
debian_version
=
8
,
update_cache
=
not
args
.
skip_cache_update
)
unsupported
=
UnsupportedPackages
(
debian_version
=
8
,
update_cache
=
not
args
.
skip_cache_update
)
limited
=
LimitedSupportPackages
(
update_cache
=
not
args
.
skip_cache_update
)
...
...
@@ -161,6 +162,12 @@ for key, desc in LIST_NAMES:
))
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
'
),
(
key
==
'
unexpected_nodsa
'
and
x
.
data
[
'
releases
'
][
RELEASES
[
'
lts
'
]][
'
nodsa_reason
'
]
or
''
)))
print
(
'
- {:<16s} {} {}
'
.
format
(
x
.
name
,
colored
(
url
,
'
blue
'
),
(
key
==
'
unexpected_nodsa
'
and
x
.
data
[
'
releases
'
][
RELEASES
[
'
lts
'
]][
'
nodsa_reason
'
]
or
''
)),
)
print
(
''
)