public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] Change ownership of WORKDIR prior to unpacking
Date: Tue, 20 Feb 2018 14:08:59 +0300	[thread overview]
Message-ID: <dd77df3c-83a3-56bd-93bb-f35e14852cde@ilbers.de> (raw)
In-Reply-To: <98a8319f-8ec2-e1b9-150a-900a39cfc44d@siemens.com>

On 02/18/2018 10:38 PM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> This ensures we can delete old artifacts that may be root-owned after a
> build run.

Applied to next, thanks.

P.S: after this patch I believe there will be no more proposals to run 
whole bitbake under 'sudo'... :-)

Alex

> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>   meta/classes/base.bbclass | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index b0e174e..f83c4db 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -88,12 +88,17 @@ do_unpack[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
>   
>   # Unpack package and put it into working directory
>   python do_unpack() {
> +    import subprocess
> +
>       src_uri = (d.getVar('SRC_URI', True) or "").split()
>       if len(src_uri) == 0:
>           return
>   
>       rootdir = d.getVar('WORKDIR', True)
>   
> +    uid = str(os.getuid())
> +    subprocess.call('sudo chown -R ' + uid + ' ' + rootdir, shell=True)
> +
>       try:
>           fetcher = bb.fetch2.Fetch(src_uri, d)
>           fetcher.unpack(rootdir)
> 

      reply	other threads:[~2018-02-20 11:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-18 19:38 Jan Kiszka
2018-02-20 11:08 ` Alexander Smirnov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd77df3c-83a3-56bd-93bb-f35e14852cde@ilbers.de \
    --to=asmirnov@ilbers.de \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox