3 ʣ`19@s4ddlmZddlmZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl mZdddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dg9ZejZejZejZejZejZejZd?eeefZejZejZejZejZejZejZejZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)ej*Z*ej+Z+ej,Z,ej-Z-ej.Z.ej/Z/ej0Z0ej1Z1ej2Z2ej3Z3ej4Z4ej5Z5ej6Z6ej7Z7ej8Z8ej9Z9ej:Z:ej;Z;ejZ>ej?Z?d@d5Z@ejAZAejBZBejCZCejDZDejEZEejFZFejGZGejHZHejIZIejJZJejKZKejLZLejMZMejNZNejOZOejPZPejQZQejRZRejSZSejTZTejUZUejVZVejWZWejXZXejYZYejZZZej[Z[ej\Z\ej]Z]ej^Z^ej_Z_ej`dAkZaejbdBZcdCd4ZdGdDd8d8ejeZeGdEd6d6ejfZfdFdGZgdHdIZhGdJd>d>ejiZiGdKd;d;ejjZjdS)L)absolute_import) version_infoN)_hawkeyVERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCHZtest CHKSUM_MD5 CHKSUM_SHA1 CHKSUM_SHA256 CHKSUM_SHA384 CHKSUM_SHA512ICASECMDLINE_REPO_NAMEMODULE_FAIL_SAFE_REPO_NAMESYSTEM_REPO_NAME REASON_DEP REASON_USER REASON_CLEANREASON_WEAKDEP FORM_NEVRA FORM_NEVRFORM_NEVFORM_NA FORM_NAMEZFORM_ALLMODULE_FORM_NSVCAPMODULE_FORM_NSVCAMODULE_FORM_NSVAPMODULE_FORM_NSVAMODULE_FORM_NSAPMODULE_FORM_NSAMODULE_FORM_NSVCPMODULE_FORM_NSVPMODULE_FORM_NSVCMODULE_FORM_NSVMODULE_FORM_NSPMODULE_FORM_NSMODULE_FORM_NAPMODULE_FORM_NAMODULE_FORM_NPZMODULE_FORM_NArchException ExceptionQueryExceptionRuntimeExceptionValueException chksum_name chksum_type split_nevraconvert_hawkey_reasonGoalNEVRANSVCAPPackageQueryRepoSackSelectorSubjectz%d.%d.%dcCsH|tkrtjjS|tkr tjjS|tkr0tjjS|tkr@tjj Stjj S)N) rlibdnf transactionZTransactionItemReason_USERrZ TransactionItemReason_DEPENDENCYrZTransactionItemReason_CLEANrZ%TransactionItemReason_WEAK_DEPENDENCYTransactionItemReason_UNKNOWN)Z hawkey_reasonr? /usr/lib64/python3.6/__init__.pyr2rsZdnfcCstj|}t|S)N)rr1r4)str?r?r@r1s c@s4eZdZddddddgZddZd d Zd d Zd S)r5namestreamversioncontextarchprofilecCs&|jo$|j o$|j o$|j o$|j S)N)rDrErFrHrI)selfr?r?r@_has_just_nameszNSVCAP._has_just_namecsHfddjD}ddtj|D}djdd|D}dj|S)Ncsg|]}t|qSr?)getattr).0i)rJr?r@ sz#NSVCAP.__repr__..cSs g|]\}}|dk r||fqS)Nr?)rMfieldvaluer?r?r@rOsz, cSsg|]\}}dj||qS)z{}={})format)rMrPrQr?r?r@rOsz ) NSVCAP_FIELDSzipjoinrR)rJvaluesitemsZ items_strr?)rJr@__repr__szNSVCAP.__repr__cCs8d}x.|jD]$}t||}t||}|||kM}q W|S)NT)rSrL)rJotherresultrPZ value_selfZ value_otherr?r?r@__eq__s    z NSVCAP.__eq__N)__name__ __module__ __qualname__rSrKrXr[r?r?r?r@r5scsJeZdZeeeeeee hZ fddZ fddZ ddZ ddZZS) r3cstt|j|t|_dS)N)superr3__init__set group_members)rJsack) __class__r?r@r`sz Goal.__init__cs4tt|j|}|tkr,|j|jkr,tjjSt |S)N) r_r3 get_reasonrrDrbr<r=TransactionItemReason_GROUPr2)rJpkgcode)rdr?r@reszGoal.get_reasoncCs$|tjjkr |j|jkr tjjS|S)N)r<r=r>rDrbrf)rJrgZcurrent_reasonr?r?r@ group_reasonszGoal.group_reasoncCs(d}tj||j|j}|j|dS)Nz*--> Finding unneeded leftover dependencies)loggerdebugZ userinstalledZswdb)rJqueryhistorymsgZuser_installedr?r?r@push_userinstalleds  zGoal.push_userinstalled)r\r]r^ERASE DISTUPGRADEDISTUPGRADE_ALL DOWNGRADEINSTALLUPGRADE UPGRADE_ALLZ _goal_actionsr`reriro __classcell__r?r?)rdr@r3s  cCs t rt|tr|jddS|S)a Identity, except when obj is unicode then return a UTF-8 string. This assumes UTF-8 is good enough for libsolv and always will be. Else we'll have to deal with some encoding configuration. Since we use this to match string queries, we have to enforce 'strict' and potentially face exceptions rather than bizarre results. (Except that as long as we stick to UTF-8 it never fails.) utf8strict)PY3 isinstanceZunicodeencode)objr?r?r@_encodes  r~cCs@t rt|tstr$t|tr$|g}t|to>tdd|DS)Ncss|]}t|td@VqdS)z*[?N)ra)rMpr?r?r@ sz"is_glob_pattern..)rzr{Z basestringstrlistany)patternr?r?r@is_glob_patternsrcsjeZdZdfdd ZfddZeddZdd Zdfd d ZdddZ ddZ e ddZ Z S)r;Fcstt|j||ddS)N) ignore_case)r_r;r`)rJZpkg_specr)rdr?r@r`szSubject.__init__c/s0tt|j||}x|D]}t|dVqWdS)N)nsvcap)r_r;nsvcap_possibilitiesr5)rJargskwargsZpossr)rdr?r@rs zSubject.nsvcap_possibilitiescCs|jjdp|jjdS)N/z*/)r startswith)rJr?r?r@_filename_patternszSubject._filename_patterncCs$|dr |djr t|djSdS)NnevraF)rHr)rJsolutionr?r?r@_is_arch_specified szSubject._is_arch_specifiedNc#sHtjdtd}tj|tx&tt|j|dD]}t|dVq0WdS)NalwayszThe function 'nevra_possibilities' is deprecated. Please use 'get_nevra_possibilities' instead. The function will be removed on 2018-01-01)forms)r)warnings simplefilterDeprecationWarningwarnr_r;Zget_nevra_possibilitiesr4)rJZformrnr)rdr?r@nevra_possibilitiess   zSubject.nevra_possibilitiesTcCs|dkr|j|j|dd}|d}t|dkr2gS|j||}|sFgS|j rXt|jsp|dol|djdkr4d}|r|dr|djrd}|j } |r|j |d}|j } | j dd | Dd } |r|j | | j | }g} xL|jjD]<\} }|r||jjj |d j}| j|j|j|qW| S|rj|drj|djrj|j |jjj |d }|j } |r|j | |r|j |dj | }|sgS|j|j|gSdS) NF)rZwith_srcrlrrT)reponamecSsg|] }|jqSr?)rD)rMrgr?r?r@rO1sz/Subject._get_best_selectors..)rD) obsoletes)Zget_best_solutionrclen_apply_security_filtersrrrrDZ has_just_nameZ installedfilterZ availableZ_report_already_installedunionZ _name_dictrWrlZrunappend_list_or_query_to_selector)rJbaserrrZreportsrqZwith_obsoletesZinstalled_queryZavailable_queryZinstalled_relevant_queryZsltrsrDZ pkgs_listr?r?r@_get_best_selectorssN       zSubject._get_best_selectorscCs(|j|dd}|s$tjdj|j|S)NF)warningz%No security updates for argument "{}")Z_merge_update_filtersrjrrRr)rJrlrr?r?r@rJszSubject._apply_security_filterscCst|}|j|dS)N)rg)r:ra)rcZ list_or_queryZsltrr?r?r@rPsz"Subject._list_or_query_to_selector)F)N)NTNFN)r\r]r^r`rpropertyrrrrr staticmethodrrwr?r?)rdr@r;s    1cseZdZfddZZS)r8cs0tjdtd}tj|ttt|j|dS)NrzoThe class hawkey.Repo is deprecated. Please use dnf.repo.Repo instead. The class will be removed on 2019-12-31.)rrrrr_r8r`)rJrDrn)rdr?r@r`Xs  z Repo.__init__)r\r]r^r`rwr?r?)rdr@r8Vs)kZ __future__rsysrZpython_version collections functoolsZloggingoperatorZtimerZlibdnf.transactionr<r__all__r4r7r:rrr rrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*Z MODULE_FORM_NrZEQZLTZGTZAPPLY_EXCLUDESZIGNORE_MODULAR_EXCLUDESZIGNORE_REGULAR_EXCLUDESZIGNORE_EXCLUDESr r r r rrrrrr2ZADVISORY_UNKNOWNZADVISORY_SECURITYZADVISORY_BUGFIXZADVISORY_ENHANCEMENTZADVISORY_NEWPACKAGEZREFERENCE_UNKNOWNZREFERENCE_BUGZILLAZ REFERENCE_CVEZREFERENCE_VENDORr6ZReldepr9r+r,r.Z ArchExceptionr-r/r0Z detect_archrprqrrrsrtrurvZALLOW_UNINSTALLZ FORCE_BESTZVERIFYZIGNORE_WEAK_DEPSmajorrzZ getLoggerrjr1r5r3r~rr;r8r?r?r?r@s          #Z