
    F\hT                         S r SSKrSSKrSSKrSSKJs  Jr  SSK	Js  J
r  SSK	JrJrJr  SSKJr   " S S\R                  5      r " S S\R                  5      r
S	 rS
 rS rS rS r\" 5         g)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)DistutilsOptionErrorc                      ^  \ rS rSr\" \R                  R                  5      S/-   rU 4S jrU 4S jr	U 4S jr
SrU =r$ )install   )zinstall-layout=Nz7installation layout to choose (known values: deb, unix)c                 >   > [         TU ]  5         S U l        S U l        g Nsuperinitialize_optionsprefix_optioninstall_layoutself	__class__s    ,/usr/lib/python3.13/_distutils_system_mod.pyr   install.initialize_options       "$!"    c                 "  > US:X  a  U R                   (       aM  U R                   R                  5       S;   a  SnOU R                   R                  5       S;   a  SnO[        S5      eU R                  (       a-  [        R
                  R                  U R                  5      S:w  d  [        5       (       a  SnOK[        R
                  R                  U R                  5      S:X  a  S=U l        U l	        S=U l
        U l        Sn[        TU ]5  U5        g )	Nposix_prefix)deb
deb_system)unix"unknown value for --install-layout
/usr/local/usrposix_local)r   lowerr   r   ospathnormpathprefixis_virtual_environmentexec_prefixinstall_baseinstall_platbaser   select_scheme)r   namer   s     r   r*   install.select_scheme$   s    >!""&&,,.'9'D((..0H<)D.<> >%%77##DKK0L@+--%77##DKK0L@5;;DK$"2@FFD%(=$d#r   c                 D   > U R                   U l        [        TU ]  5         g r   )r%   r   r   finalize_unixr   s    r   r.   install.finalize_unix9   s    ![[r   )r'   r(   r   r)   r%   r   )__name__
__module____qualname____firstlineno__listorig_installr   user_optionsr   r*   r.   __static_attributes____classcell__r   s   @r   r   r      s=    ,,99:	D> L
#
$*   r   r   c                      ^  \ rS rSr\" \R                  R                  5      S/-   rU 4S jrU 4S jr	\
S 5       rSrU =r$ )install_egg_info>   )zinstall-layoutNzcustom installation layoutc                 >   > [         TU ]  5         S U l        S U l        g r   r   r   s    r   r   #install_egg_info.initialize_optionsC   r   r   c                 j   > U R                  SS5        U R                  SS5        [        TU ]	  5         g )Nr   )r   r   )r   r   )set_undefined_optionsr   finalize_optionsr   s    r   rA   !install_egg_info.finalize_optionsH   s0    ""9-PQ""9-NO "r   c                    U R                   (       aG  U R                   R                  5       S;  a  [        S5      eU R                   R                  5       S:H  nOU R                  (       a  SnOSnU(       a`  [	        [        U R                  R                  5       5      5      < S[	        [        U R                  R                  5       5      5      < S3nU$ S[	        [        U R                  R                  5       5      5      [	        [        U R                  R                  5       5      5      /[        R                  S S	 Q7-  nU$ )
N)r   r   r   r   FT-z	.egg-infoz%s-%s-py%d.%d.egg-info   )r   r!   r   r   r   r   distributionget_namer   get_versionsysversion_info)r   no_pyverbasenames      r   rL   install_egg_info.basenameM   s   &&,,./A*8: :++113u<HHHId&7&7&@&@&BCDL):):)F)F)HIJH  0Id&7&7&@&@&BCDL):):)F)F)HIJ3 !!"1%3 H
 r   )r   r   )r0   r1   r2   r3   r4   orig_install_egg_infor;   r6   r   rA   propertyrL   r7   r8   r9   s   @r   r;   r;   >   sF    ->>KKL>P L#
#
  r   r;   c                  r    [         R                  [         R                  :g  =(       d    [        [         S5      $ )Nreal_prefix)rI   base_prefixr%   hasattr r   r   r&   r&   f   s!    ??cjj(GGC,GGr   c                 $   U(       + =(       d"    [         R                  R                  U5      S;   nU (       a  U$ U(       a1  [        5       (       d"  [         R                  R	                  USSS5      $ [         R                  R	                  US5      $ )N)r   r   libpython3zdist-packageszsite-packages)r"   r#   r$   r&   join)standard_lib	libpythonearly_prefixr%   is_default_prefixs        r   
_posix_libr]   j   sh    ((dBGG,<,<\,JNd,d	#9#;#;ww||FE9oFFww||I77r   c                     SU;  aD  U S:X  a  US   nO[         R                  S   S   nU S:X  a  SU;  a  UR                  SS5      nX!S'   U$ )a.  
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
headersr   includer    z/local/z	/include/z/local/include/)r5   INSTALL_SCHEMESreplace)r+   schemer_   s      r   _inject_headersrd   t   s`     >!Y'G"22>B9MG= Yg%=ook3DEG#yMr   c                    ^  U 4S jnU$ )z
Implement the _inject_headers modification, above, but before
_inject_headers() was introduced, upstream. So, slower and messier.
c                  ^   > T" 5       n U R                  5        H  u  p[        X5        M     U $ r   )itemsrd   )schemesr+   rc   _load_schemess      r   wrapped_load_schemes2load_schemes_wrapper.<locals>.wrapped_load_schemes   s)    /#MMOLDD) ,r   rT   )ri   rj   s   ` r   load_schemes_wrapperrl      s    

  r   c                  ,   [         [        l         [        [        l        [        [
        R                  l        [        [        S5      (       a  [        [        l        g [        [        S5      (       a#  [        [        R                  5      [        l
        g g )Nrd   ri   )r   r5   r;   rN   r]   	distutils	sysconfigrS   rd   rl   ri   rT   r   r   apply_customizationsrp      s\    "L-=*%/I"|.//'6$		/	/%9,:T:T%U" 
0r   )__doc__r"   rI   distutils.sysconfigrn   distutils.command.installcommandr   r5   "distutils.command.install_egg_infor;   rN   r   r   r   distutils.errorsr   r&   r]   rd   rl   rp   rT   r   r   <module>rw      sz    
 
  0 0 B B 
 2" l"" " J%,== %PH8,
 
V  r   