hdZddlZddlZddlZddlZddlmcmZ ddl mcm Z ddl m Z mZmZddlmZGdde jZGdde j Z d Zd Zd Zd Zd ZdZedS)a Apply Debian-specific patches to distutils commands. Extracts the customized behavior from patches as reported in pypa/distutils#2 and applies those customizations (except for scheme definitions) to those commands. Place this module somewhere in sys.path to take effect. N) to_filename safe_name safe_version)DistutilsOptionErrorcdeZdZeejjdgzZfdZfdZfdZ xZ S)install)zinstall-layout=Nz7installation layout to choose (known values: deb, unix)cdtd|_d|_dSNsuperinitialize_options prefix_optioninstall_layoutself __class__s ,/usr/lib/python3.11/_distutils_system_mod.pyr zinstall.initialize_options / ""$$$!"c|dkr|jrK|jdvrd}n|jdvrd}ntd|jr(tj|jdkstrd}nFtj|jdkrdx|_|_ dx|_ |_ d}t |dS) N posix_prefix)deb deb_system)unix"unknown value for --install-layout /usr/local/usr posix_local)rlowerrrospathnormpathprefixis_virtual_environment exec_prefix install_baseinstall_platbaser select_scheme)rnamers rr(zinstall.select_scheme%s  > ! !" %&,,..'99'DD(..00H<<)DD.<>>>% %7##DK00L@@+--A%7##DK00L@@5;;DK$"2@FFD%(=$ d#####rc`|j|_tdSr )r#rr finalize_unixrs rr+zinstall.finalize_unix:s)![ r) __name__ __module__ __qualname__list orig_installr user_optionsr r(r+ __classcell__rs@rrrs4 ,9:: D>L ##### $$$$$*         rrcpeZdZeejjdgzZfdZfdZe dZ xZ S)install_egg_info)zinstall-layoutNzcustom installation layoutcdtd|_d|_dSr r rs rr z#install_egg_info.initialize_optionsDrrc|dd|ddtdS)Nr)rr)rr)set_undefined_optionsr finalize_optionsrs rr9z!install_egg_info.finalize_optionsIsM ""9-PQQQ ""9-NOOO   """""rc|jrH|jdvrtd|jdk}n |jrd}nd}|rkt t |jdt t|j d}n~dt t |jt t|j gtj dd Rz}|S) N)rrrrFT-z .egg-infoz%s-%s-py%d.%d.egg-info) rrrrrr distributionget_namer get_versionsys version_info)rno_pyverbasenames rrCzinstall_egg_info.basenameNsF   &,,../AA*8:::+1133uKLL>PL##### ##### Xrr5c`tjtjkpttdS)N real_prefix)r@ base_prefixr#hasattrrrr$r$gs ?cj ( GGC,G,GGrc| p tj|dv}|r|S|r0ts"tj|dddStj|dS)N)rrlibpython3z dist-packagesz site-packages)r r!r"r$join) standard_lib libpython early_prefixr#is_default_prefixs r _posix_librSksz((dBG,<,<\,J,JNd,d8 8#9#;#;8w||FE9oFFFw||I777rcd|vrL|dkr |d}ntjdd}|dkrd|vr|dd}||d<|S)aN 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 headers: module headers install location (posix_local is /local/ prefixed) include: cpython headers (Python.h) See also: bpo-44445 headersrincluderz/local/z /include/z/local/include/)r0INSTALL_SCHEMESreplace)r)schemerUs r_inject_headersrZusp > ! !Y'GG"2>B9MG = Yg%=%=ook3DEEG#y Mrcfd}|S)z Implement the _inject_headers modification, above, but before _inject_headers() was introduced, upstream. So, slower and messier. cp}|D]\}}t|||Sr )itemsrZ)schemesr)rY _load_schemess rwrapped_load_schemesz2load_schemes_wrapper..wrapped_load_schemessA-//#MMOO * *LD& D& ) ) ) )rrJ)r_r`s` rload_schemes_wrapperras$  rcjdD]/}||vr)tj|d}t||||<0dS)zR Ensure that the custom schemes we refer to above are present in schemes. )rrrF)expandN) sysconfig get_pathsrZ)r^r)rYs radd_debian_schemesrfsQ>:: w  (e<<rps 000000000BBBBBBBBB 211111" " " " " l"" " " J%%%%%,=%%%PHHH888,    :::999$r