Hacked By AnonymousFox

Current Path : /opt/alt/python311/lib64/python3.11/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/distutils/__pycache__/archive_util.cpython-311.opt-1.pyc

�

c��f|!��B�dZddlZddlmZddlZ	ddlZn
#e$rdZYnwxYwddlmZddl	m
Z
ddlmZddl
mZ	ddlmZn
#e$rdZYnwxYw	dd	lmZn
#e$rdZYnwxYwd
�Zd�Z		dd
�Zdd�Zedgdfedgdfedgdfedgdfedgdfegdfd�Zd�Z		dd�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$rd}YnwxYw|�|dSdS)z"Returns a gid, given a group name.N�)r	�KeyError��name�results  �=/opt/alt/python311/lib64/python3.11/distutils/archive_util.py�_get_gidr�\����4�<��t���$������������������
���a�y���4���,�,c�v�t�|�dS	t|��}n#t$rd}YnwxYw|�|dSdS)z"Returns an uid, given a user name.Nr)rrr
s  r�_get_uidr+rr�gzipc������dddddd�}dddd	d
�}|�%||���vrtd���|d
z}	|dkr|	|�|d��z
}	ttj�|	��|���ddl}
tj	d��t����t��������fd�}|se|
�|	d||z��}	|�
||���|���n#|���wxYw|dkrNtdt ��|	||z}
t"jdkr||	|
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�bzip2rN�compressz.gzz.bz2z.xzz.Z)rrrrNzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr��dry_runrzCreating tar archivec�H�����|_�|_���|_�|_|S)N)�gid�gname�uid�uname)�tarinfor!�group�ownerr#s ����r�_set_uid_gidz"make_tarball.<locals>._set_uid_gidas.����?��G�K�!�G�M��?��G�K�!�G�M���zw|%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�verboserr'r&�tar_compression�compress_ext�archive_namer2r(�tar�compressed_name�cmdr!r#s     ``        @@r�make_tarballrC7s�������" $�e�4�r�#%�'�'�O�!�F�%� $�&�&�L�����0A�0A�0C�0C� C� C��#�$�$�	$��v�%�L��:�����(�(��2�6�6�6��
�2�7�?�?�<�(�(�'�:�:�:�:��N�N�N��H�
#�$�$�$�
�5�/�/�C�
�5�/�/�C������������l�l�<��/�(�2K�)K�L�L��	��G�G�H�\�G�2�2�2��I�I�K�K�K�K��C�I�I�K�K�K�K�����:����
-�/H�I�I�I�&��h�)?�?���<�7�"�"��\�?�;�C�C��T�<�0�C�
�c�7�#�#�#�#����s�-D�D/c
�&�|dz}ttj�|��|���t�?|rd}nd}	td|||g|����n7#t$rt
d|z���wxYwtjd||��|�s�	t	j	|d	tj
�
��}n1#t$r$t	j	|d	tj�
��}YnwxYw|5|tj
krhtj�tj�|d����}|�||��tjd|��tj|��D�]\}}	}
|	D]k}tj�tj�||d����}|�||��tjd|���l|
D]�}tj�tj�||����}tj�|��r+|�||��tjd|������	ddd��n#1swxYwY|S)
avCreate a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    z.ziprNz-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)�compressionrzadding '%s')rr/r0r1�zipfilerrrr3�ZipFile�ZIP_DEFLATED�RuntimeError�
ZIP_STORED�curdir�normpath�join�write�walk�isfile)r:r;r<r�zip_filename�
zipoptionsrEr0�dirpath�dirnames�	filenamesrs            r�make_zipfilerXs���v�%�L�
�2�7�?�?�<�(�(�'�:�:�:�:����	��J�J��J�	D��5�*�l�H�=�!�
#�
#�
#�
#�
#��!�	D�	D�	D�%�'3�6B�&C�D�D�
D�	D����	��6��x�	)�	)�	)��	:�
F��o�l�C�29�2F�H�H�H�����
F�
F�
F��o�l�C�29�2D�F�F�F����
F�����
:�
:��r�y�(�(��7�+�+�B�G�L�L��2�,F�,F�G�G�D��I�I�d�D�)�)�)��H�]�D�1�1�1�46�G�H�4E�4E�	:�	:�0�G�X�y� (�6�6��!�w�/�/�����W�d�B�0O�0O�P�P���	�	�$��-�-�-�����5�5�5�5� )�:�:��!�w�/�/�����W�d�0K�0K�L�L���7�>�>�$�/�/�:��I�I�d�D�1�1�1��H�]�D�9�9�9��	:�	:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:����
:�
:�
:�
:� �s1�A�A7�!B6�6+C$�#C$�)FJ�J
�
J
)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)�gztar�bztar�xztar�ztarr@rEc�*�|D]}|tvr|cS�dS)zqReturns the first format from the 'format' list that is unknown.

    If all formats are known, returns None
    N)�ARCHIVE_FORMATS)�formats�formats  r�check_archive_formatsra�s1��
������(�(��M�M�M�)��4r)c�l�tj��}|�Jtjd|��tj�|��}|stj|��|�tj}d|i}		t|}
n #t$rtd|z���wxYw|
d}|
dD]
\}}
|
|	|<�|dkr
||	d<||	d	<	|||fi|	��}|�)tjd
|��tj|��n1#|�*tjd
|��tj|��wwxYw|S)a�Create an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", "xztar", or "ztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    Nzchanging into '%s'rzunknown archive format '%s'r�rEr'r&zchanging back to '%s')r/�getcwdr�debugr0�abspath�chdirrMr^rr-)r:r`�root_dirr;r<rr'r&�save_cwd�kwargs�format_info�func�arg�val�filenames               r�make_archiverp�s}��$�y�{�{�H����	�&��1�1�1��G�O�O�I�.�.�	��	��H�X�������9����
!�F�A�%�f�-�����A�A�A��6��?�@�@�@�A�����q�>�D���N�����S���s���
������w����w����4�	�8�6�6�v�6�6�����I�-�x�8�8�8��H�X���������I�-�x�8�8�8��H�X����� �����Os�3
B�B�
D�.D1)rrrNN)rr)NNrrNN)�__doc__r/�warningsrr8rH�ImportError�distutils.errorsr�distutils.spawnr�distutils.dir_utilr�	distutilsr�pwdr�grpr	rrrCrXr^rarp�r)r�<module>r{s����

�	�	�	�������
�
�
�
���N�N�N�N�������G�G�G�����0�/�/�/�/�/�!�!�!�!�!�!�%�%�%�%�%�%���������������������H�H�H�������������������H�H�H�����
�
�
�
�
�
�KL�#'�F�F�F�F�P:�:�:�:�z�1�2�4F�
G��2�3�5H�
I��/�0�2B�
C��5�6�8M�
N��/�0�2I�
J��B�z�
*�
������KL�.2�2�2�2�2�2�2s/��!�!�A�A�
A�A�A#�"A#

Hacked By AnonymousFox1.0, Coded By AnonymousFox