[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.11-12-g3502050



The following commit has been merged in the master branch:
commit 3502050872d812a66534508206385abe45ceed53
Author: Bastien ROUCARIÈS <roucaries.bastien@gmail.com>
Date:   Wed Dec 12 07:35:22 2012 +0100

    Add desktop file with no keywords warning
    
    [nthykier:
     * lower-case "K" in original tag
     * update the test suite
     * fix tag ref (1.0 does not mention "Keywords")
    ]
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/menu-format b/checks/menu-format
index 34de8fa..595d0aa 100644
--- a/checks/menu-format
+++ b/checks/menu-format
@@ -95,6 +95,7 @@ my %known_desktop_keys = map { $_ => 1 }
        Comment
        Icon
        Hidden
+       Keywords
        OnlyShowIn
        NotShowIn
        TryExec
@@ -648,6 +649,13 @@ sub VerifyDesktopFile {
         }
     }
 
+    # test if missing Keywords (only if NoDisplay is not set)
+    if (!defined $vals{NoDisplay}) {
+        if (!defined $vals{Keywords}) {
+            tag 'desktop-entry-lacks-keywords-entry', $file;
+        }
+    }
+
     # Only test whether the binary is in the package if the desktop file is
     # directly under /usr/share/applications.  Too many applications use
     # desktop files for other purposes with custom paths.
diff --git a/checks/menu-format.desc b/checks/menu-format.desc
index 1fc567d..495cfec 100644
--- a/checks/menu-format.desc
+++ b/checks/menu-format.desc
@@ -306,6 +306,18 @@ Info: The categories for this desktop entry do not contain any Main
  useful for checking the syntax of desktop entries.
 Ref: http://standards.freedesktop.org/menu-spec/1.0/apa.html
 
+Tag: desktop-entry-lacks-keywords-entry
+Severity: wishlist
+Certainty: certain
+Info: The categories for this desktop entry do not contain any
+ Keywords. Keywords should not be redundant with the values of Name
+ or GenericName.
+ .
+ The desktop-file-validate tool in the desktop-file-utils package is
+ useful for checking the syntax of desktop entries.
+Ref: http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html,
+ #693918
+
 Tag: desktop-entry-uses-reserved-category
 Severity: normal
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index 7135f12..3951256 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ lintian (2.5.12) UNRELEASED; urgency=low
 
   * Summary of tag changes:
     + Added:
+      - desktop-entry-lacks-keywords-entry
       - dir-or-file-in-build-tree
       - dir-or-file-in-etc-opt
       - dir-or-file-in-home
@@ -14,6 +15,10 @@ lintian (2.5.12) UNRELEASED; urgency=low
   * checks/files{,.desc}:
     + [NT] Apply patch from Bastien Roucariès to catch paths
       in (common) build dirs.  (Closes: #678857)
+  * checks/menu-format{,.desc}:
+    + [NT] Apply patch from Bastien Roucariès to detect missing
+      "Keywords" in desktop files.  Thanks to Jeremy Bicha for
+      the report.  (Closes: #693918)
 
   * lib/Lintian/Collect.pm:
     + [NT] Add "is_non_free" method to easily check of a given
diff --git a/t/tests/lintian-output-colons/upstream/script.desktop b/t/tests/lintian-output-colons/upstream/script.desktop
index 859bb18..d2202c5 100644
--- a/t/tests/lintian-output-colons/upstream/script.desktop
+++ b/t/tests/lintian-output-colons/upstream/script.desktop
@@ -5,3 +5,4 @@ Comment=Incorrectly limited to particular environments
 Categories=Development;
 Exec=script
 OnlyShowIn=GNOME;KDE;
+Keywords=Lintian
diff --git a/t/tests/lintian-output-letter/upstream/script.desktop b/t/tests/lintian-output-letter/upstream/script.desktop
index 859bb18..d2202c5 100644
--- a/t/tests/lintian-output-letter/upstream/script.desktop
+++ b/t/tests/lintian-output-letter/upstream/script.desktop
@@ -5,3 +5,4 @@ Comment=Incorrectly limited to particular environments
 Categories=Development;
 Exec=script
 OnlyShowIn=GNOME;KDE;
+Keywords=Lintian
diff --git a/t/tests/lintian-output-xml/upstream/script.desktop b/t/tests/lintian-output-xml/upstream/script.desktop
index 859bb18..d2202c5 100644
--- a/t/tests/lintian-output-xml/upstream/script.desktop
+++ b/t/tests/lintian-output-xml/upstream/script.desktop
@@ -5,3 +5,4 @@ Comment=Incorrectly limited to particular environments
 Categories=Development;
 Exec=script
 OnlyShowIn=GNOME;KDE;
+Keywords=Lintian
diff --git a/t/tests/menu-format-desktop-general/debian/crlf.desktop b/t/tests/menu-format-desktop-general/debian/crlf.desktop
index ea3eb03..3c8a8b2 100644
--- a/t/tests/menu-format-desktop-general/debian/crlf.desktop
+++ b/t/tests/menu-format-desktop-general/debian/crlf.desktop
@@ -3,3 +3,4 @@ Name=general
 Comment=An entirely correct desktop entry
 Type=Application
 Categories=Development;Building;
+Keywords=Foobar
diff --git a/t/tests/menu-format-desktop-general/debian/environments.desktop b/t/tests/menu-format-desktop-general/debian/environments.desktop
index e0a4b59..7c517d1 100644
--- a/t/tests/menu-format-desktop-general/debian/environments.desktop
+++ b/t/tests/menu-format-desktop-general/debian/environments.desktop
@@ -5,3 +5,4 @@ Comment=Incorrectly limited to particular environments
 Categories=Development;
 Exec=foo
 OnlyShowIn=GNOME;KDE;
+Keywords=Golf
diff --git a/t/tests/menu-format-desktop-general/debian/general.desktop b/t/tests/menu-format-desktop-general/debian/general.desktop
index 2a0ef96..f60c102 100644
--- a/t/tests/menu-format-desktop-general/debian/general.desktop
+++ b/t/tests/menu-format-desktop-general/debian/general.desktop
@@ -9,3 +9,4 @@ Categories=Building;Lintian;
 Terminal=true
 TerminalOptions=-g 80x25
 Exec=foo
+#missing Keywords
diff --git a/t/tests/menu-format-desktop-general/debian/reserved-bad.desktop b/t/tests/menu-format-desktop-general/debian/reserved-bad.desktop
index c503ecb..7073d75 100644
--- a/t/tests/menu-format-desktop-general/debian/reserved-bad.desktop
+++ b/t/tests/menu-format-desktop-general/debian/reserved-bad.desktop
@@ -4,3 +4,4 @@ Comment=Entry in a reserved category (incorrect)
 Type=Application
 Categories=Screensaver;
 Exec=foo
+Keywords=Fun
diff --git a/t/tests/menu-format-desktop-general/debian/reserved.desktop b/t/tests/menu-format-desktop-general/debian/reserved.desktop
index bfbc5be..dc27301 100644
--- a/t/tests/menu-format-desktop-general/debian/reserved.desktop
+++ b/t/tests/menu-format-desktop-general/debian/reserved.desktop
@@ -5,3 +5,4 @@ Type=Application
 Categories=Screensaver;
 Exec=foo
 OnlyShowIn=GNOME;KDE;
+Keywords=Blur
diff --git a/t/tests/menu-format-desktop-general/desc b/t/tests/menu-format-desktop-general/desc
index 216c89b..ae35e8c 100644
--- a/t/tests/menu-format-desktop-general/desc
+++ b/t/tests/menu-format-desktop-general/desc
@@ -9,6 +9,7 @@ Test-For:
  desktop-entry-contains-unknown-key
  desktop-entry-file-has-crs
  desktop-entry-invalid-category
+ desktop-entry-lacks-keywords-entry
  desktop-entry-lacks-main-category
  desktop-entry-limited-to-environments
  desktop-entry-uses-reserved-category
diff --git a/t/tests/menu-format-desktop-general/tags b/t/tests/menu-format-desktop-general/tags
index eeaafec..c908c27 100644
--- a/t/tests/menu-format-desktop-general/tags
+++ b/t/tests/menu-format-desktop-general/tags
@@ -1,5 +1,6 @@
 E: menu-format-desktop-general: executable-desktop-file usr/share/applications/general.desktop 0755
 I: menu-format-desktop-general: desktop-entry-contains-encoding-key usr/share/applications/general.desktop:7 Encoding
+I: menu-format-desktop-general: desktop-entry-lacks-keywords-entry usr/share/applications/general.desktop
 I: menu-format-desktop-general: desktop-entry-limited-to-environments usr/share/applications/environments.desktop
 W: menu-format-desktop-general: desktop-command-not-in-package usr/share/applications/environments.desktop foo
 W: menu-format-desktop-general: desktop-command-not-in-package usr/share/applications/general.desktop foo
diff --git a/t/tests/menu-format-desktop-mimetype/debian/foo.desktop b/t/tests/menu-format-desktop-mimetype/debian/foo.desktop
index 60a3552..6a2a4f5 100644
--- a/t/tests/menu-format-desktop-mimetype/debian/foo.desktop
+++ b/t/tests/menu-format-desktop-mimetype/debian/foo.desktop
@@ -5,3 +5,4 @@ Comment=A foo test entry for Lintian
 Type=Application
 Categories=Game;BoardGame;GTK;
 MimeType=application/foo;
+Keywords=Lintian
diff --git a/testset/tags.binary b/testset/tags.binary
index b856eeb..81deca7 100644
--- a/testset/tags.binary
+++ b/testset/tags.binary
@@ -58,6 +58,8 @@ I: binary: binary-has-unneeded-section usr/bin/hello-static .comment
 I: binary: capitalization-error-in-description debian Debian
 I: binary: desktop-entry-contains-encoding-key usr/share/applications/goodbye.desktop:11 Encoding
 I: binary: desktop-entry-contains-encoding-key usr/share/applications/hello.desktop:13 Encoding
+I: binary: desktop-entry-lacks-keywords-entry usr/share/applications/goodbye.desktop
+I: binary: desktop-entry-lacks-keywords-entry usr/share/applications/hello.desktop
 I: binary: no-md5sums-control-file
 W: binary source: ancient-standards-version 3.2.1 (current is 3.9.4)
 W: binary source: debian-rules-ignores-make-clean-error line 14

-- 
Debian package checker


Reply to: