<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    YI~dX  ã               @   s”   d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZmZ d dlmZ d dlZe d¡ZG d	d
„ d
eƒZG dd„ deeƒZdS )é    N)ÚST_MODE)Ú	sysconfig)ÚCommand)Únewer)Úconvert_pathÚ	Mixin2to3)Úlogs   ^#!.*python[0-9.]*([ 	].*)?$c               @   sH   e Zd ZdZdddgZdgZdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dS )Úbuild_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=Údzdirectory to "build" (copy) to)ÚforceÚfz1forcibly build everything (ignore file timestamps)zexecutable=Úez*specify final destination interpreter pathr   c             C   s"   d | _ d | _d | _d | _d | _d S )N)Ú	build_dirÚscriptsr   Ú
executableÚoutfiles)Úself© r   úD/opt/alt/python37/lib64/python3.7/distutils/command/build_scripts.pyÚinitialize_options   s
    z build_scripts.initialize_optionsc             C   s   |   dddd¡ | jj| _d S )NZbuild)r	   r   )r   r   )r   r   )Zset_undefined_optionsZdistributionr   )r   r   r   r   Úfinalize_options%   s
    zbuild_scripts.finalize_optionsc             C   s   | j S )N)r   )r   r   r   r   Úget_source_files,   s    zbuild_scripts.get_source_filesc             C   s   | j s
d S |  ¡  d S )N)r   Úcopy_scripts)r   r   r   r   Úrun/   s    zbuild_scripts.runc          
   C   s¾  |   | j¡ g }g }x(| jD ]}d}t|ƒ}tj | jtj |¡¡}| |¡ | j	spt
||ƒspt d|¡ qyt|dƒ}W n  tk
rž   | js–‚ d }Y nXX t |j¡\}}| d¡ | ¡ }	|	sÖ|  d| ¡ qt |	¡}
|
röd}|
 d¡pôd}|rt d	|| j¡ | |¡ | jstjs.| j}n(tj t d
¡dt d¡t d¡f ¡}t |¡}d| | d }y| d¡ W n$ tk
r¢   t d !|¡ƒ‚Y nX y| |¡ W n& tk
rØ   t d !||¡ƒ‚Y nX t|dƒ}| "|¡ | #| $¡ ¡ W d Q R X |r<| %¡  q|r&| %¡  | |¡ |  &||¡ qW tj'dkr¶xh|D ]`}| jrlt d|¡ nDt (|¡t) d@ }|dB d@ }||krRt d|||¡ t *||¡ qRW ||fS )NFznot copying %s (up-to-date)Úrbr   z%s is an empty file (skipping)Té   ó    zcopying and adjusting %s -> %sZBINDIRz
python%s%sZVERSIONZEXEs   #!ó   
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})ÚwbÚposixzchanging mode of %siÿ  im  z!changing mode of %s from %o to %o)+Zmkpathr   r   r   ÚosÚpathÚjoinÚbasenameÚappendr   r   r   ÚdebugÚopenÚOSErrorÚdry_runÚtokenizeÚdetect_encodingÚreadlineÚseekÚwarnÚfirst_line_reÚmatchÚgroupÚinfor   Zpython_buildr   Zget_config_varÚfsencodeÚdecodeÚUnicodeDecodeErrorÚ
ValueErrorÚformatÚwriteÚ
writelinesÚ	readlinesÚcloseZ	copy_fileÚnameÚstatr   Úchmod)r   r   Úupdated_filesZscriptZadjustZoutfiler   ÚencodingÚlinesZ
first_liner/   Zpost_interpr   ZshebangZoutfÚfileZoldmodeZnewmoder   r   r   r   5   s    












zbuild_scripts.copy_scriptsN)Ú__name__Ú
__module__Ú__qualname__ÚdescriptionZuser_optionsZboolean_optionsr   r   r   r   r   r   r   r   r   r	      s   r	   c               @   s   e Zd Zdd„ ZdS )Úbuild_scripts_2to3c             C   s&   t  | ¡\}}| js|  |¡ ||fS )N)r	   r   r(   Zrun_2to3)r   r   r>   r   r   r   r   œ   s    
zbuild_scripts_2to3.copy_scriptsN)rB   rC   rD   r   r   r   r   r   rF   š   s   rF   )r    Úrer<   r   Z	distutilsr   Zdistutils.corer   Zdistutils.dep_utilr   Zdistutils.utilr   r   r   r)   Úcompiler.   r	   rF   r   r   r   r   Ú<module>   s   
 
