źhu dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddlm Z ddl mZdd lmZmZmZdd lmZdd lmZmZd d lmZddlmZddlmZddlmZdZddddddZddddddddddddeddddddddddddd Z erd!d!d"d#d$de d%<d!d!d&d'd$de d(<e !ej"dZ#d)Z$d*Z%d+Z&d,Z'd-Z(d.Z)d/Z*d0Z+d1Z,d2Z-Gd3d4e Z.dS)5zFdistutils.command.install Implements the Distutils 'install' command.N)log)Command)DEBUG)get_config_vars) write_file) convert_path subst_vars change_root) get_platform)DistutilsOptionErrorDistutilsPlatformError)_framework_compat) _collections) USER_BASE) USER_SITETz{base}/Lib/site-packagesz{base}/Include/{dist_name}z{base}/Scriptsz{base})purelibplatlibheadersscriptsdatazA{base}/lib/{implementation_lower}{py_version_short}/site-packageszN{platbase}/{platlibdir}/{implementation_lower}{py_version_short}/site-packageszM{base}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z {base}/binz!{base}/lib/{implementation_lower}z*{base}/{platlibdir}/{implementation_lower}z1{base}/include/{implementation_lower}/{dist_name}z{base}/site-packagesz{base}/include/{dist_name}) posix_prefix posix_homentpypypypy_ntz {usersite}zF{userbase}/{implementation}{py_version_nodot_plat}/Include/{dist_name}z:{userbase}/{implementation}{py_version_nodot_plat}/Scriptsz {userbase}nt_userzQ{userbase}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z{userbase}/bin posix_userctjt5dtjDcdddS#1swxYwYdS)Nc<i|]}|tj|dS)F)expand) sysconfig get_paths).0schemes /builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_distutils/command/install.py z+_load_sysconfig_schemes..es:    I'u===   ) contextlibsuppressAttributeErrorr#get_scheme_namesr)r'_load_sysconfig_schemesr/cs  ^ , ,    #466                     sAA ActpifdttjtDS)z= Extend default schemes with schemes from sysconfig. cxi|]6}|it|i|i7Sr.)INSTALL_SCHEMESget)r%r&sysconfig_schemess r'r(z!_load_schemes..rs`      !!&"-- ##FB//    r))r/set itertoolschainr2)r4s@r' _load_schemesr8ksX 0117R     )//;LMMNN    r)c4ttdrdSdS)Npypy_version_infoPyPyPython)hasattrsysr.r)r'_get_implementationr?{ss'((vxr)ct|tt|}t|t |t |dSN)_inject_headers _load_scheme_resolve_schemevarsupdate _remove_set _scheme_attrs)obnamer&s r'_select_schemerKsQ T<0E0E#F#F G GFHHOOKM&$9$9::;;;;;r)cDfd|DS)z1 Include only attrs that are None in ob. c<i|]\}}t|||SrA)getattr)r%keyvaluerIs r'r(z_remove_set..s. S S S:3'"c:J:J:RC:R:R:Rr))items)rIattrss` r'rGrGs( T S S S S S SSr)c|d\}}} tj|}n1#t$r$t jt |}YnwxYw|S)N_) partitionr#get_preferred_scheme Exceptionfwr& _pypy_hack)rJos_nameseprOresolveds r'rDrDsls++GS#/1#66 ///9Z--../ Os0+AAc*t|SrA)r8)rJs r'rCrCs ??4  r)cvtt|}|d|d|S)z Given a scheme name and the resolved scheme, if the scheme does not include headers, resolve the fallback scheme for the name and use headers from it. pypa/distutils#88 r)rCrY setdefault)rJr&fallbacks r'rBrBs9Jt,,--H i)!4555 Mr)c*fdtDS)z.s( A A Ac s  fSk A A Ar)) SCHEME_KEYS)r&s`r'rHrHs A A A A[ A A AAr)ctjdk}ttdo|}|d }ddtjdkzz}|r|r|n|S)N)r:)_user_homer_ntr)r> version_infor=endswithosrJ)rJPY37old_pypyprefix pypy_names r'rYrYsb  f $Ds/009TH122 2F"'T/22I 5V 5995r)c0eZdZdZgdZgdZer0edddezfedddiZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdefdefd efd!efd"d#fgZdS)$installz'install everything from build directory))zprefix=Nzinstallation prefix)z exec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nzversionsplitrrr, distributionget_name get_version get_fullnamerkrNr?lowerdictreplace HAS_USER_SITErrr DictStackrXrEr# config_varsexpand_basedirsrrprint expand_dirscreate_home_pathrhas_ext_modulesrr convert_pathshandle_extra_pathinstall_libbasepathjoin extra_dirsr change_rootsset_undefined_options)rrrpr}r local_vars compat_varsrs r'finalize_optionszinstall.finalize_optionsLs K 4+ ty    !%!6 '>  9 $+ )9 &K  9  K  y   $ ':  7g   ( GHHH#'  2333 7g         ! ! ! 5666[&&((+ /- H H |HH   HHH *3355 -99;;!.;;==$ '#*:2A2*> > &)9"1")= = *& !#|U;;$7$9$9$?$?$A$A133  $")#x"<"<"D"DS""M"M    ;%)%:Jz "%)%:Jz "'1 WYY Y%>%@%@* M    /000". 6!%!6 :  + % % % % % % . ! ! ! F4()) * * *  +,,, 9 $  ! ! # # #   # 0022 8#'#7  #'#7              #/7<<(8$/JJ 9   5)Y 69    ./// "" 13M     s E++ E:9E:ctsdSddlm}tj|dz|jD]}|d}|ddkr |dd}||jvr4|j|}||}t|| }n%||}t||}tjd||dS) zDumps the list of user options.Nr) longopt_xlate:r=z %s: %s) r fancy_getoptrrdebug user_options negative_opt translaterN)rmsgroptopt_namevals r'rzinstall.dump_dirss  F000000 #)$ 1 1C1vH|s""#AbD>4,,,,X6#--m<<!$111#--m<<dH-- Ij(C 0 0 0 0 1 1r)cP|j|jI|jduo|jduo|jdup|jdup|jdup|jdu}|rtddS|j r@|j td|j x|_|_| ddS|j *|j x|_|_| ddS|j|jtdt!t"dd}t$jt*j|z|_t$jt*j|z|_n|j |j|_|j|_|j|_| d dS) z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete$User base directory is not specifiedrrz*must not supply exec-prefix without prefix_prefix_additionrr)rrrrrrrrr r{rr select_schemer~rpr}rNr#rmrnormpathr>)rincomplete_schemers r'rzinstall.finalize_unixs   (D,A,M$,5,45,4- '4/ - '4/ -$, ! *8 F 9 /$,,-STTT8<8M MD  5   | , , , , , Y "8< AD  5   | , , , , ,{"#/.D $+96H"#M#M  g..sz::=MM #%7#3#3CO#D#DGW#W  #+'+{D$ $ D $($4D !   ~ . . . . .r)c4|jrM|jtd|jx|_|_|t jdzdS|j*|jx|_|_|ddS|j .t j tj |_ |j x|_|_ |t jdS#t$rtdt jzwxYw)z)Finalizes options for non-posix platformsNrrhrz)I don't know how to install stuff on '%s')r{rrrrrrmrJr~rprrr>KeyErrorrs r'rzinstall.finalize_otherFs 9 $,,-STTT8<8M MD  5   rw0 1 1 1 1 1 Y "8< AD  5   | , , , , ,{" g..sz:: 8< CD  5 ""27+++++   ,?"'I s C00'Dc&t||dSrA)rK)rrJs r'rzinstall.select_scheme\stT"""""r)c|D]g}t||}|Stjdvrtj|}t ||j}t|||hdS)N)rr)rNrmrJr expanduserr rsetattr)rrRattrrs r' _expand_attrszinstall._expand_attrs_sv ) )D$%%C7o--',,S11C d&677dC(((  ) )r)c4|gddS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.)rrrNrrs r'rzinstall.expand_basedirshs% GGGHHHHHr)c4|gddS)z+Calls `os.path.expanduser` on install dirs.)rrrrrrNrrs r'rzinstall.expand_dirsms3     r)c r|D]3}d|z}t||tt||4dS)z!Call `convert_path` over `names`.rcN)rr rNrnamesrJrs r'rzinstall.convert_pathszsP C CD$D D$ WT4-@-@ A A B B B B C Cr)c|j|jj|_|jtjdt |jt r|jd|_t|jdkr|jdx}}n2t|jdkr |j\}}ntdt|}nd}d}||_ ||_ dS) z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.,rrrzY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr) rrrwarning isinstancestrrlenr r path_filer)rrrs r'rzinstall.handle_extra_paths ? ""/:DO ? & K.   $/3// ="&/"7"7"<"<4?##q(()-);; JJT_%%**(,% ::*B&j11JJIJ#$r)c ~|D]9}d|z}t||t|jt||:dS)z:Change the install directories pointed by name using root.rcN)rr rrNrs r'rzinstall.change_rootssT M MD$D D$ DIwtT7J7J K K L L L L M Mr)c|jsdSttjd}|jD]s\}}t||rLtj |s-| d|ztj |dtdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) r{r rmrrrrQr startswithisdir debug_printmakedirs)rr~rJrs r'rzinstall.create_home_pathsy  FBG..s3344*0022 ) )JD$4yy##D)) )"'--2E2E )  !;d!BCCC D%((( ) )r)c|js\|d|jdj}|jr!|t krtd|D]}|||j r| |j r| }|j rFt|j }tt|D]}|||d||<|t"|j |fd|j zt%t&jjt,j}t%t&jj|}t&jt&j|j}|jr.|j r|js$||vrt5jd|jdSdSdSdS)zRuns the command.rz"Can't install when cross-compilingNz'writing list of installed files to '%s'zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r run_commandrget_command_obj plat_namerr rget_sub_commandsrcreate_path_filer get_outputsrrrangeexecutermaprmrrr>normcaserrrr)r build_platcmd_nameoutputsroot_lencountersys_pathrs r'runz install.runs V   W % % %*::7CCMJ} V|~~!=!=,-TUUU--// ' 'H   X & & & & > $  ! ! # # # ; &&((Gy Cty>>$S\\22CCG'.w'7 'BGG$$ LLg&9DKG    rw'22rw'22g&&rw'7'78H'I'IJJ M ^ (,(> 8++ IE        ,+  r)ctj|j|jdz}|jr)|t||jgfd|zdS| d|zdS)zCreates the .pth file.pthz creating %szpath file '%s' not createdN) rmrrrrrrrrr)rfilenames r'rzinstall.create_path_files7<< 4dnv6MNN  ! ? LLX'89=8;S      II2X= > > > > >r)c^g}|D]G}||}|D]}||vr||H|jrG|jr@|t j|j |jdz|S)z.Assembles the outputs of all the sub-commands.r) rget_finalized_commandrappendrrrmrrr)rr r cmdrs r'rzinstall.get_outputss--// - -H,,X66C OO-- - -7**NN8,,, - > Xd4 X NN27<<(UVV W W Wr)cg}|D]>}||}||?|S)z*Returns the inputs of all the sub-commands)rrextend get_inputs)rinputsr rs r'rzinstall.get_inputss[--// , ,H,,X66C MM#..** + + + + r)cf|jp|jS)zSReturns true if the current distribution has any Python modules to install.)rhas_pure_modulesrrs r'has_libzinstall.has_libs/   . . 0 0 WD4E4U4U4W4W r)c4|jS)zLReturns true if the current distribution has any headers to install.)r has_headersrs r'r zinstall.has_headers ,,...r)c4|jS)zMReturns true if the current distribution has any scripts to. install.)r has_scriptsrs r'r#zinstall.has_scriptsr!r)c4|jS)zJReturns true if the current distribution has any data to. install.)rhas_data_filesrs r'has_datazinstall.has_data s //111r)rrrrinstall_egg_infocdS)NTr.rs r'zinstall.,s$r)) __name__ __module__ __qualname__ descriptionrboolean_optionsrrrrrrrrrrrrrrrrrrrrrrr r#r& sub_commandsr.r)r'rsrss;K:::Lx988O' T>J K    v&&& ),LEEEZp p p j111(//////b,###)))III    CCC !%!%!%FMMM )))000d???    /// /// 222  K( K( " ../ LLLr)rs)/__doc__r>rmr*r#r6distutils._logrcorerrrr file_utilrutilr r r r errorsr rrrrXrsiterrrWINDOWS_SCHEMEr2rFschemesrdr/r8r?rKrGrDrCrBrHrYrsr.r)r'r9s// ''''''""""""8888888888AAAAAAAA%%%%%% *)+  W+37?F  ))/   *)/# 3  FO ""OI 3# %%OL!rz""" C        <<< TTT!!!   BBB 666w w w w w gw w w w w r)