[bitbake-devel] bitbake: Allow arguments in FAKEROOTCMD

Submitted by Joshua Watt on Feb. 7, 2019, 4:56 p.m. | Patch ID: 158582

Details

Message ID 20190207165603.20306-1-JPEWhacker@gmail.com
State Superseded
Headers show

Commit Message

Joshua Watt Feb. 7, 2019, 4:56 p.m.
Changes FAKEROOTCMD so that it can accept additional arguments to pass
to the fakeroot implementation instead of being treated as a simple
command

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 bitbake/lib/bb/runqueue.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 6002ccf06a8..56b8319528c 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1221,12 +1221,12 @@  class RunQueue:
         if fakeroot:
             magic = magic + "beef"
             mcdata = self.cooker.databuilder.mcdata[mc]
-            fakerootcmd = mcdata.getVar("FAKEROOTCMD")
+            fakerootcmd = mcdata.getVar("FAKEROOTCMD").split()
             fakerootenv = (mcdata.getVar("FAKEROOTBASEENV") or "").split()
             env = os.environ.copy()
             for key, value in (var.split('=') for var in fakerootenv):
                 env[key] = value
-            worker = subprocess.Popen([fakerootcmd, "bitbake-worker", magic], stdout=subprocess.PIPE, stdin=subprocess.PIPE, env=env)
+            worker = subprocess.Popen(fakerootcmd + ["bitbake-worker", magic], stdout=subprocess.PIPE, stdin=subprocess.PIPE, env=env)
         else:
             worker = subprocess.Popen(["bitbake-worker", magic], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
         bb.utils.nonblockingfd(worker.stdout)

Comments

Christopher Larson Feb. 7, 2019, 10 p.m.
This should really use shlex.split rather than str.split to handle quoting,
etc.

On Thu, Feb 7, 2019 at 9:56 AM Joshua Watt <jpewhacker@gmail.com> wrote:

> Changes FAKEROOTCMD so that it can accept additional arguments to pass
> to the fakeroot implementation instead of being treated as a simple
> command
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  bitbake/lib/bb/runqueue.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
> index 6002ccf06a8..56b8319528c 100644
> --- a/bitbake/lib/bb/runqueue.py
> +++ b/bitbake/lib/bb/runqueue.py
> @@ -1221,12 +1221,12 @@ class RunQueue:
>          if fakeroot:
>              magic = magic + "beef"
>              mcdata = self.cooker.databuilder.mcdata[mc]
> -            fakerootcmd = mcdata.getVar("FAKEROOTCMD")
> +            fakerootcmd = mcdata.getVar("FAKEROOTCMD").split()
>              fakerootenv = (mcdata.getVar("FAKEROOTBASEENV") or "").split()
>              env = os.environ.copy()
>              for key, value in (var.split('=') for var in fakerootenv):
>                  env[key] = value
> -            worker = subprocess.Popen([fakerootcmd, "bitbake-worker",
> magic], stdout=subprocess.PIPE, stdin=subprocess.PIPE, env=env)
> +            worker = subprocess.Popen(fakerootcmd + ["bitbake-worker",
> magic], stdout=subprocess.PIPE, stdin=subprocess.PIPE, env=env)
>          else:
>              worker = subprocess.Popen(["bitbake-worker", magic],
> stdout=subprocess.PIPE, stdin=subprocess.PIPE)
>          bb.utils.nonblockingfd(worker.stdout)
> --
> 2.20.1
>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
Joshua Watt Feb. 15, 2019, 8:37 a.m.
This is a system generated Comment: Patch 158582 was automatically marked as superseded by patch 158711.