/usr/lib/python3.9/site-packages/dnf/__pycache__
NameSizeModeActions
base.cpython-39.opt-1.pyc816190644editdlrm
base.cpython-39.pyc818610644editdlrm
callback.cpython-39.opt-1.pyc37330644editdlrm
callback.cpython-39.pyc37330644editdlrm
comps.cpython-39.opt-1.pyc257750644editdlrm
comps.cpython-39.pyc262880644editdlrm
const.cpython-39.opt-1.pyc14380644editdlrm
const.cpython-39.pyc14380644editdlrm
crypto.cpython-39.opt-1.pyc68910644editdlrm
crypto.cpython-39.pyc68910644editdlrm
dnssec.cpython-39.opt-1.pyc92700644editdlrm
dnssec.cpython-39.pyc92700644editdlrm
drpm.cpython-39.opt-1.pyc53590644editdlrm
drpm.cpython-39.pyc53590644editdlrm
exceptions.cpython-39.opt-1.pyc72630644editdlrm
exceptions.cpython-39.pyc72630644editdlrm
goal.cpython-39.opt-1.pyc2590644editdlrm
goal.cpython-39.pyc2590644editdlrm
history.cpython-39.opt-1.pyc2860644editdlrm
history.cpython-39.pyc2860644editdlrm
i18n.cpython-39.opt-1.pyc96450644editdlrm
i18n.cpython-39.pyc96450644editdlrm
lock.cpython-39.opt-1.pyc41820644editdlrm
lock.cpython-39.pyc41820644editdlrm
logging.cpython-39.opt-1.pyc84460644editdlrm
logging.cpython-39.pyc85100644editdlrm
match_counter.cpython-39.opt-1.pyc41380644editdlrm
match_counter.cpython-39.pyc41380644editdlrm
package.cpython-39.opt-1.pyc102570644editdlrm
package.cpython-39.pyc102570644editdlrm
persistor.cpython-39.opt-1.pyc42410644editdlrm
persistor.cpython-39.pyc42410644editdlrm
plugin.cpython-39.opt-1.pyc90640644editdlrm
plugin.cpython-39.pyc90640644editdlrm
pycomp.cpython-39.opt-1.pyc30160644editdlrm
pycomp.cpython-39.pyc30160644editdlrm
query.cpython-39.opt-1.pyc8680644editdlrm
query.cpython-39.pyc8680644editdlrm
repo.cpython-39.opt-1.pyc224290644editdlrm
repo.cpython-39.pyc224290644editdlrm
repodict.cpython-39.opt-1.pyc56340644editdlrm
repodict.cpython-39.pyc56340644editdlrm
sack.cpython-39.opt-1.pyc22990644editdlrm
sack.cpython-39.pyc22990644editdlrm
selector.cpython-39.opt-1.pyc2670644editdlrm
selector.cpython-39.pyc2670644editdlrm
subject.cpython-39.opt-1.pyc3020644editdlrm
subject.cpython-39.pyc3020644editdlrm
transaction.cpython-39.opt-1.pyc16730644editdlrm
transaction.cpython-39.pyc16730644editdlrm
transaction_sr.cpython-39.opt-1.pyc173450644editdlrm
transaction_sr.cpython-39.pyc173450644editdlrm
util.cpython-39.opt-1.pyc231260644editdlrm
util.cpython-39.pyc231810644editdlrm
__init__.cpython-39.opt-1.pyc5440644editdlrm
__init__.cpython-39.pyc5440644editdlrm
Edit: /usr/lib/python3.9/site-packages/dnf/__pycache__/util.cpython-39.pyc (23181B)
a jŽaã@sžddlmZddlmZddlmZddlmZmZddlmZm Z ddl Z ddl Z ddl Z ddl Z ddlZ ddlZ ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZe  d¡Z!e  "¡j#d k�re  "¡j#ndZ$e$ %¡Z&d d „Z'dbd d „Z(dcdd„Z)dd„Z*dd„Z+dd„Z,dd„Z-dd„Z.dd„Z/dd„Z0dd „Z1d!d"„Z2d#d$„Z3d%d&„Z4d'd(„Z5d)d*„Z6d+d,„Z7d-d.„Z8d/d0„Z9d1d2„Z:d3d4„Z;d5d6„Zd;d<„Z?d=d>„Z@d?d@„ZAdAdB„ZBdCdD„ZCdddFdG„ZDdHdIejEfdJdK„ZFdLdM„ZGdNdO„ZHdPdQ„ZIdRdS„ZJGdTdU„dUeKƒZLGdVdW„dWeMƒZNGdXdY„dYeOƒZPdZd[„ZQd\d]„ZRd^d_„ZSGd`da„daƒZTdS)eé)Úprint_function)Úabsolute_import)Úunicode_literalsé)ÚPY3Ú basestring)Ú_ÚucdNÚdnfZyumcCs¼t|dgƒt|dgƒt|dgƒtƒ}|D]ˆ}||vr|‚WYd}~n d}~00dS)Nií)r8)rBÚmakedirsÚOSErrorÚerrnoZEEXISTrFÚisdir)Zdnamer/rrrÚ ensure_dir�s rOcCsDg}|}tj |¡\}}|s2|s$|s@| d|¡q@| d|¡q|S)z` Split path by path separators. Use os.path.join() to join the path back to string. r)rBrFÚsplitÚinsert)rFÚresultÚheadÚtailrrrÚ split_path™s rUcCs4z t|ƒ}Wnty*tt|ƒƒ}Yn0|dkSrA)r=Ú TypeErrorÚlist)ÚiterableÚlrrrÚempty­s   rZcCs,t|ƒ}z t|ƒWSty&YdS0dS)zFReturns the first item from an iterable or None if it has no elements.N©ÚiterÚnextÚ StopIteration©rXÚitrrrÚfirst´s   racCs6t|ƒ}ztdd„|DƒƒWSty0YdS0dS)Ncss|]}|dur|VqdSr<r)Ú.0ÚitemrrrÚ Àóz!first_not_none..r[r_rrrÚfirst_not_none½s  rfcCst ¡t|ƒSr<)ÚtimeÚfile_timestamp©ÚfnrrrÚfile_ageÅsrkcCs t |¡jSr<)rBÚstatÚst_mtimerirrrrhÈsrhcCs8zt t ¡¡dWSty2dt ¡YS0dS)NrzUID: %s)ÚpwdÚgetpwuidrBrCÚKeyErrorrrrrÚget_effective_loginËs rqcCs(|D]}| |¡}|dur|Sq|S)z!Like dict.get() for nested dicts.N)Úget)ZdctÚkeysZ not_foundÚkrrrÚget_inÑs   rucs‡fdd„}t ||ggf¡S)Ncs|tˆ|ƒƒ  |¡|Sr<)Úboolr)ZaccrcrirrÚsplitterÚsz!group_by_filter..splitter)Ú functoolsÚreduce)rjrXrwrrirÚgroup_by_filterÙs rzccs"|D]}||ƒr|V|VqdS)z/Insert an item into an iterable by a condition.Nr)rcrXÚ conditionZ original_itemrrrÚ insert_ifßsr|cCs*z t|ƒWnty YdS0dSdS)z&Test whether an iterator is exhausted.TFN)r]r^)ÚiteratorrrrÚ is_exhaustedæs   r~cCs*t|ƒr|g}t|tƒo(tdd„|DƒƒS)Ncss|]}t|ƒtdƒ@VqdS)z*[?N)r)rbÚprrrrdòrez"is_glob_pattern..)Úis_string_typeÚ isinstancerWÚany)ÚpatternrrrÚis_glob_patternïsr„cCstrt|tƒSt|tƒSdSr<)rr�r)r)Úobjrrrr€ôs r€cs‡fdd„}|S)z…Decorator to get lazy attribute initialization. Composes with @property. Force reinitialization by deleting the . cs‡‡fdd„}|S)Ncs<z t|ˆƒWSty6ˆ|ƒ}t|ˆ|ƒ|YS0dSr<)ÚgetattrÚAttributeErrorr)r…Úval)ÚattrnamerjrrÚ cached_getters    z6lazyattr..get_decorated..cached_getterr)rjrŠ©r‰rirÚ get_decoratedÿszlazyattr..get_decoratedr)r‰rŒrr‹rÚlazyattrús r�cGstt|g|¢RŽƒS)zžLike functools.map(), but return a list instead of an iterator. This means all side effects of fn take place even without iterating the result. ©rWÚmap)rjÚseqrrrÚmapall sr‘cCs8t dt |¡¡}tjjs4t ¡d}|r4| |¡}|S)z6Convert time into locale aware datetime string object.z%cr) rgÚstrftimeÚ localtimer rrÚlocaleÚ getlocaleÚdecode)Z timestampÚtZcurrent_locale_settingrrrÚnormalize_times   r˜c Cs–zxd}dd„t |¡Dƒ}t|ƒdkrt|d}td ||¡ƒ�&}| ¡}t|ƒdkWdƒWS1sj0YWdSttfy�YdS0dS)z†Decide whether we are on line power. Returns True if we are on line power, False if not, None if it can not be decided. z/sys/class/power_supplycSsg|]}| d¡r|‘qS)ZAC)r)rbZnoderrrÚ &rezon_ac_power..rz {}/{}/onlinerN) rBrEr=ÚopenÚformatÚreadÚintr(Ú ValueError)Z ps_folderZac_nodesZac_nodeZ ac_statusÚdatarrrÚ on_ac_powers ,r cCsœz ddl}Wnty YdS0z0| ¡}| dd¡}| |d¡}| dd¡}Wn|jyhYdS0|dkrvdS|dvr‚dS|d vrŽd Std |ƒ‚dS) z�Decide whether we are on metered connection. Returns: True: if on metered connection False: if not None: if it can not be decided rNzorg.freedesktop.NetworkManagerz/org/freedesktop/NetworkManagerzorg.freedesktop.DBus.PropertiesZMetered)réT)ééFz&Unknown value for metered property: %r)ÚdbusÚ ImportErrorZ SystemBusZ get_objectZ InterfaceZGetZ DBusExceptionrž)r¤ZbusÚproxyZifaceZmeteredrrrÚon_metered_connection1s(  ÿ r§cCs&t |¡\}}tj ||¡t||ƒfS)z…Use a predicate to partition entries into false entries and true entries. Credit: Python library itertools' documentation. )Ú itertoolsÚteer rÚ filterfalseÚfilter)ZpredrXÚt1Út2rrrÚ partitionNsr®cCs&zt |¡Wnty Yn0dSr<)ÚshutilÚrmtreerL©rFrrrrHWs rHc#sBtƒ‰‡fdd„}tˆ||ƒ}||ƒV||ƒ}|s6q>|Vq(dS)z«Split an iterable into tuples by a condition. Inserts a separator before each item which meets the condition and then cuts the iterable by these separators. cstt ‡fdd„|¡ƒS)Ncs|ˆkSr<r)r/©Ú separatorrrÚgrez4split_by..next_subsequence..)Útupler¨Ú takewhile)r`r²rrÚnext_subsequencefsz"split_by..next_subsequenceN)Úobjectr|)rXr{r·ZmarkedZ subsequencerr²rÚsplit_by]s   r¹cCs| |¡r|t|ƒd…SdSr<)rr=)r>ÚprefixrrrÚ strip_prefixus r»FcCsL|st |tj¡rt |d¡St|dƒ�Wdƒn1s>0YdS)z{Create an empty file if it doesn't exist or bump it's timestamps. If no_create is True only bumps the timestamps. NÚa)rBÚaccessÚF_OKÚutimerš)rFZ no_createrrrÚtouch{s  rÀÚwriteÚc Cs®zh|dkr| |¡nP|dkr(| ¡n>|dkrD| |¡| ¡n"|dkrZt||d�n td|ƒ‚Wn@ty¨}z(t d t|ƒj t |ƒ¡¡WYd}~n d}~00dS)NrÁÚflushZ write_flushÚprint)rzUnsupported type: z{}: {}) rÁrÃrÄržr(r*Úcriticalr›ÚtypeÚ__name__r )ÚtpÚmsgÚoutr/rrrÚ_terminal_messenger†s    rËcCsjd}t|ƒdk}t|dd�D]H\}}|rB|dtdƒd|7}n|dtdƒd7}|d |¡7}q|S) zž Format string about problems in resolve :param resolve_problems: list with list of strings (output of goal.problem_rules()) :return: string rÂr)r$z ZProblemz %d: z: z - )r=Ú enumeraterrG)Zresolve_problemsrÉZcount_problemsÚiZrsrrrÚ_format_resolve_problems˜s rÎcCsX| ¡d}| ¡dur4| ¡dkr4|| ¡d7}|| ¡d| ¡d| ¡S)Nú-Ú0ú:Ú.)ÚNÚEÚVÚRÚA)ÚteZnevrarrrÚ _te_nevraªs rÙc CsŒt d¡|D]@}| ¡}d}|dur,|j}d t|ƒ||| ¡¡}t |¡q|D]2}d t|ƒ|j|j|j |j |  ¡¡}t |¡qTdS)NzLogging transaction elementsz@RPM element: '{}', Key(): '{}', Key state: '{}', Failed() '{}': z^SWDB element: '{}', State: '{}', Action: '{}', From repo: '{}', Reason: '{}', Get reason: '{}') r*ÚdebugÚKeyÚstater›rÙÚFailedr)ÚactionZ from_repoÚreasonZ get_reason)Úrpm_transactionÚswdb_transactionÚrpm_elÚtsiZ tsi_staterÉrrrÚ_log_rpm_trans_with_swdb±s  ÿ þräc CsHtjjtjjtjjtjjtjjh}dd„|Dƒ}d}d}|D]®}t|ƒ}| ¡}|dusbt |dƒsœ|D]4} | j tjj krzqf| j |vr†qft | ƒ|krf| }qœqf|dus®t |dƒsÈt tdƒ |¡¡d}q<| ¡ràtjj|_ d}q.FÚpkgz%TransactionItem not found for key: {}Tz)TransactionSWDBItem not found for key: {}z#Errors occurred during transaction.)r%Ú transactionZ TransactionItemAction_DOWNGRADEDZTransactionItemAction_OBSOLETEDÚTransactionItemAction_REMOVEZTransactionItemAction_UPGRADEDZ!TransactionItemAction_REINSTALLEDrÙrÛÚhasattrrÜZTransactionItemState_UNKNOWNrÞr)r*rÅrr›rÝÚTransactionItemState_ERRORZTransactionItemState_DONErÚrä) ràráZrevert_actionsZ cached_tsiZ el_not_foundr+râZte_nevrarãZ tsi_candidaterrrÚ_sync_rpm_trans_with_swdbÂsJü    rêc@s$eZdZdd„Zdd„Zdd„ZdS)ÚtmpdircCsdtjj}tj|d�|_dS)Nz%s-)rº)r ÚconstZPREFIXr5ZmkdtemprF)ÚselfrºrrrÚ__init__ìs ztmpdir.__init__cCs|jSr<r±©rírrrÚ __enter__ðsztmpdir.__enter__cCst|jƒdSr<)rHrF)ríÚexc_typeÚ exc_valueÚ tracebackrrrÚ__exit__ósztmpdir.__exit__N)rÇÚ __module__Ú __qualname__rîrðrôrrrrrëêsrëcs(eZdZdZ‡fdd„Zdd„Z‡ZS)ÚBunchzšDictionary with attribute accessing syntax. In DNF, prefer using this over dnf.yum.misc.GenericHolder. Credit: Alex Martelli, Doug Hudgeon cs tt|ƒj|i|¤Ž||_dSr<)Úsuperr÷rîÚ__dict__)ríÚargsÚkwds©Ú __class__rrrîþszBunch.__init__cCst|ƒSr<)ÚidrïrrrÚ__hash__szBunch.__hash__)rÇrõröÚ__doc__rîrÿÚ __classcell__rrrürr÷ös r÷cs,eZdZ‡fdd„Zdd„Zdd„Z‡ZS)Ú MultiCallListcstt|ƒ ¡| |¡dSr<)rørrîÚextend)rírXrürrrîszMultiCallList.__init__cs‡‡fdd„}|S)Ncs‡‡‡fdd„}tt|ˆƒƒS)Ncst|ˆƒ}|ˆiˆ¤ŽSr<)r†)ÚvÚmethod)rúr9ÚwhatrrÚ call_what s z8MultiCallList.__getattr__..fn..call_whatrŽ)rúr9r©rír)rúr9rrj sz%MultiCallList.__getattr__..fnr)rírrjrrrÚ __getattr__ szMultiCallList.__getattr__cs‡‡fdd„}tt||ƒƒS)Ncst|ˆˆƒdSr<)r)rc©rˆrrrÚsettersz)MultiCallList.__setattr__..setterrŽ)rírrˆr rr rÚ __setattr__szMultiCallList.__setattr__)rÇrõrörîr r rrrrürrs rc Cshtgggggggggggdœ ƒ}|D�]<}|jtjjkrF|j |¡q$|jtjjkrb|j  |¡q$|jtjj krÒ|j tjj krŒ|j  |¡nD|j tjjkr¨|j |¡n(|j tjjkrÄ|j |¡n |j |¡q$|jtjjkrî|j |¡q$|jtjjk�rH|j tjjk�r|j |¡n*|j tjjk�r:|j |¡n |j |¡q$|jtjjkr$|j |¡q$|S)N) Ú downgradedÚerasedÚ erased_cleanÚ erased_depÚ installedÚinstalled_groupÚ installed_depÚinstalled_weakÚ reinstalledÚupgradedÚfailed)r÷rÜr%rærérrrÞZTransactionItemAction_DOWNGRADEr ZTransactionItemAction_INSTALLrßZTransactionItemReason_GROUPrZ TransactionItemReason_DEPENDENCYrZ%TransactionItemReason_WEAK_DEPENDENCYrrZTransactionItemAction_REINSTALLrrçZTransactionItemReason_CLEANrrrZTransactionItemAction_UPGRADEr)rær2rãrrrÚ _make_listssJõ rc s؇fdd„}tj |¡}ˆjd|d�\}}| |¡}g}tdƒ|jftdƒ|jftdƒ|j|j |j |j ftdƒ|j ftd ƒ|ftd ƒ|j |j|jftd ƒ|jffD]&\} } | || t| t |¡d �ƒ¡q¬|S) alReturns a human-readable summary of the results of the transaction. :param action_callback: function generating output for specific action. It takes two parameters - action as a string and list of affected packages for this action :return: a list of lines containing a human-readable summary of the results of the transaction cs’|j|jk|j|jk}|dkr$|Stj|j|j|j|j|jd�}tj|j|j|j|j|jd�}| |ˆj¡}|dkrz|S|j|jk|j|jkS)z…Compares two transaction items or packages by nevra. Used as a fallback when tsi does not contain package object. r)ÚnameÚepochÚversionÚreleaseÚarch) rÚhawkeyZNEVRArrrrZevr_cmpZsack)Zitem1Zitem2ÚretZnevra1Znevra2©ÚbaserrÚ_tsi_or_pkg_nevra_cmpPsÿÿz7_post_transaction_output.._tsi_or_pkg_nevra_cmpF)Zreport_problemsræZUpgradedZ DowngradedZ InstalledZ ReinstalledZSkippedZRemovedrÝ)Úkey)r ÚutilrZ_skipped_packagesÚunionrrr rrrrrrrrrrÚsortedrxÚ cmp_to_key) r!ræZaction_callbackr"Z list_bunchZskipped_conflictsZskipped_brokenZskippedrÊrÞZtsisrr rÚ_post_transaction_outputFs:  ÿ     ÿþý   ÿþ õ ÿr(cCs|r|StdƒS)Nz )r)Z input_namerrrÚ_name_unset_wrapperysr)c@sdeZdZdZdZdd„Zedd„ƒZedd„ƒZ d d „Z d d „Z ed d„ƒZ edd„ƒZ dd„ZdS)Ú _BootcSystemz/usricCs|| ¡sttdƒƒ‚ddl}||_| dd¡ddlm}||_|jj   ¡|_ |j   d¡s^J‚|j   ¡|_|jdusxJ‚dS)NzNot running on a bootc system.rÚOSTreez1.0)r+)Úis_bootc_systemr&rÚgiZ_giZrequire_versionZ gi.repositoryr+Ú_OSTreeZSysrootZ new_defaultZ_sysrootÚloadZrequire_booted_deploymentÚ_booted_deployment)rír-r+rrrrî‚s    z_BootcSystem.__init__cCsd}tj |¡S)zYReturns true is the system is managed as an immutable container, false otherwise.z/run/ostree-booted)rBrFÚisfile)Z ostree_bootedrrrr,”sz_BootcSystem.is_bootc_systemcCst |jtj¡S)z-Returns true if and only if /usr is writable.)rBr½ÚusrÚW_OK)ÚclsrrrÚ is_writable›sz_BootcSystem.is_writablecCs |j ¡Sr<)r0Z get_unlockedrïrrrÚ_get_unlocked_state sz _BootcSystem._get_unlocked_statecCs| ¡|jjjkS)züReturns true if and only if the bootc system is unlocked in a transient state, i.e. a overlayfs is mounted as read-only on /usr. Changes can be made to the overlayfs by remounting /usr as read/write in a private mount namespace.)r6r.ÚDeploymentUnlockedStateÚ TRANSIENTrïrrrÚis_unlocked_transient£sz"_BootcSystem.is_unlocked_transientc Cs¦t d¡}| |j¡dkr"tdƒ‚dddd|jg}ztj|dd�}| ¡WnTt yvt j   t d ƒ|d¡‚Yn,tjy t j   t d |j|jƒ¡‚Yn0dS) Nrz!Failed to unshare mount namespaceZmountz--options-source=disablez-oz remount,rwT©Útextz%s: command not found.z$Failed to mount %s as read/write: %s)ÚctypesZCDLLZunshareÚ CLONE_NEWNSrLr2Ú subprocessÚrunÚcheck_returncodeÚFileNotFoundErrorr Ú exceptionsÚErrorrÚCalledProcessErrorÚstderr)r4ZlibcZ mount_commandÚcompleted_processrrrÚ_set_up_mountnsªs   z_BootcSystem._set_up_mountnscCsxgd¢}ztj|dd�}| ¡WnPtyLtj tdƒ|d¡‚Yn(tjyrtj td|j ƒ¡‚Yn0dS)N)ZostreeZadminZunlockz --transientTr:z.%s: command not found. Is this a bootc system?rzFailed to unlock system: %s) r>r?r@rAr rBrCrrDrE)Zunlock_commandrFrrrÚ_unlock½s  z_BootcSystem._unlockcCsª| ¡}|jjj|jjj|jjj|jjjf}||vrFttdƒ|j ƒ‚|jjj|jjjf}||vrdn6||jjjkr„|  ¡|  ¡n||jjjkrš|  ¡|  ¡s¦J‚dS)z+Set up a writable overlay on bootc systems.z"Unhandled bootc unlocked state: %sN) r6r.r7ZNONEZ DEVELOPMENTr8ZHOTFIXržrZ value_nickrHrGr5)ríZbootc_unlocked_stateZvalid_bootc_unlocked_statesZwritable_unlocked_statesrrrÚ make_writableÈs&üþ z_BootcSystem.make_writableN)rÇrõrör2r=rîÚ staticmethodr,Ú classmethodr5r6r9rGrHrIrrrrr*~s    r*)N)NNr1)F)UZ __future__rrrrrrZdnf.i18nrr Úargparser<r Z dnf.callbackZ dnf.constZ dnf.pycomprMrxrr¨r”ZloggingrBrnr¯r>Úsysr5rgZ libdnf.repor%Zlibdnf.transactionZ getLoggerr*ÚArgumentParserÚprogZ MAIN_PROGÚupperZMAIN_PROG_UPPERr r0r;r@rDrJrOrUrZrarfrkrhrqrurzr|r~r„r€r�r‘r˜r r§r®rHr¹r»rÀÚstdoutrËrÎrÙrärêr¸rëÚdictr÷rWrrr(r)r*rrrrÚsŒ              ( -3