Skip to content
Snippets Groups Projects
Commit 858c4096 authored by Denis Pynkin's avatar Denis Pynkin Committed by Emanuele Aina
Browse files

ci-license-scan: fix failure for non-existing debian/copyright


In case if file `debian/copyright` is not existing, the `ci-license-scan`
script throws an exception. Do not stop the check if the file is absent.
Example package without the `debian/copyright` file is
`firmware-nonfree`.

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent 948dc2c8
No related branches found
No related tags found
1 merge request!211v2021 ← v2022dev2 backports: Fix license scan on non-existing debian/copyright and fix automerges
#!/usr/bin/env python3
# SPDX-License-Identifier: MPL-2.0
#
# Copyright © 2019 Collabora Ltd
# Copyright © 2019-2021 Collabora Ltd
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -375,12 +375,15 @@ def main():
unknown_licensed = False
fixups = dict()
fixups_applied = set()
with open('debian/copyright', 'rb') as f:
try:
try:
with open('debian/copyright', 'rb') as f:
debian_copyrights = Copyright(f, strict=False)
except (ValueError, NotMachineReadableError):
print("WARN: No machine-readable debian/copyright found, can’t use licensing information from Debian.", file=sys.stderr)
debian_copyrights = Copyright()
except (ValueError, NotMachineReadableError):
print("WARN: No machine-readable debian/copyright found, can’t use licensing information from Debian.", file=sys.stderr)
debian_copyrights = Copyright()
except FileNotFoundError:
print("WARN: No debian/copyright found, can’t use licensing information from Debian.", file=sys.stderr)
debian_copyrights = Copyright()
with open('debian/apertis/copyright.new', 'rb') as f:
try:
n = NullFilter(f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment