AlkantarClanX12

Your IP : 3.138.105.4


Current Path : /opt/alt/python37/lib64/python3.7/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/distutils/__pycache__/archive_util.cpython-37.opt-2.pyc

B

YI~dF!�@s@ddlZddlmZddlZyddlZWnek
r@dZYnXddlmZddlm	Z	ddl
mZddlm
Z
yddlmZWnek
r�dZYnXyddlmZWnek
r�dZYnXd	d
�Zdd�Zd"dd�Zd#dd�Zedgdfedgdfedgdfedgdfedgdfegdfd�Zdd�Zd$d d!�ZdS)%�N)�warn)�DistutilsExecError)�spawn)�mkpath)�log)�getpwnam)�getgrnamcCsNtdks|dkrdSyt|�}Wntk
r8d}YnX|dk	rJ|dSdS)N�)r�KeyError)�name�result�r
�;/opt/alt/python37/lib64/python3.7/distutils/archive_util.py�_get_gids
rcCsNtdks|dkrdSyt|�}Wntk
r8d}YnX|dk	rJ|dSdS)Nr	)rr
)rrr
r
r�_get_uid+s
r�gzipcs.dddddd�}dddd	d
�}|dk	r:||��kr:td��|d}	|d
krZ|	|�|d�7}	ttj�|	�|d�ddl}
t�	d�t
���t�������fdd�}|s�|
�|	d||�}z|j
||d�Wd|��X|d
k�r*tdt�|	||}
tjdk�r||	|
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,�dk	r�|_�|_�dk	r(�|_�|_|S)N)�gidZgname�uid�uname)Ztarinfo)r�group�ownerrr
r�_set_uid_gidasz"make_tarball.<locals>._set_uid_gidzw|%s)�filterz'compress' will be deprecated.�win32z-f)�keys�
ValueError�getr�os�path�dirname�tarfiler�inforr�open�add�closer�PendingDeprecationWarning�sys�platformr)�	base_name�base_dirr�verboserrrZtar_compressionZcompress_extZarchive_namer&r�tarZcompressed_name�cmdr
)rrrrr�make_tarball7s<
	



r3c	Cs�|d}ttj�|�|d�tdkrp|r.d}nd}ytd|||g|d�Wn tk
rjtd|��YnX�n:t�d||�|�s�ytj	|dtj
d	�}Wn&tk
r�tj	|dtjd	�}YnX|tj
kr�tj�tj�|d
��}|�||�t�d|�x�t�|�D]�\}}	}
x>|	D]6}tj�tj�||d
��}|�||�t�d|��qWxJ|
D]B}tj�tj�||��}tj�|��rV|�||�t�d|��qVW�qW|��|S)Nz.zip)rz-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�isfiler*)r.r/r0rZzip_filenameZ
zipoptionsr4r$�dirpathZdirnames�	filenamesrr
r
r�make_zipfilesJ	


r@)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)ZgztarZbztarZxztarZztarr1r4cCsx|D]}|tkr|SqWdS)N)�ARCHIVE_FORMATS)�formats�formatr
r
r�check_archive_formats�s
rDc
Cs�t��}|dk	r6t�d|�tj�|�}|s6t�|�|dkrDtj}d|i}	yt|}
Wn t	k
rxt
d|��YnX|
d}x|
dD]\}}
|
|	|<q�W|dkr�||	d<||	d<z|||f|	�}Wd|dk	r�t�d	|�t�|�X|S)
Nzchanging into '%s'rzunknown archive format '%s'r�r4rrzchanging back to '%s')r#�getcwdr�debugr$�abspath�chdirr8rAr
r!)r.rCZroot_dirr/r0rrrZsave_cwd�kwargsZformat_info�func�arg�val�filenamer
r
r�make_archive�s2
rO)rrrNN)rr)NNrrNN)r#�warningsrr,r6�ImportErrorZdistutils.errorsrZdistutils.spawnrZdistutils.dir_utilrZ	distutilsr�pwdrZgrprrrr3r@rArDrOr
r
r
r�<module>s@



G
=