Ë
    òT•jT  ã                   óä   — d Z ddlZddlZddlZddlmc mZ ddl	mc m
Z ddl	mZmZmZ ddlmZ  G d„ dej                  «      Z G d„ dej                  «      Z
d	„ Zd
„ Zd„ Zd„ Zd„ Z e«        y)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   ‡ — e Zd Z eej
                  j                  «      dgz   Zˆ fd„Zˆ fd„Zˆ fd„Z	ˆ xZ
S )Úinstall)zinstall-layout=Nz7installation layout to choose (known values: deb, unix)c                 ó>   •— t         ‰| �  «        d | _        d | _        y ©N©ÚsuperÚinitialize_optionsÚprefix_optionÚinstall_layout©ÚselfÚ	__class__s    €ú,/usr/lib/python3.12/_distutils_system_mod.pyr   zinstall.initialize_options   ó   ø€ Ü‰Ñ"Ô$Ø!ˆÔØ"ˆÕó    c                 óö  •— |dk(  rä| j                   rI| j                   j                  «       dv rd}n¹| j                   j                  «       dv rd}nšt        d«      ‚| j                  r,t        j
                  j                  | j                  «      dk7  s
t        «       rd}nJt        j
                  j                  | j                  «      dk(  rdx| _        | _	        dx| _
        | _        d}t        ‰| �5  |«       y )	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(   zinstall.select_scheme$   s×   ø€ Ø�>Ò!Ø×"Ò"Ø×&Ñ&×,Ñ,Ó.°'Ñ9Ø'‘DØ×(Ñ(×.Ñ.Ó0°HÑ<Ø)‘Dä.Ø<ó>ð >à×%Ò%Ü—7‘7×#Ñ# D§K¡KÓ0°LÒ@Ü+Ô-Ø%‘ä—7‘7×#Ñ# D§K¡KÓ0°LÒ@Ø5;Ð;�D”K $Ô"2Ø@FÐF�DÔ%¨Ô(=Ø$�Ü‰Ñ˜dÕ#r   c                 óD   •— | j                   | _        t        ‰| �  «        y r
   )r#   r   r   Úfinalize_unixr   s    €r   r+   zinstall.finalize_unix9   s   ø€ Ø!Ÿ[™[ˆÔÜ‰ÑÕr   )Ú__name__Ú
__module__Ú__qualname__ÚlistÚorig_installr   Úuser_optionsr   r(   r+   Ú__classcell__©r   s   @r   r   r      s=   ø„ Ù˜×,Ñ,×9Ñ9Ó:ð	Dð>ñ €Lô
#ô
$÷* ð  r   r   c                   óx   ‡ — e Zd Z eej
                  j                  «      dgz   Zˆ fd„Zˆ fd„Ze	d„ «       Z
ˆ xZS )Úinstall_egg_info)zinstall-layoutNzcustom installation layoutc                 ó>   •— t         ‰| �  «        d | _        d | _        y r
   r   r   s    €r   r   z#install_egg_info.initialize_optionsC   r   r   c                 ój   •— | j                  dd«       | j                  dd«       t        ‰| �	  «        y )Nr   )r   r   )r   r   )Úset_undefined_optionsr   Úfinalize_optionsr   s    €r   r9   z!install_egg_info.finalize_optionsH   s0   ø€ Ø×"Ñ" 9Ð-PÔQØ×"Ñ" 9Ð-NÔOÜ‰Ñ Õ"r   c                 óh  — | j                   rE| j                   j                  «       dvrt        d«      ‚| j                   j                  «       dk(  }n| j                  rd}nd}|r^t	        t        | j                  j                  «       «      «      ›dt	        t        | j                  j                  «       «      «      ›d�}|S dt	        t        | j                  j                  «       «      «      t	        t        | j                  j                  «       «      «      gt        j                  d d	 ¢­z  }|S )
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   rC   zinstall_egg_info.basenameM   s  € à×ÒØ×&Ñ&×,Ñ,Ó.°/ÑAÜ*Ø8ó:ð :à×+Ñ+×1Ñ1Ó3°uÑ<‰HØ×ÒØ‰HàˆHÙäœI d×&7Ñ&7×&@Ñ&@Ó&BÓCÕDÜœL¨×):Ñ):×)FÑ)FÓ)HÓIÕJðˆHð ˆð 0ÜœI d×&7Ñ&7×&@Ñ&@Ó&BÓCÓDÜœL¨×):Ñ):×)FÑ)FÓ)HÓIÓJð3ô ×!Ñ! " 1Ð%ñ3ñ ˆHð
 ˆr   )r,   r-   r.   r/   Úorig_install_egg_infor5   r1   r   r9   ÚpropertyrC   r2   r3   s   @r   r5   r5   >   sF   ø„ ÙÐ-×>Ñ>×KÑKÓLØ>ðPñ €Lô#ô
#ð
 ñó ôr   r5   c                  óh   — t         j                  t         j                  k7  xs t        t         d«      S )NÚreal_prefix)r@   Úbase_prefixr#   Úhasattr© r   r   r$   r$   f   s!   € Ü�?‰?œcŸj™jÑ(ÒG¬G´C¸Ó,GÐGr   c                 óò   — | xs! t         j                  j                  |«      dv }| r|S |r,t        «       s"t         j                  j	                  |ddd«      S t         j                  j	                  |d«      S )N)r   r   ÚlibÚpython3zdist-packageszsite-packages)r    r!   r"   r$   Újoin)Ústandard_libÚ	libpythonÚearly_prefixr#   Úis_default_prefixs        r   Ú
_posix_librS   j   se   € Ø(Ð(Òd¬B¯G©G×,<Ñ,<¸\Ó,JÐNdÐ,dÐÙØÐÙ	Ô#9Ô#;Ü�w‰w�|‰|˜F E¨9°oÓFÐFä�w‰w�|‰|˜I Ó7Ð7r   c                 ó�   — d|vrA| dk(  r|d   }nt         j                  d   d   }| dk(  rd|vr|j                  dd«      }||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
    Úheadersr   Úincluder   z/local/z	/include/z/local/include/)r0   ÚINSTALL_SCHEMESÚreplace)r)   ÚschemerU   s      r   Ú_inject_headersrZ   t   sb   € ð ˜ÑØ�>Ò!Ø˜YÑ'‰Gä"×2Ñ2°>ÑBÀ9ÑMˆGØ�=Ò  Y°gÑ%=Ø—o‘o kÐ3DÓEˆGØ#ˆˆyÑØ€Mr   c                 ó   ‡ — ˆ fd„}|S )z�
    Implement the _inject_headers modification, above, but before
    _inject_headers() was introduced, upstream. So, slower and messier.
    c                  ó^   •—  ‰«       } | j                  «       D ]  \  }}t        ||«       Œ | S r
   )ÚitemsrZ   )Úschemesr)   rY   Ú_load_schemess      €r   Úwrapped_load_schemesz2load_schemes_wrapper.<locals>.wrapped_load_schemes�   s2   ø€ Ù“/ˆØ#ŸM™M›Oò 	*‰LˆD�&Ü˜D &Õ)ð	*àˆr   rJ   )r_   r`   s   ` r   Úload_schemes_wrapperra   Š   s   ø€ ô
ð
  Ðr   c                  ó  — t         t        _         t        t        _        t        t
        j                  _        t        t        d«      rt        t        _        y t        t        d«      r#t        t        j                  «      t        _
        y y )NrZ   r_   )r   r0   r5   rD   rS   Ú	distutilsÚ	sysconfigrI   rZ   ra   r_   rJ   r   r   Úapply_customizationsre   —   sV   € Ü"„LÔÜ-=ÔÔ*Ü%/„I×ÑÔ"äŒ|Ð.Ô/ä'6ŒÕ$Ü	”˜Ô	/ä%9¼,×:TÑ:TÓ%UŒÕ"ð 
0r   )Ú__doc__r    r@   Údistutils.sysconfigrc   Údistutils.command.installÚcommandr   r0   Ú"distutils.command.install_egg_infor5   rD   r   r   r   Údistutils.errorsr   r$   rS   rZ   ra   re   rJ   r   r   ú<module>rl      sz   ðñó 
Û 
ã ß 0Ð 0ß BÐ B÷ñ õ
 2ô" ˆl×"Ñ"ô " ôJ%Ð,×=Ñ=ô %òPHò8òò,
 ò
Vñ Õ r   