Your IP : 3.141.47.139


Current Path : /opt/alt/python310/lib64/python3.10/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/__pycache__/archive_util.cpython-310.opt-2.pyc

o

6��f|!�@sD	ddlZddlmZddlZzddlZWney dZYnwddlmZddlm	Z	ddl
mZddlm
Z
zddlmZWneyLdZYnwzddlmZWney`dZYnwd	d
�Zdd�Z		d"dd�Zd#dd�Zedgdfedgdfedgdfedgdfedgdfegdfd�Zdd�Z		d$d d!�ZdS)%�N)�warn)�DistutilsExecError)�spawn)�mkpath)�log)�getpwnam)�getgrnamcC�N	tdus	|durdSzt|�}Wntyd}Ynw|dur%|dSdS�N�)r�KeyError��name�result�r�=/opt/alt/python310/lib64/python3.10/distutils/archive_util.py�_get_gid��rcCr	r
)rrr
rrr�_get_uid+rr�gzipcs4	dddddd�}dddd	d
�}|dur||��vrtd��|d}	|d
kr.|	|�|d�7}	ttj�|	�|d�ddl}
t�	d�t
���t�������fdd�}|sq|
�|	d||�}z
|j
||d�W|��n|��w|d
kr�tdt�|	||}
tjdkr�||	|
g}n|d|	g}t||d�|
S|	S)NZgz�bz2�xz�)r�bzip2rN�compressz.gzz.bz2z.xzz.Z)rrrrzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr��dry_runrzCreating tar archivecs,�dur
�|_�|_�dur�|_�|_|S�N)�gidZgname�uid�uname)Ztarinfo�r�group�ownerrrr�_set_uid_gidasz"make_tarball.<locals>._set_uid_gidzw|%s)�filterz'compress' will be deprecated.Zwin32z-f)�keys�
ValueError�getr�os�path�dirname�tarfiler�inforr�open�add�closer�PendingDeprecationWarning�sys�platformr)�	base_name�base_dirr�verboserr#r"Ztar_compressionZcompress_extZarchive_namer,r$�tarZcompressed_name�cmdrr!r�make_tarball7sD���
	


r9c
Cs�	|d}ttj�|�|d�tdur5|rd}nd}z
td|||g|d�W|Sty4td|��wt�d||�|s�ztj	|dtj
d	�}Wnty[tj	|dtjd	�}Ynw|�o|tj
kr{tj�tj�|d
��}|�||�t�d|�t�|�D]D\}}	}
|	D]}tj�tj�||d
��}|�||�t�d|�q�|
D]}tj�tj�||��}tj�|�r�|�||�t�d|�q�q�Wd�|S1s�wY|S)Nz.ziprz-rz-rq�zipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to it�w)Zcompressionrzadding '%s')rr)r*r+�zipfilerrrr-ZZipFileZZIP_DEFLATED�RuntimeErrorZ
ZIP_STORED�curdir�normpath�join�write�walk�isfile)r4r5r6rZzip_filenameZ
zipoptionsr:r*�dirpathZdirnames�	filenamesrrrr�make_zipfilesh�%����
�
��
���
��rF)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)ZgztarZbztarZxztarZztarr7r:cCs 	|D]
}|tvr
|SqdSr)�ARCHIVE_FORMATS)Zformats�formatrrr�check_archive_formats�s�rIc
Cs
	t��}|durt�d|�tj�|�}|st�|�|dur#tj}d|i}	zt|}
Wn
t	y:t
d|��w|
d}|
dD]\}}
|
|	|<qC|dkrX||	d<||	d<z|||fi|	��}W|durrt�d	|�t�|�|S|dur�t�d	|�t�|�ww)
Nzchanging into '%s'rzunknown archive format '%s'r�r:r#r"zchanging back to '%s')r)�getcwdr�debugr*�abspath�chdirr>rGrr')r4rHZroot_dirr5r6rr#r"Zsave_cwd�kwargsZformat_info�func�arg�val�filenamerrr�make_archive�s>
�

��rT)rrrNN)rr)NNrrNN)r)�warningsrr2r<�ImportErrorZdistutils.errorsrZdistutils.spawnrZdistutils.dir_utilrZ	distutilsr�pwdrZgrprrrr9rFrGrIrTrrrr�<module>sP���
�
H
=



�	
�

?>