lintian: r986 - in trunk: checks debian
Author: rra
Date: 2007-10-16 06:23:22 +0200 (Tue, 16 Oct 2007)
New Revision: 986
Modified:
trunk/checks/menu-format
trunk/debian/changelog
Log:
The "grand open change and desktop cleanup" release.
+ [RA] Skip unknown and deprecated key warnings and encoding key
warnings in desktop files if they were of an unknown type.
Modified: trunk/checks/menu-format
===================================================================
--- trunk/checks/menu-format 2007-10-16 04:17:22 UTC (rev 985)
+++ trunk/checks/menu-format 2007-10-16 04:23:22 UTC (rev 986)
@@ -734,6 +734,7 @@
open (DESKTOP, '<', "unpacked/$file")
or fail("cannot open desktop file $file: $!");
my ($line, $saw_first);
+ my @pending;
while (defined ($line = <DESKTOP>)) {
chomp $line;
next if ($line =~ m/^\s*\#/ or $line =~ m/^\s*$/);
@@ -747,35 +748,43 @@
$saw_first = 1;
}
- # Tag = Value
- # TODO: We do not check for properly formatted localised values for
- # keys but might be worth checking if they are properly formatted (not
- # their value)
- if ($line =~ /^(.*?)\s*=\s*(.*)$/) {
- my ($tag, $value) = ($1, $2);
- my $basetag = $tag;
- my ($encoding) = ($basetag =~ s/\[([^\]]+)\]$//);
- if (exists $vals{$tag}) {
- tag "duplicated-key-in-desktop-entry", "$file:$. $tag";
- } elsif ($deprecated_desktop_keys{$basetag}) {
- if ($basetag eq 'Encoding') {
- tag "desktop-entry-contains-encoding-key", "$file:$. $tag";
- } else {
- tag "desktop-entry-contains-deprecated-key", "$file:$. $tag";
- }
- } elsif ( not $known_desktop_keys{$basetag}
- and not $kde_desktop_keys{$basetag}
- and not $basetag =~ /^X-/) {
- tag "desktop-entry-contains-unknown-key", "$file:$. $tag";
- }
- $vals{$tag} = $value;
- }
+ # Tag = Value. For most errors, just add the error to pending rather
+ # than warning on it immediately since we want to not warn on tag
+ # errors if we didn't know the file type.
+ #
+ # TODO: We do not check for properly formatted localised values for
+ # keys but might be worth checking if they are properly formatted (not
+ # their value)
+ if ($line =~ /^(.*?)\s*=\s*(.*)$/) {
+ my ($tag, $value) = ($1, $2);
+ my $basetag = $tag;
+ my ($encoding) = ($basetag =~ s/\[([^\]]+)\]$//);
+ if (exists $vals{$tag}) {
+ tag "duplicated-key-in-desktop-entry", "$file:$. $tag";
+ } elsif ($deprecated_desktop_keys{$basetag}) {
+ if ($basetag eq 'Encoding') {
+ push (@pending, [ "desktop-entry-contains-encoding-key", "$file:$. $tag" ]);
+ } else {
+ push (@pending, [ "desktop-entry-contains-deprecated-key", "$file:$. $tag" ]);
+ }
+ } elsif ( not $known_desktop_keys{$basetag}
+ and not $kde_desktop_keys{$basetag}
+ and not $basetag =~ /^X-/) {
+ push (@pending, [ "desktop-entry-contains-unknown-key", "$file:$. $tag" ]);
+ }
+ $vals{$tag} = $value;
+ }
}
close DESKTOP;
# Now validate the data in the desktop file, but only if it's a known type.
return unless ($vals{'Type'} and $known_desktop_types{$vals{'Type'}});
+ # Now we can issue any pending tags.
+ for my $pending (@pending) {
+ tag @$pending;
+ }
+
# Test for important keys.
for my $tag (@req_desktop_keys) {
unless (defined $vals{$tag}) {
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-10-16 04:17:22 UTC (rev 985)
+++ trunk/debian/changelog 2007-10-16 04:23:22 UTC (rev 986)
@@ -1,6 +1,6 @@
lintian (1.23.36) unstable; urgency=low
- The "grand open change" release.
+ The "grand open change and desktop cleanup" release.
* {checks,collection,depcheck,frontend,lib,reporting,unpack}/*:
+ [RA] Use the three-argument form of open uniformly, whether needed
@@ -19,13 +19,15 @@
root problem was our willingness to inspect desktop types other than
Application (also fixed in the previous release).
+ [RA] Fix Perl flow error when skipping some desktop files.
+ + [RA] Skip unknown and deprecated key warnings and encoding key
+ warnings in desktop files if they were of an unknown type.
* lib/Dep.pm:
+ [RA] Fix negative implication in some boundary cases when comparing
two versioned relationships in the same direction. Thanks to
Raphael Hertzog for the analysis and fix. (Closes: #446768)
- -- Russ Allbery <rra@debian.org> Mon, 15 Oct 2007 21:17:15 -0700
+ -- Russ Allbery <rra@debian.org> Mon, 15 Oct 2007 21:23:16 -0700
lintian (1.23.35) unstable; urgency=low
Reply to: