HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/__pycache__/fetch.cpython-310.pyc
o

�N�gT	�@sldZddlZddlZddlmZmZddlmZmZm	Z	m
Z
mZmZm
Z
mZdd�Zefdd	�Zd
d�ZdS)z
The ``relenv fetch`` command.
�N�)�platform_module�platform_versions)�CHECK_HOSTS�DATA_DIR�__version__�
build_arch�	check_url�download_url�get_triplet�work_dircCsTt�}|jddd�}|jtd�|jdt�|jtdd�|jdt�d	td
d�dS)
z�
    Setup the subparser for the ``fetch`` command.

    :param subparsers: The subparsers object returned from ``add_subparsers``
    :type subparsers: argparse._SubParsersAction
    �fetchzFetch relenv builds)�description)�funcz--archz0Architecture to download. [default: %(default)s])�default�choices�type�helpz--pythonrz)The python version [default: %(default)s])rrrN)	r�
add_parser�set_defaults�main�add_argumentrZARCHES�strr)Z
subparsers�modZ	subparser�r�@/opt/saltstack/salt/lib/python3.10/site-packages/relenv/fetch.py�setup_parsers �
�rc
Cs�d|�d|�d|�d�}t|dd�sB|D]}d|�d|�d	|�d|�d�	}t|dd�r-nqtd
d�dd
�|D�����t�d�tdt�}tj|dd�t	||�dS)z+
    Fetch the specified python build.
    z7https://github.com/saltstack/relenv/releases/download/v�/�-z.tar.xz�)�timeoutzhttps://z/relenv/z/build/z-Unable to find file on any hosts: github.com � css�|]
}|�d�dVqdS)rrN)�split)�.0�xrrr�	<genexpr>>s�zfetch.<locals>.<genexpr>r�buildT)�exist_okN)
r	�print�join�sys�exitrr�os�makedirsr
)�version�triplet�python�check_hosts�url�hostZbuilddirrrrr
2s��

r
cCsPtj�dt�}t|jd�}|j}t}tj�dd�rtjdg}t||||�dS)z�
    The entrypoint into the ``relenv fetch`` command.

    :param args: The args passed to the command
    :type args: argparse.Namespace
    ZRELENV_FETCH_VERSION)�machineZRELENV_FETCH_HOST�N)	r,�environ�getrr�archr0rr
)�argsr.r/r0r1rrrrFsr)�__doc__r,r*r&rr�commonrrrrr	r
rrrr
rrrrr�<module>s(