Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Andreas Müller" <schnitzeltony@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH][v2 05/10] insane.bbclass: introduce a warning for mime missing in inherit
Date: Fri, 17 Jan 2020 22:29:03 +0100	[thread overview]
Message-ID: <20200117212908.32647-6-schnitzeltony@gmail.com> (raw)
In-Reply-To: <20200117212908.32647-1-schnitzeltony@gmail.com>

* looking through layers it looks that usage of mime.bbclass is somewhat
  orphaned
* now that update-mime-database is called once only at image creation time,
  costs of mime.bbclass are limited

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

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 723348fc8e..a2d9318276 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -28,6 +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 \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -185,6 +186,17 @@ def package_qa_check_staticdev(path, name, d, elf, messages):
         package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \
                  (name, package_qa_clean_path(path,d)))
 
+QAPATHTEST[mime] = "package_qa_check_mime"
+def package_qa_check_mime(path, name, d, elf, messages):
+    """
+    Check if package installs mime types to /usr/share/mime/packages
+    while no inheriting mime.bbclass
+    """
+
+    if d.getVar("datadir") + "/mime/packages" in path and path.endswith('.xml') and not bb.data.inherits_class("mime", d):
+        package_qa_add_message(messages, "mime", "package contains mime types but does not inhert mime: %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-17 21:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
2020-01-17 21:28 ` [PATCH][v2 01/10] itstool: add from meta-oe Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 02/10] itstool: extend to nativesdk Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 03/10] shared-mime-info: upgrade 1.10 -> 1.15 Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 04/10] mime.bbclass: rework Andreas Müller
2020-01-17 21:29 ` Andreas Müller [this message]
2020-01-17 21:29 ` [PATCH][v2 06/10] shared-mime-info: add mime to inherit Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 07/10] gcr: " Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 08/10] mime-xdg.bbclass: initial add Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 09/10] insane.bbclass: Spawn warning for missing mime-xdg in inherit Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 10/10] gcr: add mime-xdg to inherit Andreas Müller
2020-01-17 21:32 ` ✗ patchtest: failure for Make MIME work on desktops (rev2) Patchwork
2020-01-18  8:40 ` [PATCH][v2 00/10] Make MIME work on desktops Richard Purdie
2020-01-18 11:08   ` Andreas Müller
2020-01-18 11:13     ` Richard Purdie
2020-01-18 17:49       ` Richard Purdie

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=20200117212908.32647-6-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox