File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/openbsdpkg.cpython-310.pyc
Back
o ;j�+ � @ s� d Z ddlZddlZddlZddlZddlZddlmZm Z e� e�Ze� d�ZdZdd� Zdd � Zddd�Zd d� Zdd� Zddd�Zddd�Zddd�Zdd� Zddd�ZdS )a� Package support for OpenBSD .. note:: The package repository is configured on each host using ``/etc/installurl`` from OpenBSD 6.1 onwards. Earlier releases relied on ``/etc/pkg.conf``. .. versionchanged:: 2016.3.5 Package versions on OpenBSD are not normally specified explicitly; instead packages may be available in multiple *flavors*, and *branches* which are specified by the format of the package name. This module allows you to use the same formatting as ``pkg_add(1)``, and will select the empty flavor and default branch by default. Examples: .. code-block:: yaml - rsync - vim--no_x11 - ruby%2.3 � N)�CommandExecutionError�MinionErrorz0^((?:[^-]+|-(?![0-9]))+)-([0-9][^-]*)(?:-(.*))?$�pkgc C s t d dkrtS dS )z9 Set the virtual pkg module if the os is OpenBSD �osZOpenBSD)FzTThe openbsdpkg execution module cannot be loaded: only available on OpenBSD systems.)Z __grains__�__virtualname__� r r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/openbsdpkg.py�__virtual__+ s r c C s* | rt d S t�t d �}td |� |S )z' Use pkg list from __context__ � pkg.list_pkgs�pkg_resource.stringify)�__context__�copy�deepcopy�__salt__)�versions_as_list�retr r r �_list_pkgs_from_context8 s r Fc s� t jj�| �} t� fdd�dD ��ri S dtv r"� �dd�r"t| �S i }d}td |d d �}|� � D ]+}zt �|��� \}}}W n t yI Y q2w ||rRd|� �nd7 }td |||� q2td |� t�|�td<