_i|! @ d Z ddlZddlmZ ddlZ ddlZddlmZ ddl m Z ddl
mZ ddlm
Z
dd lmZ dd
lmZ d Zd Z dd
ZddZedgdfedgdfedgdfedgdfedgdfeg dfdZd Z ddZy# e$ r dZY lw xY w# e$ r dZY Zw xY w# e$ r dZY `w xY w) zodistutils.archive_util
Utility functions for creating archive files (tarballs, zip files,
that sort of thing). N)warn )DistutilsExecError)spawn)mkpath)log)getpwnam)getgrnamc ^ t | y t | }||d S y# t $ r d}Y w xY w)z"Returns a gid, given a group name.N )r
KeyErrornameresults /builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/_distutils/archive_util.py_get_gidr H 4<$ ay ,,c ^ t | y t | }||d S y# t $ r d}Y w xY w)z"Returns an uid, given a user name.Nr )r r
r s r _get_uidr - r r c dddddd}dddd d
}|||j vrt d | d
z } |dk7 r| |j |d z
} t t j
j
| | ddl}
t j d t t fd}|s<|
j | d|| z } |j || |j |dk( rEt dt | || z }
t" j$ dk( r|| |
g}n|d| g}t' || |
S | S # |j w xY w)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.
gzbz2xz )gzipbzip2r Ncompressz.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)gidgnameuiduname)tarinfor" groupownerr$ s r _set_uid_gidz"make_tarball.