7f#8ddlZddlZddlZddlZddlmZmZmZmZm Z m Z m Z m Z ddl mZddlmZmZddlmZddlmZmZddlmZee eefZde eeefd efd Zde eeefd efd Zde eeefd eefd Z d de eeefdede eddde eede e eefde eede ede ede eded efdZ ded edfdZ!dS)!N)AnyCallableIterableListLiteralMappingOptionalUnion)escape)SpinnerInterface open_spinner)InstallationSubprocessError)VERBOSEsubprocess_logger) HiddenTextargsreturncg}|D]B}t|tr||-||C|S)z& Create a CommandArgs object. ) isinstancelistextendappend)r command_argsargs ~/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/utils/subprocess.py make_commandrsb!#L%% c4  %    $ $ $ $    $ $ $ $ c@dd|DS)z/ Format command arguments for display.  c3K|]N}t|tr!tjt |ntj|VOdS)N)rrshlexquotestr.0rs r z&format_command_args..+sd ",C!z'reveal_command_args..5s- O O O3*S*55 >CJJ3 O O Orr,r(s rreveal_command_argsr/1s P O$ O O OOrFraiseTcmd show_stdoutcwd on_returncodez"Literal["raise", "warn", "ignore"]extra_ok_returncodes extra_environ unset_environspinnerlog_failed_cmd stdout_only command_descc  |g}|g}|rtj} tj} ntj} t } tj| k} | o|du}| d| tj }|r| ||D]}| |d tj t|tjtj| s tjn tj||d}n+#t"$r}|rtjd|| d}~wwxYwg}| s |jsJ|jsJ|j |j}|snR|}||dz| ||r|sJ|n ||jr|jn&#|jr|jwwxYwd|}n|\}}|D] }| ||||D] }| ||||}|jo|j|v}|r1|sJ|r|d n|d |r|d krtA| |j| s|nd }|rttj!d |dditjdtEtG|dditjdtE|pdddi||dkrtj$d| |j|n|dkrntKd||S)a Args: show_stdout: if true, use INFO to log the subprocess's stderr and stdout streams. Otherwise, use DEBUG. Defaults to False. extra_ok_returncodes: an iterable of integer return codes that are acceptable, in addition to 0. Defaults to None, which means []. unset_environ: an iterable of environment variable names to unset prior to calling subprocess.Popen(). log_failed_cmd: if false, failed commands are not logged, only raised. stdout_only: if true, return only stdout, else return both. When true, logging of both stdout and stderr occurs when the subprocess has terminated, else logging occurs as subprocess output is produced. NzRunning command %sbackslashreplace)stdinstdoutstderrr3enverrorsz#Error %s while executing command %sT errordoner0)command_description exit_code output_linesz%srich)extraz*[bold magenta]full command[/]: [blue]%s[/]markupz[bold magenta]cwd[/]: %sz [inherit]warnz$Command "%s" had error code %s in %signorezInvalid value: on_returncode=)&rinfologgingINFOverbosergetEffectiveLevelosenvironcopyupdatepop subprocessPopenr/PIPESTDOUT Exceptioncriticalr?r>closereadlinerstriprspinwaitr' communicate splitlines returncodefinishrrEr r)warning ValueError)r1r2r3r4r5r6r7r8r9r:r;log_subprocess used_levelshowing_subprocess use_spinnerrAnameprocexc all_outputlineoutputouterrout_lineerr_lineproc_had_errorrEs rcall_subprocessry8s6#! .?.D\ +2 +<>>*L)(@WD-@KN'666 *//  C" =!!! d  $ $/?,7L:$$Z_%         &5    J #{{zz   ,,..D ;;==D   dTk * * * N4  w   $ IIKKK{ $ !!###{ $ !!#### $$$##%%S(( % %H N8 $ $ $ $#(( % %H N8 $ $ $ $#_T@T)TN#w  # NN7 # # # # NN6 " " "P G # #/$0//AKZZtE  !'eFD>JJJJ!)@.s3344#T* ").3-+..#T* K f $ $  %6      h & & N]NNOO O Ms%2AD D/D**D/H#H*message).Nc  ddttdttdttttfddffd }|S)zProvide a subprocess_runner that shows a spinner message. Intended for use with for BuildBackendHookCaller. Thus, the runner has an API that matches what's expected by BuildBackendHookCaller.subprocess_runner. Nr1r3r6rct5}t||||ddddS#1swxYwYdS)N)r;r3r6r8)r ry)r1r3r6r8rzs rrunnerz+runner_with_spinner_message..runners ' " " g $+                       s 377)NN)rr#r rr)rzr}s` rrunner_with_spinner_messager~so"59   #Y  c]  S 12         Mr) FNr0NNNNTF)"rPrTr!rYtypingrrrrrrr r pip._vendor.rich.markupr pip._internal.cli.spinnersr r pip._internal.exceptionsrpip._internal.utils.loggingrrpip._internal.utils.miscrr# CommandArgsrr)r/boolintryr~r,rrrs SSSSSSSSSSSSSSSSSSSS******EEEEEEEE@@@@@@BBBBBBBB//////5j)* c:{:; " eDI{$:;     PeDI{$:;PS PPPP:A4815-1*.%)"'ee tCy+% &ee #e8 e #8C=1 e GCH-. eHSM*e& 'eTNe$ee eeeeP)1Dr