diff options
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 5b60f6f7bc..795c7b9212 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 \ | |||
28 | pn-overrides infodir build-deps src-uri-bad \ | 28 | pn-overrides infodir build-deps src-uri-bad \ |
29 | unknown-configure-option symlink-to-sysroot multilib \ | 29 | unknown-configure-option symlink-to-sysroot multilib \ |
30 | invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ | 30 | invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ |
31 | mime \ | 31 | mime mime-xdg \ |
32 | " | 32 | " |
33 | ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ | 33 | ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ |
34 | perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ | 34 | perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ |
@@ -197,6 +197,35 @@ def package_qa_check_mime(path, name, d, elf, messages): | |||
197 | package_qa_add_message(messages, "mime", "package contains mime types but does not inhert mime: %s path '%s'" % \ | 197 | package_qa_add_message(messages, "mime", "package contains mime types but does not inhert mime: %s path '%s'" % \ |
198 | (name, package_qa_clean_path(path,d))) | 198 | (name, package_qa_clean_path(path,d))) |
199 | 199 | ||
200 | QAPATHTEST[mime-xdg] = "package_qa_check_mime_xdg" | ||
201 | def package_qa_check_mime_xdg(path, name, d, elf, messages): | ||
202 | """ | ||
203 | Check if package installs desktop file containing MimeType and requires | ||
204 | mime-types.bbclass to create /usr/share/applications/mimeinfo.cache | ||
205 | """ | ||
206 | |||
207 | if d.getVar("datadir") + "/applications" in path and path.endswith('.desktop') and not bb.data.inherits_class("mime-xdg", d): | ||
208 | mime_type_found = False | ||
209 | try: | ||
210 | with open(path, 'r') as f: | ||
211 | for line in f.read().split('\n'): | ||
212 | if 'MimeType' in line: | ||
213 | mime_type_found = True | ||
214 | break; | ||
215 | except: | ||
216 | # At least libreoffice installs symlinks with absolute paths that are dangling here. | ||
217 | # We could implement some magic but for few (one) recipes it is not worth the effort so just warn: | ||
218 | wstr = "%s cannot open %s - is it a symlink with absolute path?\n" % (name, package_qa_clean_path(path,d)) | ||
219 | wstr += "Please check if (linked) file contains key 'MimeType'.\n" | ||
220 | pkgname = name | ||
221 | if name == d.getVar('PN'): | ||
222 | pkgname = '${PN}' | ||
223 | wstr += "If yes: add \'inhert mime-xdg\' and \'MIME_XDG_PACKAGES += \"%s\"\' / if no add \'INSANE_SKIP_%s += \"mime-xdg\"\' to recipe." % (pkgname, pkgname) | ||
224 | package_qa_add_message(messages, "mime-xdg", wstr) | ||
225 | if mime_type_found: | ||
226 | package_qa_add_message(messages, "mime-xdg", "package contains desktop file with key 'MimeType' but does not inhert mime-xdg: %s path '%s'" % \ | ||
227 | (name, package_qa_clean_path(path,d))) | ||
228 | |||
200 | def package_qa_check_libdir(d): | 229 | def package_qa_check_libdir(d): |
201 | """ | 230 | """ |
202 | Check for wrong library installation paths. For instance, catch | 231 | Check for wrong library installation paths. For instance, catch |