a
!c+ @ sJ d Z ddlmZmZ ddlmZ ddlmZmZmZ ddl T ddl
ZddlZ
ddlZ
ddlZ
ddlZ
ddlZddlZddlZddlZddlZddlZddlZddlZddlZdgZdadd Zdad
d Zdd
ZG dd de Z!dd Z"dd Z#d(ddZ$dd Z%dd Z&dd Z'd)ddZ(d d! Z)da*d"d# Z+d*d$d%Z,d+d&d'Z-dS ),z%
Assorted utility functions for yum.
)print_functionabsolute_import)unicode_literals)base64_decodebytes
basestringunicode)*NZsha256c C s t du rtdja t | S )z( Tests if a string is a shell wildcard. Nz[*?]|\[.+\])_re_compiled_glob_matchrecompilesearch)s r 0/usr/lib/python3.9/site-packages/dnf/yum/misc.pyre_glob. s r c C sD t du r(tdj}tdj}||fa t D ]}|| r, dS q,dS )zC Tests if a string needs a full nevra match, instead of just name. Nz.*([-.*?]|\[.+\]).z[0-9]+:TF)_re_compiled_full_matchr
r match)r
ZoneZtwoZrecr r r re_full_search_needed6 s r c C s t d S )Nr )_default_checksumsr r r r get_default_chksum_typeD s r c @ s: e Zd ZdZd
ddZdd Zdd Zd d
Zdd ZdS )
GenericHolderzGeneric Holder class used to hold other objects of known types
It exists purely to be able to do object.somestuff, object.someotherstuff
or object[key] and pass object to another function that will
understand itNc C s
|| _ d S N)_GenericHolder__iter)selfiterr r r __init__M s zGenericHolder.__init__c C s | j d urt| | j S d S r )r r r r r r __iter__P s
zGenericHolder.__iter__c C s t | |rt| |S t|d S r )hasattrgetattrKeyError)r itemr r r __getitem__T s
zGenericHolder.__getitem__c C s dd t | D S )z!Return a dictionary of all lists.c S s" i | ]\}}t |tu r||qS r )typelist).0keyZlist_r r r