+
     Gi	  c                   sN    ^ RI t ^ RItR/ 3R ltRRRR/ R3R ltRRRR/ 3R ltR# )i    Nc                s   . pVP                  4        F8  w  rEVP                  VR,           \        P                  ! V4      ,           4       K:  	  \	        \        V 4      4       F.  pVP                  \        P                  ! W,          4      4       K0  	  RP                  V4      pV'       d,   R\        P                  ! V4      ,           R,           V,           pV# )a  
Convert a shell command passed as list into a flat shell string with
proper escaping.

:param cmd: command as list, e.g. ["echo", "string with spaces"]
:param working_dir: when set, prepend "cd ...;" to execute the command
                    in the given working directory
:param env: dict of environment variables to be passed to the command, e.g.
            {"JOBS": "5"}
:returns: the flat string, e.g.
          echo 'string with spaces'
          cd /home/pmos;echo 'string with spaces'
= cd Z;)itemsZappendshlexZquoteZrangeZlenjoin)cmdworking_direnvZescapedkeyvalueZiZrets   &&&     &/usr/lib/waydroid/tools/helpers/run.pyflat_cmdr      s     Giik
sSy5;;u#556 "3s8_u{{36*+  ((7
Cekk+..4s:J    ZlogFc           
     sh   RpVP                  4        F"  w  rWR,           V
,           R,           ,          pK$  	  V'       d   VRV,           R,           ,          pVRP                  V4      ,          pV'       d   RR\        WR7      .p\        P                  P
                  P                  WWVWEV4      # )	z
Run a command on the host system as user.

:param env: dict of environment variables to be passed to the command, e.g.
            {"JOBS": "5"}

See tools.helpers.run_core.core() for a detailed description of all other
arguments and the return value.
z% r    r   r   z; sh-cr   )r   r   r   toolsZhelpersZrun_coreZcore)argsr   r   outputoutput_returncheckr   sudoZmsgr	   r
   s   &&&&&&&&   r   userr   $   s     Ciik
Sy5 3&& "u{"T))388C=C T8C12==!!&&t#F%24A Ar   c           
     sb    V'       d   RR\        WR7      .pR.V,           p\        WW#WEVR4      # )a  
Run a command on the host system as root, with sudo.

:param env: dict of environment variables to be passed to the command, e.g.
            {"JOBS": "5"}

See tools.helpers.run_core.core() for a detailed description of all other
arguments and the return value.
r   r   r   r   T)r   r   )r   r   r   r   r   r   r   s   &&&&&&&r   rootr   >   s;     T8C12(S.C;c r   )r   Ztools.helpers.run_corer   r   r   r   ) r   r   <module>r      sB      # : !%U%%A4 !%U%r   