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

[lintian] 01/01: Add desktop-entry-lacks-icon-entry tag



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 8f1aedd0a6fc18b6a23b160af72733bd951e67d4
Author: Laurent Bigonville <bigon@debian.org>
Date:   Sun Mar 5 13:13:08 2017 +0100

    Add desktop-entry-lacks-icon-entry tag
    
    Check if a .desktop file contains an Icon entry
    
    Closes: #854132
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/menu-format.desc                                  | 16 ++++++++++++++++
 checks/menu-format.pm                                    |  3 +++
 debian/changelog                                         |  4 +++-
 t/tests/menu-format-desktop-general/debian/crlf.desktop  |  1 +
 .../debian/environments.desktop                          |  1 +
 .../menu-format-desktop-general/debian/general.desktop   |  1 +
 .../debian/reserved-bad.desktop                          |  1 +
 .../menu-format-desktop-general/debian/reserved.desktop  |  1 +
 t/tests/menu-format-desktop-general/desc                 |  1 +
 t/tests/menu-format-desktop-general/tags                 |  1 +
 t/tests/menu-format-desktop-mimetype/debian/bar.desktop  |  1 +
 t/tests/menu-format-desktop-mimetype/debian/foo.desktop  |  1 +
 t/tests/menu-format-general/debian/pargs.desktop         |  1 +
 13 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/checks/menu-format.desc b/checks/menu-format.desc
index fd6f523..8fde714 100644
--- a/checks/menu-format.desc
+++ b/checks/menu-format.desc
@@ -317,6 +317,22 @@ Info: The categories for this desktop entry do not contain any Main
  useful for checking the syntax of desktop entries.
 Ref: https://specifications.freedesktop.org/menu-spec/1.0/apa.html
 
+Tag: desktop-entry-lacks-icon-entry
+Severity: wishlist
+Certainty: certain
+Info: This .desktop file does not contain an "Icon" entry.
+ .
+ "Icon" is the name of the file (without the extension) of the icon displayed
+  by this .desktop file. The icon is searched in the different icon themes.
+  If the name is an absolute path, the given file will be used.
+  The icon should be unique enough to help the user to recogninse the application.
+ .
+ The desktop-file-validate tool in the desktop-file-utils package is
+ useful for checking the syntax of desktop entries.
+Ref: https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s05.html,
+ https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html,
+ #854132
+
 Tag: desktop-entry-lacks-keywords-entry
 Severity: wishlist
 Certainty: certain
diff --git a/checks/menu-format.pm b/checks/menu-format.pm
index 89ac191..3de4490 100644
--- a/checks/menu-format.pm
+++ b/checks/menu-format.pm
@@ -638,6 +638,9 @@ sub verify_desktop_file {
 
     # test if missing Keywords (only if NoDisplay is not set)
     if (!defined $vals{NoDisplay}) {
+        if (!defined $vals{Icon}) {
+            tag 'desktop-entry-lacks-icon-entry', $file;
+        }
         if (!defined $vals{Keywords}) {
             tag 'desktop-entry-lacks-keywords-entry', $file;
         }
diff --git a/debian/changelog b/debian/changelog
index e9dac8f..0d203b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,9 +14,11 @@ lintian (2.5.51) UNRELEASED; urgency=medium
   * checks/files.pm:
     + [BR] Do not report duplicates for package-installs-apt-preferences
       and package-installs-apt-sources.  (Closes: #814521).
-  * checks/menu-format.desc:
+  * checks/menu-format.{desc,pm}:
     + [NT] Update the reference to Desktop Entry Specification to point
       to version 1.1.
+    + [NT] Apply patch from Laurent Bigonville to check desktop files
+      for missing "Icon" field.  (Closes: #854132)
 
   * data/common/source-fields:
     + [NT] Add new "Testsuite-Restrictions" field.
diff --git a/t/tests/menu-format-desktop-general/debian/crlf.desktop b/t/tests/menu-format-desktop-general/debian/crlf.desktop
index 3c8a8b2..4e53c3a 100644
--- a/t/tests/menu-format-desktop-general/debian/crlf.desktop
+++ b/t/tests/menu-format-desktop-general/debian/crlf.desktop
@@ -3,4 +3,5 @@ Name=general
 Comment=An entirely correct desktop entry
 Type=Application
 Categories=Development;Building;
+Icon=foo
 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 7c517d1..51aa674 100644
--- a/t/tests/menu-format-desktop-general/debian/environments.desktop
+++ b/t/tests/menu-format-desktop-general/debian/environments.desktop
@@ -5,4 +5,5 @@ Comment=Incorrectly limited to particular environments
 Categories=Development;
 Exec=foo
 OnlyShowIn=GNOME;KDE;
+Icon=foo
 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 f60c102..f1ef3bd 100644
--- a/t/tests/menu-format-desktop-general/debian/general.desktop
+++ b/t/tests/menu-format-desktop-general/debian/general.desktop
@@ -9,4 +9,5 @@ Categories=Building;Lintian;
 Terminal=true
 TerminalOptions=-g 80x25
 Exec=foo
+#missing Icon
 #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 7073d75..a0b71e1 100644
--- a/t/tests/menu-format-desktop-general/debian/reserved-bad.desktop
+++ b/t/tests/menu-format-desktop-general/debian/reserved-bad.desktop
@@ -4,4 +4,5 @@ Comment=Entry in a reserved category (incorrect)
 Type=Application
 Categories=Screensaver;
 Exec=foo
+Icon=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 dc27301..9256014 100644
--- a/t/tests/menu-format-desktop-general/debian/reserved.desktop
+++ b/t/tests/menu-format-desktop-general/debian/reserved.desktop
@@ -5,4 +5,5 @@ Type=Application
 Categories=Screensaver;
 Exec=foo
 OnlyShowIn=GNOME;KDE;
+Icon=foo
 Keywords=Blur
diff --git a/t/tests/menu-format-desktop-general/desc b/t/tests/menu-format-desktop-general/desc
index d1a90aa..ceff9d4 100644
--- a/t/tests/menu-format-desktop-general/desc
+++ b/t/tests/menu-format-desktop-general/desc
@@ -8,6 +8,7 @@ Test-For:
  desktop-entry-contains-unknown-key
  desktop-entry-file-has-crs
  desktop-entry-invalid-category
+ desktop-entry-lacks-icon-entry
  desktop-entry-lacks-keywords-entry
  desktop-entry-lacks-main-category
  desktop-entry-limited-to-environments
diff --git a/t/tests/menu-format-desktop-general/tags b/t/tests/menu-format-desktop-general/tags
index c908c27..d05d1de 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-icon-entry usr/share/applications/general.desktop
 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
diff --git a/t/tests/menu-format-desktop-mimetype/debian/bar.desktop b/t/tests/menu-format-desktop-mimetype/debian/bar.desktop
index 59661db..20d591d 100644
--- a/t/tests/menu-format-desktop-mimetype/debian/bar.desktop
+++ b/t/tests/menu-format-desktop-mimetype/debian/bar.desktop
@@ -6,4 +6,5 @@ Type=Application
 Categories=Game;BoardGame;GTK;
 MimeType=application/bar;
 Keywords=Lintian
+Icon=foo
 Exec=pargs %U
diff --git a/t/tests/menu-format-desktop-mimetype/debian/foo.desktop b/t/tests/menu-format-desktop-mimetype/debian/foo.desktop
index 6a2a4f5..0e6c1fb 100644
--- a/t/tests/menu-format-desktop-mimetype/debian/foo.desktop
+++ b/t/tests/menu-format-desktop-mimetype/debian/foo.desktop
@@ -5,4 +5,5 @@ Comment=A foo test entry for Lintian
 Type=Application
 Categories=Game;BoardGame;GTK;
 MimeType=application/foo;
+Icon=foo
 Keywords=Lintian
diff --git a/t/tests/menu-format-general/debian/pargs.desktop b/t/tests/menu-format-general/debian/pargs.desktop
index a31e9bd..b84ecf2 100644
--- a/t/tests/menu-format-general/debian/pargs.desktop
+++ b/t/tests/menu-format-general/debian/pargs.desktop
@@ -4,4 +4,5 @@ Type=Application
 Comment=Argument Printer
 Categories=Development;
 Keywords=Argument;Printer;
+Icon=foo
 Exec=pargs-section

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: