�
,�Re|! � �H � d Z ddlZddlmZ ddlZ ddlZn
# e$ r dZY nw xY wddlmZ ddl m Z ddl
mZ ddlm
Z
dd lmZ n
# e$ r dZY nw xY w dd
lmZ n
# e$ r dZY nw xY wd� Zd� Z dd�Zdd�Zedgdfedgdfedgdfedgdfedgdfeg dfd�Zd� Z d d�ZdS )!zodistutils.archive_util
Utility functions for creating archive files (tarballs, zip files,
that sort of thing).� N)�warn� )�DistutilsExecError)�spawn)�mkpath)�log)�getpwnam)�getgrnamc �v � t �| �dS t | � � }n# t $ r d}Y nw xY w|�|d S dS )z"Returns a gid, given a group name.N� )r
�KeyError��name�results ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/archive_util.py�_get_gidr �\ � ���4�<��t���$������� � � ���������
���a�y���4� � �,�,c �v � t �| �dS t | � � }n# t $ r d}Y nw xY w|�|d S dS )z"Returns an uid, given a user name.Nr )r r
r s r �_get_uidr - r r �gzipc � ����� dddddd�}dddd d
�}|�%||� � � vrt d� � �| d
z } |dk r| |� |d� � z
} t t j � | � � |�� � ddl}
t j d� � t �� � �t �� � �����fd�}|se|
� | d|| z � � } |�
||�� � |� � � n# |� � � w xY w|dk rNt dt � � | || z }
t" j dk r|| |
g}n|d| g}t' ||�� � |
S | S )a= Create a (possibly compressed) tar file from all the files under
'base_dir'.
'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or
None. ("compress" will be deprecated in Python 3.2)
'owner' and 'group' can be used to define an owner and a group for the
archive that is being built. If not provided, the current owner and group
will be used.
The output tar file will be named 'base_dir' + ".tar", possibly plus
the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").
Returns the output filename.
�gz�bz2�xz� )r �bzip2r N�compressz.gzz.bz2z.xzz.Z)r r r r NzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr ��dry_runr zCreating tar archivec �H �� ���| _ �| _ ���| _ �| _ | S )N)�gid�gname�uid�uname)�tarinfor" �group�ownerr$ s ����r �_set_uid_gidz"make_tarball.