Skip to content

Commit

Permalink
insane: ensure more paths have the workdir removed
Browse files Browse the repository at this point in the history
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.

(From OE-Core rev: 8fdd2873c46221cefb12ec8d5c1ed3313eee3755)

Signed-off-by: Ross Burton <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
  • Loading branch information
rossburton authored and kraj committed Dec 8, 2023
1 parent b0363ca commit 43563ec
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions meta/classes-global/insane.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -239,16 +239,16 @@ 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'):
pkgname = '${PN}'
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):
"""
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 43563ec

Please sign in to comment.