/usr/lib/python3.9/site-packages/dnf/yum/__pycache__
NameSizeModeActions
misc.cpython-39.opt-1.pyc95350644editdlrm
misc.cpython-39.pyc95350644editdlrm
rpmtrans.cpython-39.opt-1.pyc139770644editdlrm
rpmtrans.cpython-39.pyc139770644editdlrm
__init__.cpython-39.opt-1.pyc1430644editdlrm
__init__.cpython-39.pyc1430644editdlrm
Edit: /usr/lib/python3.9/site-packages/dnf/yum/__pycache__/misc.cpython-39.pyc (9535B)
a ©!có+ã@sJdZddlmZmZddlmZddlmZmZmZddl Tddl Z ddl Z ddlZ ddlZ ddlZ ddlZddlZddlZddlZddlZddlZddlZddlZddlZdgZdadd „Zdad d „Zd d „ZGdd„de ƒZ!dd„Z"dd„Z#d(dd„Z$dd„Z%dd„Z&dd„Z'd)dd„Z(d d!„Z)da*d"d#„Z+d*d$d%„Z,d+d&d'„Z-dS),z% Assorted utility functions for yum. é)Úprint_functionÚabsolute_import)Úunicode_literals)Úbase64_decodebytesÚ basestringÚunicode)Ú*NZsha256cCstdurt d¡jat|ƒS)z( Tests if a string is a shell wildcard. Nz [*?]|\[.+\])Ú_re_compiled_glob_matchÚreÚcompileÚsearch)Ús©rú0/usr/lib/python3.9/site-packages/dnf/yum/misc.pyÚre_glob.s rcCsDtdur(t d¡j}t d¡j}||fatD]}||ƒr,dSq,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 ZoneZtwoZrecrrrÚre_full_search_needed6s  rcCstdS)Nr)Ú_default_checksumsrrrrÚget_default_chksum_typeDsrc@s:eZdZdZd dd„Zdd„Zdd„Zd d „Zd d „ZdS)Ú GenericHolderzèGeneric 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 itNcCs ||_dS©N)Ú_GenericHolder__iter)ÚselfÚiterrrrÚ__init__MszGenericHolder.__init__cCs|jdurt||jƒSdSr)rr©rrrrÚ__iter__Ps zGenericHolder.__iter__cCs t||ƒrt||ƒSt|ƒ‚dSr)ÚhasattrÚgetattrÚKeyError)rÚitemrrrÚ __getitem__Ts  zGenericHolder.__getitem__cCsdd„t|ƒ ¡DƒS)z!Return a dictionary of all lists.cSs"i|]\}}t|ƒtur||“qSr)ÚtypeÚlist)Ú.0ÚkeyZlist_rrrÚ \s  ÿz+GenericHolder.all_lists..)ÚvarsÚitemsrrrrÚ all_listsZszGenericHolder.all_listscCs0| ¡ ¡D]\}}t|ƒ |g¡ |¡q |S)z7 Concatenate the list attributes from 'other' to ours. )r*r)r(Ú setdefaultÚextend)rÚotherr&ÚvalrrrÚ merge_lists_szGenericHolder.merge_lists)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr"r*r/rrrrrGs  rcCsšt dd|¡}t ¡}d}d}| d¡D]d}| d¡rZ op_importÚglobÚbasenameÚshutilÚcopyÚchmod) r@rLZgpgdirZ make_ro_copyÚctxÚfpZrodirÚfrZZro_fZoptsrrrÚimport_key_to_pubring¡s&  (    *rac CsÒt ¡}z.t |¡}tj |d¡}dtjj|f}Wn"t yXdtjj|f}Yn0dtjj |f}t t   |¡ƒ}|D]>}t  |¡}t|dƒr|t|dƒdkr||d|kr||Sq|tj|tjj d�}|S)zqreturn a path to a valid and safe cachedir - only used when not running as root or when --tempcache is setrz%s-%s-z%s/%s*iÀé)ÚprefixÚdir)rRÚgeteuidÚpwdÚgetpwuidrVZi18nZucdÚconstZPREFIXr ZTMPDIRÚsortedrYÚlstatÚS_ISDIRÚS_IMODEÚtempfileZmkdtemp) ÚuidZusertupÚusernamercÚdirpathZ cachedirsZthisdirZstatsZcachedirrrrÚ getCacheDirÄs   ( rqcCsbg}t|ƒ}t|ƒ}d}||krL||}| |||…¡||7}||8}q| ||d…¡|S)zE Given a seq, split into a list of lists of length max_entries each. rN)Úlenr$Úappend)ÚseqZ max_entriesÚretZnumZbegÚendrrrÚ seq_max_splitÜs rwc CsFzt |¡Wn2ty@}z|jtjkr,‚WYd}~n d}~00dS)z| Call os.unlink, but don't die if the file isn't there. This is the main difference between "rm -f" and plain "rm". N)rRÚunlinkÚOSErrorÚerrnoÚENOENT)ÚfilenameÚerrrÚunlink_fês  r~Fc Csvz t |¡WStyp}zL|jtjtjfvrtdƒ�"}| ¡}t|ƒWdƒWS1s20YWnttfy\t ¡YS0dS)z� Get the audit-uid/login-uid, if available. os.getuid() is returned instead if there was a problem. Note that no caching is done here. z/proc/self/loginuidN)rWÚreadrJÚIOErrorÚ ValueErrorrRÚgetuid)ÚfoÚdatarrrÚ _getloginuidþs  ,rˆcCstdurtƒatS)z§ Get the audit-uid/login-uid, if available. os.getuid() is returned instead if there was a problem. The value is cached, so you don't have to save it. N)Ú_cached_getloginuidrˆrrrrÚ getloginuid srŠc Csê|r |}nJd}| d¡}|dkr@||d…}|dvr@|d|…}|durTtj d¡‚|r€t|ƒ}t|ƒ}|r€|r€|j|jkr€|Sztj ||d¡Wn4t yÈ}ztj t |ƒ¡‚WYd}~n d}~00|ræ|ræt   ||j|jf¡|S)zÎtake a filename and decompress it into the same relative location. When the compression type is not recognized (or file is not compressed), the content of the file is copied to the destinationNÚ.r)z.zckz.xzz.bz2z.gzz.lzmaz.zstz(Could not determine destination filenamei¤) ÚrfindrVÚ exceptionsZ MiscErrorr�Úst_mtimeÚlibdnfZutilsÚ decompressÚ RuntimeErrorÚstrrRÚutime) r|ÚdestZcheck_timestampsÚoutZdot_posÚextÚfir†r}rrrr�s,    &r�c Cs¤g}t |¡D]�}t|ƒ�t}|D]^}t d|¡r2q | ¡}| ¡}|sHq |rt| dd¡}| dd¡}| | ¡¡q |  |¡q Wdƒq1s”0Yq|S)a( Takes a glob of a dir (like /etc/foo.d/\*.foo) returns a list of all the lines in all the files matching that glob, ignores comments and blank lines, optional paramater 'line_as_list tells whether to treat each line as a space or comma-separated list, defaults to True. z\s*(#|$)Ú ú ú,N) rYrWr rÚrstripÚlstripÚreplacer,r;rs)ZthisglobZ line_as_listÚresultsÚfnamer`rBrrrÚread_in_items_from_dot_dir9s"    ,r )NT)F)NF)T).r3Z __future__rrrZ dnf.pycomprrrrZ libdnf.utilsr�Z dnf.constrVZ dnf.cryptoZdnf.exceptionsZdnf.i18nrzrYr9rRZos.pathrfr r[rmrr rrrrÚobjectrrCrMrarqrwr~r�rˆr‰rŠr�r rrrrÚsJ  #   $