File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/debuild_pkgbuild.cpython-310.pyc
Back
o ;j�� � @ s^ d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddlZddl ZddlZddlZddlmZmZ dZe�dej�Ze�dej�ZzddlZddlZdZW n eyc Y nw e�e�ZdZd d � Zdd� Z d d� Z!dd� Z"dd� Z#dd� Z$d(dd�Z%dd� Z&d)dd�Z'd)dd�Z(d*dd �Z) !d+d"d#�Z* $ %d,d&d'�Z+dS )-a Debian Package builder system .. versionadded:: 2015.8.0 This system allows for all of the components to build debs safely in chrooted environments. This also provides a function to generate debian repositories This module implements the pkgbuild interface � N)�CommandExecutionError�SaltInvocationErrorFzEnter passphrase: zPassphrase: TZpkgbuildc C sP t �dd�dv r&d} g d�}|D ] }tjj�|�sd} nqtr$| s$tS dS dS )zU Confirm this module is on a Debian-based system, and has required utilities Z os_familyF)ZKali�Debian)ZgpgZdebuildZpbuilderZrepreproT)Fz}The debbuild module could not be loaded: requires python-gnupg, gpg, debuild, pbuilder and reprepro utilities to be installed)Fz>The debbuild module could not be loaded: unsupported OS family)� __grains__�get�salt�utils�path�which�HAS_LIBS�__virtualname__)Zmissing_utilZ utils_reqdZ named_util� r �Q/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/debuild_pkgbuild.py�__virtual__0 s �r c C s t jj�| �r dS td�| ���)z9 Check for specified command name in search path TzCutility '{}' needs to be installed or made available in search path)r r r r r �format)�namer r r �_check_repo_sign_utils_supportG s ��r c C s$ d} t d | �r dS td| � d���)zF Check for /usr/lib/gnupg2/gpg-preset-passphrase is installed z%/usr/lib/gnupg2/gpg-preset-passphrase�file.file_existsTz utility 'z' needs to be installed)�__salt__r )Z util_namer r r �_check_repo_gpg_phrase_utilsU s r c C s\ d}| du r|S t | t�std��| �� D ]\}}||� d|� d�7 }|d|� d�7 }q|S )zL Get build environment overrides dictionary to use in build process � N�!'env' must be a Python dictionary�=� zexport �� isinstance�dictr �items)�envZenv_override�key�valuer r r �_get_build_env` s r! c C sN d}| du r|S t | t�std��| �� D ]\}}|dkr$||� d�7 }q|S )a� Get repo environment overrides dictionary to use in repo options process env A dictionary of variables to define the repository options Example: .. code-block:: yaml - env: - OPTIONS : 'ask-passphrase' .. warning:: The above illustrates a common PyYAML pitfall, that **yes**, **no**, **on**, **off**, **true**, and **false** are all loaded as boolean ``True`` and ``False`` values, and must be enclosed in quotes to be used as strings. More info on this (and other) PyYAML idiosyncrasies can be found :ref:`here <yaml-idiosyncrasies>`. r Nr �OPTIONSr r )r Zenv_optionsr r r r r �_get_repo_options_envo s �r# c C s� ddddddddd d � }d}d}t |�� �}| du rK|�� D ](\}}|| d dkrF||| d � d|| d � d�7 }|dkrF|| d }q||fS t| t�sTtd��g }| �� D ]<\}}||v r�|| d dkru|�|� |dkru|}|| d dkr�||| d � d|� d�7 }qZ||� d|� d�7 }qZt | �� �}|D ]*}||v r�|| d dkr�||vr�||| d � d|| d � d�7 }|dkr�|}q�||fS )a� Get repo environment overrides dictionary to use in repo distributions process env A dictionary of variables to define the repository distributions Example: .. code-block:: yaml - env: - ORIGIN : 'jessie' - LABEL : 'salt debian' - SUITE : 'main' - VERSION : '8.1' - CODENAME : 'jessie' - ARCHS : 'amd64 i386 source' - COMPONENTS : 'main' - DESCRIPTION : 'SaltStack Debian package repo' .. warning:: The above illustrates a common PyYAML pitfall, that **yes**, **no**, **on**, **off**, **true**, and **false** are all loaded as boolean ``True`` and ``False`` values, and must be enclosed in quotes to be used as strings. More info on this (and other) PyYAML idiosyncrasies can be found :ref:`here <yaml-idiosyncrasies>`. )�Ir z"processed by _get_repo_options_env)�OZOriginZ SaltStack)r% ZLabelZsalt_debian)r% ZSuiteZstable)r% �Versionz9.0)�MZCodenameZstretch)r'