[OE-core] [PATCH] sanity.bbclass: show warning when chmod fails

Christopher Larson clarson at kergoth.com
Wed Sep 23 20:25:39 UTC 2015


On Wed, Sep 23, 2015 at 9:13 AM, Martin Jansa <martin.jansa at gmail.com>
wrote:

> From: Alex Franco <alejandro.franco at linux.intel.com>
>
> * for some reason this part of:
>   http://patchwork.openembedded.org/patch/102561/
>   wasn't ever merged.
>
> [YOCTO #7669]
>
> Signed-off-by: Alex Franco <alejandro.franco at linux.intel.com>
> Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
> ---
>  meta/classes/sanity.bbclass | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 2eb744f..34f8618 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -839,9 +839,12 @@ def check_sanity_everybuild(status, d):
>      else:
>          bb.utils.mkdirhier(tmpdir)
>          # Remove setuid, setgid and sticky bits from TMPDIR
> -        os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID)
> -        os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID)
> -        os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX)
> +        try:
> +            os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID)
> +            os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID)
> +            os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX)
> +        except OSError:
> +            bb.warn("Unable to chmod TMPDIR: %s" % tmpdir)
>

I'd suggest showing the actual error, here. E.g. "Unable to chmod TMPDIR:
%s" % exc. (The error message from the exception usually includes the path
on disk already, so probably don't need both tmpdir and exc).
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150923/ee944279/attachment-0002.html>


More information about the Openembedded-core mailing list