관리-도구
편집 파일: repodict.cpython-39.opt-1.pyc
a �����g�g&����������������������@���s`���d�dl�mZ�d�dlmZ�d�dlmZ�d�dlZd�dlZ d�dl Z d�dlZejj Z G�dd��de�ZdS�)�����)�unicode_literals)�ConfigError)�_Nc�����������������������s~���e�Zd�Zdd��Zdd��Zdd��Zdd��Zdd d�Zdd ��Zdd��Z dd��Z dd��Z��fdd�Zdd��Z dd��Zdd��Z���ZS�)�RepoDictc�������������� ���C���sl���|j�}||�v�rd}t||���z|j����W�n2�ty^�}�ztd�|���W�Y�d�}~n d�}~0�0�||�|<�d�S�)Nz;Repository %s is listed more than once in the configurationz{0})�idr���Z_repoZverify�RuntimeError�format)�self�repoZid_�msg�e��r ����0/usr/lib/python3.9/site-packages/dnf/repodict.py�add#���s����$zRepoDict.addc�����������������C���s���t�j�|�����S��N)�dnf�util� MultiCallList�values�r ���r ���r ���r����all/���s����zRepoDict.allc�����������������C���s���t�j�|������S�r���)r���r����empty�iter_enabledr���r ���r ���r����_any_enabled3���s����zRepoDict._any_enabledc�����������������C���sH���|�����D�]:}|��||j��D�]$}|jst�td�|j��|����qqd�S�)Nzenabling %s repository)r����get_matchingr����enabled�logger�infor����enable)r ���Zsub_name_fnr ����foundr ���r ���r����_enable_sub_repos6���s ����zRepoDict._enable_sub_reposr ���c����������� ���������s������fdd�}t�j�|���}|D�]2}d|vr<d�tj�|��}|�j||�g7��_q|���D�]\}} t |||| ���qZ|�� |��t�t d�|d�|���|S�)a��� Creates new repo object and add it into RepoDict. Variables in provided values will be automatically substituted using conf.substitutions (like $releasever, ...) @param repoid: Repo ID - string @param conf: dnf Base().conf object @param baseurl: List of strings @param kwargs: keys and values that will be used to setattr on dnf.repo.Repo() object @return: dnf.repo.Repo() object c��������������������sl���t�|�t�rtjj�|���j�S�t�|�t�s0t�|�t�rhg�}|�D�]&}t�|t�r8|� tjj�|��j���q8|rh|S�|�S�r���) � isinstance�str�libdnf�confZConfigParser� substituteZ substitutions�list�tuple�append)r���Zsubstituted�value�r$���r ���r���r%���I���s���� �z)RepoDict.add_new_repo.<locals>.substitutez://z file://{}zAdded %s repo from %sz, )r���r ���ZRepor����os�path�abspath�baseurl�items�setattrr���r���r���r����join) r ���Zrepoidr$���r.����kwargsr%���r ���r,����keyr)���r ���r*���r����add_new_repo=���s���� zRepoDict.add_new_repoc�����������������C���s���dd��}|���|��dS�)z@enable debug repos corresponding to already enabled binary reposc�����������������S���s&���|���d�rd�|�d�d���S�d�|��S�)N�-rpmsz {}-debug-rpms���z{}-debuginfo��endswithr�����namer ���r ���r���� debug_namee���s�����z/RepoDict.enable_debug_repos.<locals>.debug_nameN�r ���)r ���r;���r ���r ���r����enable_debug_reposa���s����zRepoDict.enable_debug_reposc�����������������C���s���dd��}|���|��dS�)zAenable source repos corresponding to already enabled binary reposc�����������������S���s&���|���d�rd�|�d�d���S�d�|��S�)Nr5���z{}-source-rpmsr6���z {}-sourcer7���r9���r ���r ���r����source_nameo���s�����z1RepoDict.enable_source_repos.<locals>.source_nameNr<���)r ���r>���r ���r ���r����enable_source_reposk���s����zRepoDict.enable_source_reposc��������������������sZ���t�j����r,���fdd��D��}t�j�|�S�����d��}|d�u�rLt�j�g��S�t�j�|g�S�)Nc��������������������s ���g�|�]}t���|���r�|��qS�r ���)�fnmatch)�.0�k�r3���r ���r ���r���� <listcomp>x��������z)RepoDict.get_matching.<locals>.<listcomp>)r���r���Zis_glob_patternr����get)r ���r3����lr ���r ���rC���r���r���u���s����zRepoDict.get_matchingc�����������������C���s���dd��|�����D��S�)Nc�����������������s���s���|�]}|j�r|V��qd�S�r���)r���)rA����rr ���r ���r���� <genexpr>����rE���z(RepoDict.iter_enabled.<locals>.<genexpr>)r���r���r ���r ���r���r������s����zRepoDict.iter_enabledc��������������������s$���dd��t�tt|�����dd��d�D��S�)zreturn repos sorted by priorityc�����������������s���s���|�] }|V��qd�S�r���r ���)rA����itemr ���r ���r���rI�������rE���z!RepoDict.items.<locals>.<genexpr>c�����������������S���s���|�d�j�|�d�jfS�)N����)�priorityZcost)�xr ���r ���r����<lambda>����rE���z RepoDict.items.<locals>.<lambda>)r3���)�sorted�superr���r/���r����� __class__r ���r���r/�������s�����zRepoDict.itemsc�����������������C���s���|�����S�r���)�keysr���r ���r ���r����__iter__����s����zRepoDict.__iter__c�����������������C���s���dd��|�����D��S�)Nc�����������������s���s���|�]\}}|V��qd�S�r���r ����rA���rB����vr ���r ���r���rI�������rE���z RepoDict.keys.<locals>.<genexpr>�r/���r���r ���r ���r���rS�������s����z RepoDict.keysc�����������������C���s���dd��|�����D��S�)Nc�����������������s���s���|�]\}}|V��qd�S�r���r ���rU���r ���r ���r���rI�������rE���z"RepoDict.values.<locals>.<genexpr>rW���r���r ���r ���r���r�������s����zRepoDict.values)r ���)�__name__� __module__�__qualname__r���r���r���r ���r4���r=���r?���r���r���r/���rT���rS���r���� __classcell__r ���r ���rQ���r���r���!���s��� $ r���)Z __future__r���Zdnf.exceptionsr���Zdnf.i18nr���Zdnf.utilr���Zlibdnf.confr#���r@���r+���r���r����dictr���r ���r ���r ���r����<module>���s���