Axel Beckert pushed to branch master at lintian / lintian
Commits:
-
2348bca3
by Axel Beckert at 2023-01-16T01:10:28+01:00
-
3721f292
by Axel Beckert at 2023-01-16T01:10:39+01:00
-
e48f1d48
by Axel Beckert at 2023-01-16T01:27:45+01:00
-
bf82908d
by Christoph Biedl at 2023-01-16T01:40:03+01:00
3 changed files:
- lib/Lintian/Check/Debian/Copyright/Dep5.pm
- lib/Lintian/Index/FileTypes.pm
- tags/i/inconsistent-appstream-metadata-license.tag
Changes:
... | ... | @@ -852,8 +852,30 @@ sub check_dep5_copyright { |
852 | 852 | next
|
853 | 853 | unless $seen;
|
854 | 854 | |
855 | + # Compare and also normalize the seen and wanted license
|
|
856 | + # identifier wrt. to redundant trailing dot-zeros,
|
|
857 | + # -or-later suffix vs + suffix, -only suffix vs no
|
|
858 | + # suffix. Still display the original variant in the tag.
|
|
859 | + my $seen_normalized = $seen;
|
|
860 | + $seen_normalized =~ s/-or-later$/+/i;
|
|
861 | + $seen_normalized =~ s/-only$//i;
|
|
862 | + my $seen_nozero = $seen_normalized;
|
|
863 | + $seen_nozero =~ s/\.0//g;
|
|
864 | + |
|
855 | 865 | my @wanted = @{$license_identifiers_by_file{$name}};
|
856 | - my @mismatched = grep { $_ ne $seen } @wanted;
|
|
866 | + my @mismatched = grep {
|
|
867 | + my $want = $_;
|
|
868 | + my $want_normalized = $want;
|
|
869 | + $want_normalized =~ s/-or-later$/+/i;
|
|
870 | + $want_normalized =~ s/-only$//i;
|
|
871 | + my $want_nozero = $want_normalized;
|
|
872 | + $want_nozero =~ s/\.0//g;
|
|
873 | + |
|
874 | + $want_normalized ne $seen_normalized
|
|
875 | + and $want_nozero ne $seen_normalized
|
|
876 | + and $want_normalized ne $seen_nozero
|
|
877 | + and $want_nozero ne $seen_nozero;
|
|
878 | + } @wanted;
|
|
857 | 879 | |
858 | 880 | $self->pointed_hint('inconsistent-appstream-metadata-license',
|
859 | 881 | $copyright_file->pointer, $name, "($seen != $_)")
|
... | ... | @@ -72,7 +72,7 @@ sub add_file_types { |
72 | 72 | my @files = grep { $_->is_file } @{$self->sorted_list};
|
73 | 73 | my @names = map { $_->name } @files;
|
74 | 74 | |
75 | - my @command = qw(file --no-pad --print0 --print0 --);
|
|
75 | + my @command = qw(file --raw --no-pad --print0 --print0 --);
|
|
76 | 76 | |
77 | 77 | my %file_types;
|
78 | 78 |
... | ... | @@ -2,7 +2,9 @@ Tag: inconsistent-appstream-metadata-license |
2 | 2 | Severity: warning
|
3 | 3 | Check: debian/copyright/dep5
|
4 | 4 | Explanation: The specified AppStream metadata file specifies a
|
5 | - <code>metadata_license</code> field but this does not match the files in
|
|
5 | + <code>metadata_license</code> field but this does not match
|
|
6 | + its entry (possibly via the <code>Files: *</code> stanza) in
|
|
6 | 7 | <code>debian/copyright</code>.
|
7 | 8 | See-Also: https://wiki.debian.org/AppStream/Guidelines,
|
8 | - https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
|
9 | + https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/,
|
|
10 | + https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-metadata_license |