lintian: r1075 - in trunk: checks debian testset testset/binary/debian
Author: rra
Date: 2007-12-09 05:41:17 +0100 (Sun, 09 Dec 2007)
New Revision: 1075
Modified:
trunk/checks/menu-format
trunk/checks/menu-format.desc
trunk/debian/changelog
trunk/testset/binary/debian/hello.desktop
trunk/testset/tags.binary
Log:
+ [RA] Warn about desktop files containing CRLF line endings (and then
strip the CR for later checks). The standard is explicit that each
line ends in only LF.
Modified: trunk/checks/menu-format
===================================================================
--- trunk/checks/menu-format 2007-12-09 04:21:55 UTC (rev 1074)
+++ trunk/checks/menu-format 2007-12-09 04:41:17 UTC (rev 1075)
@@ -741,11 +741,15 @@
my %vals;
open (DESKTOP, '<', "unpacked/$file")
or fail("cannot open desktop file $file: $!");
- my ($line, $saw_first);
+ my ($line, $saw_first, $warned_cr);
my @pending;
while (defined ($line = <DESKTOP>)) {
chomp $line;
next if ($line =~ m/^\s*\#/ or $line =~ m/^\s*$/);
+ if ($line =~ s/\r//) {
+ tag 'desktop-entry-file-has-crs', "$file:$." unless $warned_cr;
+ $warned_cr = 1;
+ }
# Err on the side of caution for now. If the first non-comment line
# is not the required [Desktop Entry] group, ignore this file. Also
Modified: trunk/checks/menu-format.desc
===================================================================
--- trunk/checks/menu-format.desc 2007-12-09 04:21:55 UTC (rev 1074)
+++ trunk/checks/menu-format.desc 2007-12-09 04:41:17 UTC (rev 1075)
@@ -191,6 +191,13 @@
Info: The desktop entry file is marked executable. Desktop entries are
regular files and should be installed mode 0644.
+Tag: desktop-entry-file-has-crs
+Type: warning
+Info: The desktop entry file has lines ending in CRLF instead of just LF.
+ The Desktop Entry Specification is explicit that lines should end with
+ only LF. The CR may be taken by some software as part of the field.
+Ref: http://standards.freedesktop.org/desktop-entry-spec/1.0/ar01s02.html
+
Tag: duplicated-key-in-desktop-entry
Type: warning
Info: The desktop entry contains two instances of the same key. The
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-12-09 04:21:55 UTC (rev 1074)
+++ trunk/debian/changelog 2007-12-09 04:41:17 UTC (rev 1075)
@@ -1,15 +1,20 @@
lintian (1.23.41) UNRELEASED; urgency=low
- * checks/menu-format:
+ The "it would be lovely if there were an actual desktop file standard"
+ release.
+
+ * checks/menu-format{.desc,}:
+ [RA] Add Actions to the KDE-specific desktop file keys. Add
Application as an acceptable Main Category even though it's not
listed in the standard; given how widely it's used, it doesn't
- appear to be worth warning about right now. It would be lovely if
- there were an actual desktop standard. (Closes: #444651)
+ appear to be worth warning about right now. (Closes: #444651)
+ [RA] Add GNUstep as an acceptable Main Category, since it's used as
a non-standard category by GNUstep applications.
+ + [RA] Warn about desktop files containing CRLF line endings (and then
+ strip the CR for later checks). The standard is explicit that each
+ line ends in only LF.
- -- Russ Allbery <rra@debian.org> Sat, 08 Dec 2007 20:21:39 -0800
+ -- Russ Allbery <rra@debian.org> Sat, 08 Dec 2007 20:35:56 -0800
lintian (1.23.40) unstable; urgency=low
Modified: trunk/testset/binary/debian/hello.desktop
===================================================================
--- trunk/testset/binary/debian/hello.desktop 2007-12-09 04:21:55 UTC (rev 1074)
+++ trunk/testset/binary/debian/hello.desktop 2007-12-09 04:41:17 UTC (rev 1075)
@@ -4,7 +4,7 @@
[Desktop Entry]
Name=Hello
Name[en_US]=Hello
-Comment=Say hello!
+Comment=Say hello!
Exec=hello
Icon=hello
Terminal=true
Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary 2007-12-09 04:21:55 UTC (rev 1074)
+++ trunk/testset/tags.binary 2007-12-09 04:41:17 UTC (rev 1075)
@@ -69,6 +69,7 @@
W: binary: desktop-command-not-in-package /usr/share/applications/goodbye.desktop goodbye
W: binary: desktop-entry-contains-unknown-key /usr/share/applications/goodbye.desktop:5 SpecialTag
W: binary: desktop-entry-contains-unknown-key /usr/share/applications/goodbye.desktop:7 icon
+W: binary: desktop-entry-file-has-crs /usr/share/applications/hello.desktop:7
W: binary: desktop-entry-invalid-category WeirdStuff /usr/share/applications/goodbye.desktop
W: binary: desktop-entry-uses-reserved-category Screensaver /usr/share/applications/goodbye.desktop
W: binary: doc-base-abstract-field-separator-extra-whitespaces binary:7
Reply to: