관리-도구
편집 파일: unpacking.cpython-311.pyc
� �܋f�. � �h � d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z m Z mZ ddlmZ ddl mZ ddlmZmZmZmZ ddlmZ ej e� � Zeez Z ddlZeez Zn # e$ r e� d� � Y nw xY w ddlZeez Zn # e$ r e� d � � Y nw xY wd efd�Zde d e e fd �Z!de e d e"fd�Z#de de d e"fd�Z$d efd�Z%de d dfd�Z&ded e"fd�Z'd"de de de"d dfd�Z(de de d dfd�Z)de de dej* de"d df d�Z+ d#de de d ee d dfd!�Z,dS )$zUtilities related archives. � N)�Iterable�List�Optional)�ZipInfo)�InstallationError)�BZ2_EXTENSIONS�TAR_EXTENSIONS� XZ_EXTENSIONS�ZIP_EXTENSIONS)� ensure_dirzbz2 module is not availablezlzma module is not available�returnc �V � t j d� � } t j | � � | S )zBGet the current umask which involves having to set it temporarily.r )�os�umask)�masks �T/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_internal/utils/unpacking.py� current_umaskr , s! � � �8�A�;�;�D��H�T�N�N�N��K� �pathc �* � | � d� � � d� � } d| v rJd| v r,| � d� � | � d� � k sd| vr| � dd� � S d| v r| � dd� � S | dgS )N�/�\� � )�lstrip�find�split�r s r �split_leading_dirr 3 s� � ��;�;�s���"�"�4�(�(�D� �d�{�{� ����$�)�)�C�.�.�4�9�9�T�?�?�:�:�t�4�?O�?O��z�z�#�q�!�!�!� �����z�z�$��"�"�"��b�z�r �pathsc �^ � d}| D ]'}t |� � \ }}|s dS |�|}�||k r dS �(dS )zyReturns true if all the paths have the same leading path name (i.e., everything is in one subdirectory in an archive)NFT)r )r � common_prefixr �prefix�rests r �has_leading_dirr% ? sa � � �M�� � ��(��.�.����� ��5�5� � "�"�M�M� �}� $� $��5�5� %��4r � directory�targetc �� � t j � | � � }t j � |� � }t j � ||g� � }||k S )zL Return true if the absolute path of target is within the directory )r r �abspath�commonprefix)r&