[OE-core] [PATCH 1/3] insane.bbclass: show PN and relative path in package_qa_check_host_user
Martin Jansa
martin.jansa at gmail.com
Fri Sep 18 15:13:44 UTC 2015
On Fri, Sep 18, 2015 at 03:41:47PM +0200, Mike Looijmans wrote:
> On 18-09-15 15:14, Martin Jansa wrote:
> > * show PN as other QA checks
> > * strip PKGDEST prefix from shown path as other QA checks
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
> > ---
> > meta/classes/insane.bbclass | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> > index 5c8629a..a35e546 100644
> > --- a/meta/classes/insane.bbclass
> > +++ b/meta/classes/insane.bbclass
> > @@ -980,6 +980,7 @@ def package_qa_check_host_user(path, name, d, elf, messages):
> > return
> >
> > dest = d.getVar('PKGDEST', True)
> > + pn = d.getVar('PN', True)
> > home = os.path.join(dest, 'home')
> > if path == home or path.startswith(home + os.sep):
> > return
> > @@ -991,14 +992,15 @@ def package_qa_check_host_user(path, name, d, elf, messages):
> > if exc.errno != errno.ENOENT:
> > raise
> > else:
> > + rootfs_path = path[len(dest):]
> > check_uid = int(d.getVar('HOST_USER_UID', True))
> > if stat.st_uid == check_uid:
> > - messages["host-user-contaminated"] = "%s is owned by uid %d, which is the same as the user running bitbake. This may be due to host contamination" % (path, check_uid)
> > + messages["host-user-contaminated"] = "%s: %s is owned by uid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_uid)
> > return False
> >
> > check_gid = int(d.getVar('HOST_USER_GID', True))
> > if stat.st_gid == check_gid:
> > - messages["host-user-contaminated"] = "%s is owned by gid %d, which is the same as the user running bitbake. This may be due to host contamination" % (path, check_gid)
> > + messages["host-user-contaminated"] = "$s: %s is owned by gid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_gid)
>
> I think "$s" is a typo (that will lead to a Python exception).
You're right, but doesn't lead to python exception here
even the pn was printed out in my test build with this, e.g.:
NOTE: recipe e-wm-0.18.8-r0: task do_package_qa: Started
WARNING: QA Issue: e-wm: /e-wm-dbg/usr/src/debug/e-wm/0.18.8-r0/build/src/bin/e_fm_shared_types.h is owned by uid 1026, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
NOTE: recipe e-wm-0.18.8-r0: task do_package_qa: Succeeded
But v2 comming with %s. Thanks
--
Martin 'JaMa' Jansa jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150918/a19045f2/attachment-0002.sig>
More information about the Openembedded-core
mailing list