� ��^i����dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl mZmZmZmZmZmZddlmZdd lmZdd lmZd d lmZeje��Z dd d�dede dedede dede deeeffd�Z! ddede deedeede deedefd�Z"defd�Z#defd�Z$defd�Z%dedeeeffd�Z&dS)z7Locations where we look for configs, install stuff, etc�N)�Command)� SCHEME_KEYS)�install��get_python_lib)�Dict�List�Optional�Tuple�Union�cast)�Scheme)�WINDOWS)�running_under_virtualenv�)�get_major_minor_versionF)�ignore_config_files� dist_name�user�home�root�isolated�prefixr�returnc���ddlm}d|i}|rdg|d<||��} |sr | ���n\#t$rO| ���} t �dd�d�| D������YnwxYwd } | �d d � ��} | �J�tt| ��} |r|rJd |�d|�����|r|rJd|�d|�����|p| j | _ |s|rd| _ |p| j | _ |p| j | _ |p| j| _| ���i} t D]}t#| d|z��| |<�d| �d ��vr.| �t)| j| j�����t-��r�|r|}n|r| j}n| j }t0j�|dddt5����|��| d<|�st0j�t0j�| d����d}t0j�||dd ���| d<| S)z+ Return a distutils install scheme r)� Distribution�namez --no-user-cfg� script_argsz6Ignore distutils configs in %s due to encoding errors.z, c3�TK�|]#}tj�|��V��$dS)N)�os�path�basename)�.0�ps ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/locations/_distutils.py� z#distutils_scheme..4s2����=�=�!�"�'�*�*�1�-�-�=�=�=�=�=�=�NrT)�createzuser=z prefix=zhome=��install_� install_lib)�purelib�platlib�include�site�python�headersr)�distutils.distr�parse_config_files�UnicodeDecodeError�find_config_files�logger�warning�join�get_command_objr �distutils_install_commandrrrr�finalize_optionsr�getattr�get_option_dict�update�dictr+r�install_userbaser r!r� splitdrive�abspath)rrrrrrrr� dist_args�d�paths�obj�i�scheme�key� path_no_drives r%�distutils_schemerKs���,�+�+�+�+�+�39�9�2E�I��5�$3�#4� �-� �� �Y���A� � � � � � � "� "� "� "��!� � � ��'�'�)�)�E� �N�N�H�� � �=�=�u�=�=�=�=�=� � � � � � ����'+�C� � � �I�d� � 3� 3�C� �?�?�?� � &��,�,�A��@��@�@�"@�$�"@�"@��"@�"@�@�@� ��@��@�@�"@�$�"@�"@��"@�"@�@�@� � �^�Q�V�A�F� ��t������!���A�H� �^�Q�V�A�F� �^�Q�V�A�F������� �F��3�3���a��c�!1�2�2��s� � ���)�)�)�4�4�4�4�� � �d�1�=�!�-�H�H�H�I�I�I��!�!�F� � ��F�F� � ��'�F�F��X�F��G�L�L� � � � 0�,�.�.� 0� 0� �  � ��y�� � ��G�.�.�r�w���v�i�?P�/Q�/Q�R�R�ST�U�M� "�� � �T�=����3D� E� E�F�9� � �Ms�6�AB�Bc��t||||||��}t|d|d|d|d|d���S)a; Get the "scheme" corresponding to the input parameters. The distutils documentation provides the context for the available schemes: https://docs.python.org/3/install/index.html#alternate-installation :param dist_name: the name of the package to retrieve the scheme for, used in the headers scheme path :param user: indicates to use the "user" scheme :param home: indicates to use the "home" scheme and provides the base directory for the same :param root: root under which other directories are re-based :param isolated: equivalent to --no-user-cfg, i.e. do not consider ~/.pydistutils.cfg (posix) or ~/pydistutils.cfg (non-posix) for scheme paths :param prefix: indicates to use the "prefix" scheme and provides the base directory for the same r-r,r1�scripts�data)r-r,r1rMrN)rKr)rrrrrrrHs r%� get_schemerOisY��2�i��t�T�8�V� L� L�F� ��y�!��y�!��y�!��y�!� �F�^�  � � �r'c��tj�tj��}t ratj�|d��}tj�|��s tj�|d��}|Stjdd�dkr|dd�dkrdStj�|d��S)N�Scripts�bin��darwin�z/System/Library/z/usr/local/bin) r r!�normpath�sysrrr8�exists�platform)r�bin_pys r%�get_bin_prefixr[�s����W� � �c�j� )� )�F�������f�i�0�0���w�~�~�f�%�%� 1��W�\�\�&�%�0�0�F�� � �|�B�Q�B��8�#�#��s��s� �7I�(I�(I��� �7�<�<��� &� &�&r'c�"�td���S)NF�� plat_specificr�r'r%� get_purelibr`�s�� �� .� .� .�.r'c�"�td���S)NTr]rr_r'r%� get_platlibrb�s�� �� -� -� -�-r'c�F�td|���td|���fS)NF)r^rTr)rs r%�get_prefixed_libsrd�s,���U�6�:�:�:��T�&�9�9�9� �r')FNNFN)'�__doc__�loggingr rW� distutils.cmdr�DistutilsCommand�distutils.command.installrrr:�distutils.sysconfigr�typingrr r r r r �pip._internal.models.schemer�pip._internal.utils.compatr�pip._internal.utils.virtualenvr�baser� getLogger�__name__r6�str�boolrKrOr[r`rbrdr_r'r%�rts���=�=� ���� � � � � � � � �5�5�5�5�5�5�1�1�1�1�1�1�J�J�J�J�J�J�.�.�.�.�.�.�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�.�.�.�.�.�.�.�.�.�.�.�.�C�C�C�C�C�C�)�)�)�)�)�)� �� �8� $� $�� ����� N�!&�N�N�N��N� �N� �N� � N� � N� � N��N� �#�s�(�^�N�N�N�N�f���� � � �� � � � �3�-� � �3�-� � � � �S�M� � � � � � �F'��'�'�'�'�"/�S�/�/�/�/�.�S�.�.�.�.��c��e�C��H�o������r'