ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/dnf/__pycache__/repodict.cpython-36.opt-1.pyc
3

g&@s`ddlmZddlmZddlmZddlZddlZ	ddl
Z
ddlZejj
Z
GdddeZdS))unicode_literals)ConfigError)_NcseZdZddZddZddZddZffd	d
ZddZd
dZ	ddZ
ddZfddZddZ
ddZddZZS)RepoDictcCsj|j}||krd}t||y|jjWn0tk
r\}ztdj|WYdd}~XnX|||<dS)Nz;Repository %s is listed more than once in the configurationz{0})idrZ_repoZverifyRuntimeErrorformat)selfrepoZid_msger
/usr/lib/python3.6/repodict.pyadd#s zRepoDict.addcCstjj|jS)N)dnfutil
MultiCallListvalues)r	r
r
rall/szRepoDict.allcCstjj|jS)N)rremptyiter_enabled)r	r
r
r_any_enabled3szRepoDict._any_enabledcCsPxJ|jD]>}x8|j||jD]$}|js tjtd|j|jq Wq
WdS)Nzenabling %s repository)rget_matchingrenabledloggerinforenable)r	Zsub_name_fnr
foundr
r
r_enable_sub_repos6s
zRepoDict._enable_sub_reposc
sfdd}tjj|}x:|D]2}d|kr>djtjj|}|j||g7_q Wx$|jD]\}}	t	||||	q`W|j
|tjt
d|dj||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
        cspt|trtjjj|jSt|ts0t|trlg}x.|D]&}t|tr:|j	tjjj|jq:W|rl|S|S)N)

isinstancestrlibdnfconfZConfigParser
substituteZ
substitutionslisttupleappend)rZsubstitutedvalue)r"r
rr#Is


z)RepoDict.add_new_repo.<locals>.substitutez://z	file://{}zAdded %s repo from %sz, )rr
ZReporospathabspathbaseurlitemssetattrrrrrjoin)
r	Zrepoidr"r+kwargsr#r
r)keyr'r
)r"radd_new_repo=s


zRepoDict.add_new_repocCsdd}|j|dS)z@enable debug repos corresponding to already enabled binary reposcSs&|jdrdj|ddSdj|S)Nz-rpmsz
{}-debug-rpmsz{}-debuginfo)endswithr)namer
r
r
debug_nameesz/RepoDict.enable_debug_repos.<locals>.debug_nameN)r)r	r6r
r
renable_debug_reposaszRepoDict.enable_debug_reposcCsdd}|j|dS)zAenable source repos corresponding to already enabled binary reposcSs&|jdrdj|ddSdj|S)Nz-rpmsz{}-source-rpmsr2z	{}-sourcer3)r4r)r5r
r
rsource_nameosz1RepoDict.enable_source_repos.<locals>.source_nameN)r)r	r8r
r
renable_source_reposkszRepoDict.enable_source_reposcsZtjjr,fddD}tjj|Sjd}|dkrLtjjgStjj|gS)Ncs g|]}tj|r|qSr
)fnmatch).0k)r0r	r
r
<listcomp>xsz)RepoDict.get_matching.<locals>.<listcomp>)rrZis_glob_patternrget)r	r0lr
r
)r0r	rruszRepoDict.get_matchingcCsdd|jDS)Ncss|]}|jr|VqdS)N)r)r;rr
r
r	<genexpr>sz(RepoDict.iter_enabled.<locals>.<genexpr>)r)r	r
r
rrszRepoDict.iter_enabledcs$ddttt|jdddDS)zreturn repos sorted by prioritycss|]
}|VqdS)Nr
)r;itemr
r
rrAsz!RepoDict.items.<locals>.<genexpr>cSs|dj|djfS)N)ZpriorityZcost)xr
r
r<lambda>sz RepoDict.items.<locals>.<lambda>)r0)sortedsuperrr,)r	)	__class__r
rr,szRepoDict.itemscCs|jS)N)keys)r	r
r
r__iter__szRepoDict.__iter__cCsdd|jDS)Ncss|]\}}|VqdS)Nr
)r;r<vr
r
rrAsz RepoDict.keys.<locals>.<genexpr>)r,)r	r
r
rrIsz
RepoDict.keyscCsdd|jDS)Ncss|]\}}|VqdS)Nr
)r;r<rKr
r
rrAsz"RepoDict.values.<locals>.<genexpr>)r,)r	r
r
rrszRepoDict.values)__name__
__module____qualname__rrrrr1r7r9rrr,rJrIr
__classcell__r
r
)rHrr!s$


r)Z
__future__rZdnf.exceptionsrZdnf.i18nrZdnf.utilrZlibdnf.confr!r:r(rrdictrr
r
r
r<module>s