관리-도구
편집 파일: archive_util.cpython-36.opt-2.pyc
3 \F! � @ s@ d dl Z d dlmZ d dlZyd dlZW n ek r@ dZY nX d dlmZ d dlm Z d dl mZ d dlm Z yd dlmZ W n ek r� dZY nX yd dlmZ W n ek r� dZY nX d d � Zdd� Zd dd�Zd!dd�Zed"gdfed#gdfed$gdfed%gdfed&gdfeg dfd�Zdd� Zd'dd�ZdS )(� N)�warn)�DistutilsExecError)�spawn)�mkpath)�log)�getpwnam)�getgrnamc C sN t d ks| d krd S yt | �}W n tk r8 d }Y nX |d k rJ|d S d S )N� )r �KeyError)�name�result� r �./usr/lib64/python3.6/distutils/archive_util.py�_get_gid s r c C sN t d ks| d krd S yt | �}W n tk r8 d }Y nX |d k rJ|d S d S )Nr )r r )r r r r r �_get_uid+ s r �gzipc s. dddddd�}dddd d �}|d k r:||j � kr:td��| d } |d krZ| |j|d�7 } ttjj| �|d� dd l} tj d� t ���t��� � ���fdd�}|s�| j| d|| �}z|j ||d� W d |j� X |d k�r*tdt� | || } tjdk�r|| | g}n |d| g}t||d� | S | S )NZgz�bz2�xz� )r �bzip2r N�compressz.gzz.bz2z.xzz.Z)r r r r zKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr )�dry_runr zCreating tar archivec s, � d k r� | _ �| _�d k r(�| _�| _| S )N)�gidZgname�uid�uname)Ztarinfo)r �group�ownerr r r �_set_uid_gida s z"make_tarball.<locals>._set_uid_gidzw|%s)�filterz'compress' will be deprecated.Zwin32z-f)�keys� ValueError�getr �os�path�dirname�tarfiler �infor r �open�add�closer �PendingDeprecationWarning�sys�platformr )� base_name�base_dirr �verboser r r Ztar_compressionZcompress_extZarchive_namer% r �tarZcompressed_name�cmdr )r r r r r �make_tarball7 s<