Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Reproducible Builds
reproducible-notes
Compare revisions
48b107ceb07d8c63e6fb55a36d90cde81e7d4629...636481f37f4cd42e87916c3b6e1f118f172ec7cc
Commits (2)
Add copyright notice.
· 06d1b670
Chris Lamb
authored
Feb 17, 2021
06d1b670
Add some help text; thanks for the suggestion.
· 636481f3
Chris Lamb
authored
Feb 17, 2021
636481f3
Hide whitespace changes
Inline
Side-by-side
bin/auto-classify
View file @
636481f3
#!/usr/bin/env python3
#
# Copyright © 2020-2021 Chris Lamb <lamby@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import
re
import
sys
import
json
import
click
import
fileinput
@click.command
()
def
main
():
"""
Takes the output from `diffoscope --json=X` and attempts to guess which
issue(s) the package is affected by. For example:
$ diffoscope --json=output.json a.dsc b.dsc
$ bin/auto-classify output.json
build_path_captured_by_octave
$
If no arguments are provided, the JSON is read from standard input so
you can pipe it in. For example:
$ diffoscope --json=- a.dsc b.dsc | bin/auto-classify
build_path_captured_by_octave
"""
raw
=
""
.
join
(
fileinput
.
input
())
for
x
in
walk_json
(
json
.
loads
(
raw
)):
print
(
x
)
def
walk_json
(
elem
):
if
isinstance
(
elem
,
list
):
for
x
in
elem
:
...
...
@@ -121,7 +162,4 @@ def walk_json(elem):
if
__name__
==
"__main__"
:
raw
=
""
.
join
(
fileinput
.
input
())
for
x
in
walk_json
(
json
.
loads
(
raw
)):
print
(
x
)
sys
.
exit
(
main
())