�
��^i( � �� � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z d dl
mZmZ d dl
mZ d dlmZ d d lmZmZmZ d d
lmZ e j e� � Z G d� de� � ZdS )
� N)�Values)�List)�
cmdoptions)�make_target_python)�RequirementCommand�with_cleanup)�SUCCESS)�get_requirement_tracker)�
ensure_dir�normalize_path�write_output)�
TempDirectoryc �N � e Zd ZdZdZd d�Zededee de
fd�� � ZdS )
�DownloadCommandaL
Download packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
pip also supports downloading from "requirements files", which provide
an easy way to specify a whole environment to be downloaded.
a
%prog [options] [package-index-options] ...
%prog [options] -r [package-index-options] ...
%prog [options] ...
%prog [options] ...
%prog [options] ...�returnNc
�X � | j � t j � � � � | j � t j � � � � | j � t j � � � � | j � t j � � � � | j � t j � � � � | j � t j � � � � | j � t j � � � � | j � t j
� � � � | j � t j � � � � | j � t j � � � � | j � t j
� � � � | j � t j � � � � | j � t j � � � � | j � t j � � � � | j � t j � � � � | j � ddddddt$ j d�� � t j | j � � t j t j | j � � }| j � d |� � | j � d | j � � d S )
Nz-dz--destz--destination-dirz--destination-directory�download_dir�dirzDownload packages into .)�dest�metavar�default�helpr )�cmd_opts�
add_optionr �constraints�requirements�no_deps�global_options� no_binary�only_binary�
prefer_binary�src�pre�require_hashes�progress_bar�no_build_isolation�
use_pep517�
no_use_pep517�ignore_requires_python�os�curdir�add_target_python_options�make_option_group�index_group�parser�insert_option_group)�self�
index_optss ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/commands/download.py�add_optionszDownloadCommand.add_options% sv � ��
� � ��!7�!9�!9�:�:�:��
� � ��!8�!:�!:�;�;�;��
� � ��!3�!5�!5�6�6�6��
� � ��!:�!<�!<�=�=�=��
� � ��!5�!7�!7�8�8�8��
� � ��!7�!9�!9�:�:�:��
� � ��!9�!;�!;�<�<�<��
� � ���!1�!1�2�2�2��
� � ���!1�!1�2�2�2��
� � ��!:�!<�!<�=�=�=��
� � ��!8�!:�!:�;�;�;��
� � ��!>�!@�!@�A�A�A��
� � ��!6�!8�!8�9�9�9��
� � ��!9�!;�!;�<�<�<��
� � ��!B�!D�!D�E�E�E��
� � ����%����I�0� !�
�
�
� �,�T�]�;�;�;��1��"��K�
�
�
�
��'�'��:�6�6�6���'�'��4�=�9�9�9�9�9� �options�argsc � � d|_ g |_ t j |� � t |j � � |_ t
|j � � | � |� � }t |� � }| � ||||j
�� � }| � t � � � � }t |j dd�� � }| � ||||� � }| � ||||||j d�� � } | � | |||j
|j �� � }
| � |� � |
� |d�� � }g }|j � � � D ]A}
|
j �8|
j �J �| � |
� � |� |
j � � �B|r#t7 d d
� |� � � � t: S )NT)r6 �session�
target_pythonr) �download)�delete�kind�globally_managedF)�temp_build_dirr6 �req_trackerr9 �finderr �
use_user_site)�preparerrA r6 r) �py_version_info)�check_supported_wheelszSuccessfully downloaded %s� )�ignore_installed� editablesr �check_dist_restrictionr r r �get_default_sessionr �_build_package_finderr) �
enter_contextr
r �no_clean�get_requirements�make_requirement_preparer�
make_resolver�python_version�trace_basic_info�resolver �values�satisfied_by�name�save_linked_requirement�appendr
�joinr )r1 r6 r7 r9 r: rA r@ � directory�reqsrC �resolver�requirement_set�
downloaded�reqs r3 �runzDownloadCommand.runK s � � $(�� � ����)�'�2�2�2�-�g�.B�C�C����7�'�(�(�(��*�*�7�3�3��*�7�3�3�
��+�+���'�#*�#A� ,�
�
�� �(�(�)@�)B�)B�C�C��!��'�'��!�
�
�
� � �$�$�T�7�F�G�D�D���1�1�$��#��� �-�� 2�
�
�� �%�%����#*�#A�#�2� &�
�
��
���f�%�%�%�"�*�*�4��*�M�M�� "�
�"�/�6�6�8�8� ,� ,�C���'��x�+�+�+��0�0��5�5�5��!�!�#�(�+�+�+��� M��5�s�x�x�
�7K�7K�L�L�L��r5 )r N)�__name__�
__module__�__qualname__�__doc__�usager4 r r r �str�intr` � r5 r3 r r ss � � � � � �
�
�
0�E�$:� $:� $:� $:�L �?�6� ?��c�� ?�s� ?� ?� ?� �\�?� ?� ?r5 r )�loggingr* �optparser �typingr �pip._internal.clir �pip._internal.cli.cmdoptionsr �pip._internal.cli.req_commandr r �pip._internal.cli.status_codesr �pip._internal.req.req_trackerr
�pip._internal.utils.miscr r r
�pip._internal.utils.temp_dirr � getLoggerra �loggerr rh r5 r3 �ru s �� ���� � � � � � � � � � � � � � � � � (� (� (� (� (� (� ;� ;� ;� ;� ;� ;� J� J� J� J� J� J� J� J� 2� 2� 2� 2� 2� 2� A� A� A� A� A� A� M� M� M� M� M� M� M� M� M� M� 6� 6� 6� 6� 6� 6� �� �8� $� $��z� z� z� z� z�(� z� z� z� z� zr5