public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] Change ownership of WORKDIR prior to unpacking
@ 2018-02-18 19:38 Jan Kiszka
  2018-02-20 11:08 ` Alexander Smirnov
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2018-02-18 19:38 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

This ensures we can delete old artifacts that may be root-owned after a
build run.

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-20 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-18 19:38 [PATCH] Change ownership of WORKDIR prior to unpacking Jan Kiszka
2018-02-20 11:08 ` Alexander Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox