diff mbox series

insane: ensure more paths have the workdir removed

Message ID 20231208105655.3986590-1-ross.burton@arm.com
State Accepted, archived
Commit 7f1a862d2a432f216e37bf63648bef787422a43d
Headers show
Series insane: ensure more paths have the workdir removed | expand

Commit Message

Ross Burton Dec. 8, 2023, 10:56 a.m. UTC
From: Ross Burton <ross.burton@arm.com>

When showing paths to the user we don't want to include the whole build
directory.  Passing the package name to package_qa_clean_path strips
this completely.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-global/insane.bbclass | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index b78bb6f445d..72fcf6b2544 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -104,7 +104,7 @@  def package_qa_check_shebang_size(path, name, d, elf, messages):
             return
 
         if len(stanza) > 129:
-            oe.qa.add_message(messages, "shebang-size", "%s: %s maximum shebang size exceeded, the maximum size is 128." % (name, package_qa_clean_path(path, d)))
+            oe.qa.add_message(messages, "shebang-size", "%s: %s maximum shebang size exceeded, the maximum size is 128." % (name, package_qa_clean_path(path, d, name)))
             return
 
 QAPATHTEST[libexec] = "package_qa_check_libexec"
@@ -116,7 +116,7 @@  def package_qa_check_libexec(path,name, d, elf, messages):
         return True
 
     if 'libexec' in path.split(os.path.sep):
-        oe.qa.add_message(messages, "libexec", "%s: %s is using libexec please relocate to %s" % (name, package_qa_clean_path(path, d), libexec))
+        oe.qa.add_message(messages, "libexec", "%s: %s is using libexec please relocate to %s" % (name, package_qa_clean_path(path, d, name), libexec))
         return False
 
     return True
@@ -208,7 +208,7 @@  def package_qa_check_staticdev(path, name, d, elf, messages):
 
     if not name.endswith("-pic") and not name.endswith("-staticdev") and not name.endswith("-ptest") and path.endswith(".a") and not path.endswith("_nonshared.a") and not '/usr/lib/debug-static/' in path and not '/.debug-static/' in path:
         oe.qa.add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \
-                 (name, package_qa_clean_path(path,d, name)))
+                 (name, package_qa_clean_path(path, d, name)))
 
 QAPATHTEST[mime] = "package_qa_check_mime"
 def package_qa_check_mime(path, name, d, elf, messages):
@@ -219,7 +219,7 @@  def package_qa_check_mime(path, name, d, elf, messages):
 
     if d.getVar("datadir") + "/mime/packages" in path and path.endswith('.xml') and not bb.data.inherits_class("mime", d):
         oe.qa.add_message(messages, "mime", "package contains mime types but does not inherit mime: %s path '%s'" % \
-                 (name, package_qa_clean_path(path,d)))
+                 (name, package_qa_clean_path(path, d, name)))
 
 QAPATHTEST[mime-xdg] = "package_qa_check_mime_xdg"
 def package_qa_check_mime_xdg(path, name, d, elf, messages):
@@ -239,7 +239,7 @@  def package_qa_check_mime_xdg(path, name, d, elf, messages):
         except:
             # At least libreoffice installs symlinks with absolute paths that are dangling here.
             # We could implement some magic but for few (one) recipes it is not worth the effort so just warn:
-            wstr = "%s cannot open %s - is it a symlink with absolute path?\n" % (name, package_qa_clean_path(path,d))
+            wstr = "%s cannot open %s - is it a symlink with absolute path?\n" % (name, package_qa_clean_path(path, d, name))
             wstr += "Please check if (linked) file contains key 'MimeType'.\n"
             pkgname = name
             if name == d.getVar('PN'):
@@ -247,8 +247,8 @@  def package_qa_check_mime_xdg(path, name, d, elf, messages):
             wstr += "If yes: add \'inhert mime-xdg\' and \'MIME_XDG_PACKAGES += \"%s\"\' / if no add \'INSANE_SKIP:%s += \"mime-xdg\"\' to recipe." % (pkgname, pkgname)
             oe.qa.add_message(messages, "mime-xdg", wstr)
         if mime_type_found:
-            oe.qa.add_message(messages, "mime-xdg", "package contains desktop file with key 'MimeType' but does not inhert mime-xdg: %s path '%s'" % \
-                    (name, package_qa_clean_path(path,d)))
+            oe.qa.add_message(messages, "mime-xdg", "%s: contains desktop file with key 'MimeType' but does not inhert mime-xdg: %s" % \
+                    (name, package_qa_clean_path(path, d, name)))
 
 def package_qa_check_libdir(d):
     """
@@ -321,8 +321,8 @@  def package_qa_check_dbg(path, name, d, elf, messages):
 
     if not "-dbg" in name and not "-ptest" in name:
         if '.debug' in path.split(os.path.sep):
-            oe.qa.add_message(messages, "debug-files", "non debug package contains .debug directory: %s path %s" % \
-                     (name, package_qa_clean_path(path,d)))
+            oe.qa.add_message(messages, "debug-files", "%s: non debug package contains .debug directory %s" % \
+                     (name, package_qa_clean_path(path, d, name)))
 
 QAPATHTEST[arch] = "package_qa_check_arch"
 def package_qa_check_arch(path,name,d, elf, messages):
@@ -371,7 +371,7 @@  def package_qa_check_arch(path,name,d, elf, messages):
                  (elf.abiSize(), bits, package_qa_clean_path(path, d, name)))
     elif not ((littleendian == elf.isLittleEndian()) or is_bpf):
         oe.qa.add_message(messages, "arch", "Endiannes did not match (%d, expected %d) in %s" % \
-                 (elf.isLittleEndian(), littleendian, package_qa_clean_path(path,d, name)))
+                 (elf.isLittleEndian(), littleendian, package_qa_clean_path(path, d, name)))
 
 QAPATHTEST[desktop] = "package_qa_check_desktop"
 def package_qa_check_desktop(path, name, d, elf, messages):