All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Müller" <schnitzeltony@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 10/11] insane.bbclass: Spawn warning for missing mime-xdg in inherit
Date: Thu,  9 Jan 2020 21:26:22 +0100	[thread overview]
Message-ID: <20200109202623.28936-11-schnitzeltony@gmail.com> (raw)
In-Reply-To: <20200109202623.28936-1-schnitzeltony@gmail.com>

If a package signals that it can open mime-types but does not inharit mime-xdg,
a warning is created.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/classes/insane.bbclass | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 442e9e5113..4ca39f22ff 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -28,7 +28,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
             pn-overrides infodir build-deps src-uri-bad \
             unknown-configure-option symlink-to-sysroot multilib \
             invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
-            mime \
+            mime mime-xdg \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -197,6 +197,24 @@ def package_qa_check_mime(path, name, d, elf, messages):
         package_qa_add_message(messages, "mime", "package contains mime types but does not inhert mime.bbclass: %s path '%s'" % \
                  (name, package_qa_clean_path(path,d)))
 
+QAPATHTEST[mime-xdg] = "package_qa_check_mime_xdg"
+def package_qa_check_mime_xdg(path, name, d, elf, messages):
+    """
+    Check if package installs desktop file containing MimeType and requires
+    mime-types.bbclass to create /usr/share/applications/mimeinfo.cache
+    """
+
+    if d.getVar("desktopdir") in path and path.endswith('.desktop') and not bb.data.inherits_class("mime-xdg", d):
+        mime_type_found = False
+        with open(path, 'r') as f:
+            for line in f.read().split('\n'):
+                if 'MimeType' in line:
+                    mime_type_found = True
+                    break;
+        if mime_type_found:
+            package_qa_add_message(messages, "mime-xdg", "package contains desktop file with key 'MimeType' but does not inhert mime-xdg.bbclass: %s path '%s'" % \
+                    (name, package_qa_clean_path(path,d)))
+
 def package_qa_check_libdir(d):
     """
     Check for wrong library installation paths. For instance, catch
-- 
2.21.0



  parent reply	other threads:[~2020-01-09 20:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 20:26 [PATCH 00/11] Make MIME work on desktops Andreas Müller
2020-01-09 20:26 ` [PATCH 01/11] itstool: add from meta-oe Andreas Müller
2020-01-09 20:35   ` Alexander Kanavin
2020-01-09 20:44     ` Andreas Müller
2020-01-09 21:35       ` Alexander Kanavin
2020-01-09 20:26 ` [PATCH 02/11] itstool: extend to nativesdk Andreas Müller
2020-01-09 20:26 ` [PATCH 03/11] shared-mime-info: upgrade 1.10 -> 1.15 Andreas Müller
2020-01-09 20:34   ` Alexander Kanavin
2020-01-09 20:43     ` Andreas Müller
2020-01-09 20:26 ` [PATCH 04/11] bitbake.conf: add variables 'mimedir' and 'desktopdir' Andreas Müller
2020-01-09 22:15   ` Richard Purdie
2020-01-09 22:21     ` Andreas Müller
2020-01-09 22:27       ` Richard Purdie
2020-01-09 22:59         ` Andreas Müller
2020-01-09 20:26 ` [PATCH 05/11] mime.bbclass: rework Andreas Müller
2020-01-09 20:26 ` [PATCH 06/11] insane.bbclass: introduce a warning for mime missing in inherit Andreas Müller
2020-01-10 15:07   ` Peter Kjellerstedt
2020-01-09 20:26 ` [PATCH 07/11] shared-mime-info: add mime to inherit Andreas Müller
2020-01-09 20:26 ` [PATCH 08/11] gcr: " Andreas Müller
2020-01-09 20:26 ` [PATCH 09/11] mime-xdg.bbclass: initial add Andreas Müller
2020-01-09 20:26 ` Andreas Müller [this message]
2020-01-09 20:26 ` [PATCH 11/11] gcr: add mime-xdg to inherit Andreas Müller
2020-01-09 20:32 ` ✗ patchtest: failure for Make MIME work on desktops Patchwork
2020-01-11 10:26 ` [PATCH 00/11] " Andreas Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200109202623.28936-11-schnitzeltony@gmail.com \
    --to=schnitzeltony@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.