MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/yum/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/yum/__init__.pyc
m
ODc@s?dkZdkZdkZdkZdkZdkZdkZdkZdkZdk	Z	dk
Z
dkZdkZdk
ZdkZdkZdkZdkZdkZdkZdkZdklZdkZdkZdklZlZlZlZdklZdk Tdk!l"Z"dZ#dei$fdYZ%dS(	N(sURLGrabError(s
parsePackagessYumAvailablePackagesYumLocalPackagesYumInstalledPackage(smdErrors(t*(sListPackageSacks2.6.1tYumBasecBsotZdZdZdZdZdZdZddZdd	d
Z	dZ
dZeed
Z
dZdZdZedZeedZdZdZdZdZdZedZdZdZdZdddZdZd Zd!Zed"Z d#Z!d$Z"d%Z#d&Z$d'Z%d(Z&d)Z'd*Z(d+d,Z)d-Z*d.Z+d/Z,ed0Z-ed1Z.dd2Z/d3Z0d4Z1d5Z2d6Z3d7Z4d8Z5d9Z6d:Z7d;Z8d<Z9d=Z:ed>Z;ed?Z<ed@Z=edAZ>dBZ?dCZ@RS(DsThis is a primary structure and base class. It houses the objects and
       methods needed to perform most things in yum. It is almost an abstract
       class in that you will need to add your own class above it for most
       real use.cCs`tii|d|_ti|_|iip|iddn|i	g|_
dS(Niis6Warning, could not load sqlite, falling back to pickle(tdepsolvetDepsolvet__init__tselftlocaldbimportedtrepostRepoStoragetsqlitetlogtdisablePluginst
localPackages(R((t0/usr/lib/python2.4/site-packages/yum/__init__.pyR;s	

cCs%|iiotiSntiS(s/Factory method returning TransactionData objectN(Rtconftenable_group_conditionalsttransactioninfotConditionalTransactionDatatTransactionData(R((R
t_transactionDataFactoryGs
cCs	|GHdS(sdummy log stubN(tmsg(RtvalueR((R
R
MscCsti|IJdS(sdummy errorlog stubN(tsyststderrR(RRR((R
terrorlogQscCs	|GHdS(N(R(RRR((R
tfilelogUsicCsB|i||i_|i|i|i|idS(sndo a default setup for all the normal/necessary yum components,
           really just a shorthand for testingN(Rt
doConfigSetuptcacheRt	doTsSetuptdoRpmDBSetuptdoRepoSetuptdoSackSetup(RR((R
tdoGenericSetupXs



s
/etc/yum.conft/cCs2ti|||_|ii|_|idS(s1basic stub function for doing configuration setupN(tconfigtreadMainConfigtfntrootRRtyumvartgetReposFromConfig(RR$R%((R
RcscCs
g}x|iiiD]}}|djoqny"ti|ii||i}Wn1t	i
t	ifj
o}|i
d|qX|i|qWtid|i}x|iiD]}tii|iid|o|iid|}ntii|o-ditid|}|i|qqWxq|iD]c}yti|||i}Wn1t	i
t	ifj
o}|i
d|qLX|i|qLWxP|D]H}y|ii|Wqt	i
j
o}|i
d|qqXqWdS(s5read in repositories from config main and .repo filestmainitvarsR!t s	%s/*.repoN(t	reposlistRRtcfgtsectionstsectionR"treadRepoConfigtthisrepotErrorst	RepoErrortConfigErrorteRtappendtIncludedDirConfigParserR&tparsertreposdirtostpathtexiststinstallroottisdirtjointglobtfilestreadRtadd(RR@R4R0R7R8R+R.((R
R'jsB
"
!
cCsti|_dS(sDisable yum plugins
        N(tpluginstDummyYumPluginsR(R((R
RscCsWti||ii|||_|ii|i|ii	d|ii
ddS(sInitialise and enable yum plugins. 

        If plugins are going to be used, this should be called soon after
        doConfigSetup() has been called.

        @param optparser: The OptionParser instance for this run (optional)
        @param types: A sequence specifying the types of plugins to load.
            This should be sequnce containing one or more of the
            yum.plugins.TYPE_...  constants. If None (the default), all plugins
            will be loaded.
        RtinitN(RCt
YumPluginsRRt
pluginpatht	optparserttypest	parseoptsRt	findRepostrun(RRHRI((R
t
doPluginSetups
"cCst|dodSn|iiptidn|ii}tiid||_	|i
|_ti|_
|idS(ssetup all the transaction set storage items we'll need
           This can't happen in __init__ b/c we don't know our installroot
           yettread_tsNs4Setting up TransactionSets before config class is upR%(thasattrRRR<R1tYumBaseErrortrpmUtilsttransactiontinitReadOnlyTransactionRNRttsInfotRpmDBHoldertrpmdbtinitActionTs(RR<((R
Rs
cCs>|ip0|idd|ii|id|_ndS(s@sets up a holder object for important information from the rpmdbisReading Local RPMDBiN(RRR
RVtaddDBRN(R((R
Rs

cCst|do|`d|_nt|do|i`|`nt|do|i`|`nt|do
|`nt|dot|i_	ndS(s>closes down the instances of the rpmdb we have wangling aroundRVittsRNtuptcompsN(
RORRVRRYRNRZtFalseR[tcompiled(R((R
t
closeRpmDBs
	
	

cCs$|iid|d
jo|ii}n|ii|}t|djo|i	ddnd}xX|D]P}|id
j	o't|i
djo|d7}qvn|iio0|iiidd|i|t|fny>|ii|_|i|i|idd|i
Wn/tij
o }|i	dd	|nXy|id
|WnEtij
o6}|i	dd||i	dt|nX|d7}qvW|iio9t|djo&|iii|t||in|iidd
S(segrabs the repomd.xml for each enabled repository and sets up 
           the basics of the repositorytprereposetupiis#No Repositories Available to Set Upis
%-68s [%d/%d]isBaseurl(s) for repo: %ss%sttexts3Cannot open/read repomd.xml file for repository: %st
postreposetupN(RRCRLR0tNoneRtlistEnabledRKtlenRtnumtrepotrepoXMLturlstcallbackR
tidRRtbaseurlSetuptdirSetupR1R2R4t
getRepoXMLtstrtprogressbar(RR0R4RfReR((R
RsB
&

0

 &cCsIt|do%|djo|idddSn|djo|ii}n|ii|}|idd|pt	i
i}nh}x|D]}d||<qW||ii
_|iid||ii
|_
|i|i
i|x(|D] }|i||i|qW|iid	|i
idS(
szpopulates the package sacks for information from our repositories,
           takes optional archlist for archs to includetpkgSackis"skipping reposetup, pkgsack existsNisSetting up Package Sacksitwhichtexclude(RORR0RbR
RRcRKtarchlistRQtarchtgetArchListtarchdictRptcompatarchstpopulateSacktexcludePackagestexcludeArchsRftincludePackagesRCRLtbuildIndexes(RRsR0RfRvRtR((R
R
s2


cCs#t|dodSn|iddt|dp|i|intii|ii	|i
i|_|i
idjod|i_n|i
io|i
i|i_n|i
i|i_|i
i|i_|ii|i
io|iin|iidS(snsetups up the update object in the base class and fills out the
           updates, obsoletes and others listsRZNisBuilding updates objectRpii(RORR
RRRQtupdatestUpdatesRVt
getPkgListRpt
simplePkgListRZRt
debugleveltdebugt	obsoletestreturnObsoletestrawobsoletest	exactarcht
exactarchlistt	doUpdatestdoObsoletestcondenseUpdates(R((R
t
doUpdateSetup.s&



cCs|iddg}x|iiD]}|io|i|q&n|idjot
id|ny|ii}Wntij
o	}q&X|i|q&W|ii}t|dptid||_nx|D]}|ioqn|idd||i}y|ii|Wn,t
ij
o}|idd	|qXt|_qW|iidjot
id
n|i|ii }|ii"|dS(screate the groups object that will store the comps metadata
           finds the repos with groups, gets their comps data and merge it
           into the group objectisGetting group metadatasRepository '%s' not yet setupR[toverwrite_groupsis%Adding group file from repository: %sis,Failed to add groups file for repository: %ss%No Groups Available in any repositoryN(#RR
treposWithGroupsRtlistGroupsEnabledRftgroups_addedR5RgRbR1R2t
groupLocationtgroupremotetmdErrorstRepoMDErrorR4RRt	overwriteROR[tCompst	getGroupst	groupfileRBtGroupsErrorRtTruet
compscountRRVRtpkglisttcompile(RR4RRfRRRR((R
tdoGroupSetupNsD




cCst}x>|iiD]-}d|ii|ijoqqt	}qW|o-d}|id||iiddndS(sconvenience function to populate the repos with the filelist metadata
           it also is simply to only emit a log if anything actually gets populatedt	filelistss)Importing additional filelist informationitwithN(
R\t	necessaryRRRcRfRptaddedRjRRR
Rx(RRfRR((R
tdoSackFilelistPopulate}s
cCsk|iid|i\}}|iidd|d||iio|i\}}n||fS(sgo through the packages in the transaction set, find them in the
           packageSack or rpmdb, and pack up the ts accordinglyt
preresolvetpostresolvetrescodetrestringN(RRCRLtresolveDepsRRRTtchanged(RRR((R
tbuildTransactions
cCsx|iid|ii|id}|oti|n|i	i
p|i|in|iiddS(s6takes an rpm callback object, performs the transactiontpretranstt	posttransN(
RRCRLRYtcbRiterrorsR1RPRt	keepcachetcleanHeaderst
cleanPackages(RRR((R
trunTransactions

cCs|p|ii}d}n|i}|i}t|djodSn|p|i	ddn|i	dd|i
t|ii
||dd\}}}x6||D]*}|i	dd	||ii|qW|i	dd
dS(sremoves packages from packageSacks based on global exclude lists,
           command line excludes and per-repository excludes, takes optional 
           repo object to use.iNis)Excluding Packages in global exclude listsExcluding Packages from %st	casematchiisExcluding %stFinished(RfRRRrtexcludelistRbtrepoidRjRdR
tnamet
parsePackagesRptreturnPackagest
exactmatchtmatchedt	unmatchedtpot
delPackage(RRfRRRRRR((R
Rys"
		*c	Cs|i}t|djodSn|ii|i}t	||dd\}}}|i
dd|ig}xG|D]?}|||jo|i
dd|q{q{|i|q{Wx2|D]*}|i
dd	||ii|qW|i
dd
dS(szremoves packages from packageSacks based on list of packages, to include.
           takes repoid as a mandatory argument.iNRiis%Reducing %s to included packages onlyisKeeping included package %ssRemoving unmatched package %sR(RftincludepkgstincludelistRdRRpRRjRRRRRR
RtrmlistRR5R(	RRfRRRRRRR((R
R{s&	cCsL|iidjodSn|ii}|d|}tii|}t	ti
}x|i||dpt
|d}yt|i}Wn tj
o|i|q\Xyti|dWnVtj
oJ}|dtijo|i|qCd|}tid|q\Xd|}tid|q\WdS(	sAperform the yum locking, raise yum-based exceptions, not OSErrorsiNR!itrs#Unable to check if PID %s is activeis4Existing lock %s: another copy is running. Aborting.(RRtuidR<R%tlockfileR9R:tnormpathRntgetpidtmypidt_locktopentfdtinttreadlinetoldpidt
ValueErrort_unlocktkilltOSErrorR4terrnotESRCHRR1t	LockError(RRRR%RRRR4((R
tdoLocks.

cCsF|iidjodSn|ii}|d|}|i|dS(sdo the unlock for yumiNR!(RRRR<R%RR(RRR%((R
tdoUnlocksRicCstii|}yTtii|pti|ddnti|titi	Bti
B|}Wn6t
j
o*}|itijp
|ndSn#Xti||ti|dSdS(Ntmodeiii(R9R:tdirnametfilenametlockdirR;tmakedirsRtO_EXCLtO_CREATtO_WRONLYRRRRRtEEXISTtwritetcontentstclose(RRRRRRR((R
Rs*
	
cCs-yti|Wntj
o	}nXdS(N(R9tunlinkRRR(RRR((R
R scCst|tijo
|i}nx2|iD]'\}}}	|	o|}
|}Pq-q-Wy|i
|||
Wn'tj
o}|oqdSnXt|i|}|i|ijo"|otddqdSndS(sverifies the package is what we expect it to be
           raiseError  = defaults to 0 - if 1 then will raise
           a URLGrabError if the file does not check out.
           otherwise it returns false for a failure, true for successiis(Package does not match intended downloadiN(ttypetfoRItInstanceTypeRRt	checksumstcsumtypetcsumtcsumidtchecksumtchecksumTypeRtverifyChecksumtURLGrabErrorR4t
raiseErrortYumLocalPackageRNtylptpkgtup(RRRRR4RRRRRR((R
t	verifyPkg's*

		cCsdyti||}Wn'tij
o}tddnX||jotddndS(sHVerify the checksum of the file versus the 
           provided checksumisCould not perform checksumisPackage does not match checksumiN(
tmiscRRRtfilesumR1t	MiscErrorR4RR(RRRRRR4((R
RGs
c
Csh}|iidd|t}g}
x|D]}	t	|	do|	i
djoq/n|	i}t
ii|ot
i|d}t|	i}y|i||	dd}Wntj
o}|ii|	i}
|
ioFt}d|
i}|i!|	pg||	<n||	i"|n||jot
i#|qqX|oq/q||jot
i#|qn|
i"|	|i$ip|o|o|Sq/q/Wd	}x0|
D](}	|d7}|ii|	i}
|	i&d
}|i|	dfhf}yhd|t)|
t
ii*|f}|	i}|
i,d|d|d
|d|d|
i-dj}WnMt/i0j
o>}|i!|	pg||	<n||	i"t1|qX||	_2|i!|	o||	=qqW|iidd|d||S(s~download list of package objects handed to you, output based on
           callback, raise yum.Errors.YumBaseError on problemstpredownloadRtpkgtypetlocaliRis4package fails checksum but caching is enabled for %sitrelativepaths(%s/%s): %strelativet	checkfuncR`RtnonetpostdownloadRN(3RRRCRLRR\trepo_cachedtremote_pkgsRRORtlocalPkgRR9R:R;tstattcursizeRtsizettotsizeRtresultRR4RtgetRepoRRfRRRjRthas_keyR5RRtitreturnSimpletremoteRRdtbasenameR`tgetthttp_cachingtmylocalR1R2Rnt	localpath(RRRiR`RRRRRRRfRRRR	RRRR4((R
tdownloadPkgsVsp 





%	cCst|tijo
|i}nyti|}|d}Wn:ti	t
fj
o%|otddq}dSnXt
|}|i|ijo"|otddqdSndS(s/check the header out via it's naevr, internallyiisHeader is not complete.s'Header does not match intended downloadiN(RRRIRRtrpmtreadHeaderListFromFilethlistthdrterrort
IndexErrorRRtYumInstalledPackagetyipRR(RRRRRRR((R
tverifyHeaders 
	c
Cs
t|do|idjodSnh}|i}|id}|id}|i
i|i}|id}
tii|ony|i||dd}	Wn>tj
o2}yti|Wqtj
o	}qXqX||_dSn"|iiotid	|
n|io|ii|inya|i|dfhf}|i!d
|
d|d|ddd
|d|ddd|i#dj}WnVtij
oG}|}yti|Wn!tj
o}ti|qXnX||_dSdS(swdownload a header from a package object.
           output based on callback, raise yum.Errors.YumBaseError on problemsRRNthdrstartthdrendRRisKHeader not in local cache and caching-only mode enabled. Cannot download %sRtstarttregettendRt
copy_localRR(%RORRRtlocalHdrRR
RRRRRRRfRR9R:R;RRRR4RRthdrpathRRR1R2t
dsCallbacktdownloadHeaderRRR
RbRtsaved_repo_error(
RRRRR%R"RfRRRRRR4((R
R$sJ 
	

	c	Cst|do&|idjo|ii}d}n*|ii	|i
}|i}|i}|ot
ii|i|i}tii|i}|djod}d}qu|djo%|o
d}nd}d|}qu|djod}d|}qu|d	jo+|o
d}nd}d}d
|}qu|djod}d|}qun
d}d}||fS(s^Take a package object and attempt to verify GPG signature if required

        Returns (result, error_string) where result is
            0 - GPG signature verifies ok or verification is not required
            1 - GPG verification failed but installation of the right GPG key might help
            2 - Fatal GPG verifcation error, give up
        RRiRiis"Public key for %s is not installedsProblem opening package %sis Public key for %s is not trustedisPackage %s is not signedN(RORRRRtgpgchecktcheckt	hasgpgkeyRRRRftgpgkeyRQt	miscutilstcheckSigRNRt	sigresultR9R:RtlocalfnRR(	RRR,R(R-R'RfRR((R
tsigCheckPkgsB 
	







c	Csg}d}d}x?|iiD].}|i|i}t
i|||}q"Wxl|D]d}yt
i|Wn,tj
o }|idd|q[q[X|idd||d7}q[Wd|}d|gfS(NRisCannot remove header %sisHeader %s removedis%d headers removed(tfilelisttexttremovedRRRcRfRlthdrdirR:RtgetFileListRR9RRR4RR
R(	RR4RR/RfR0RR:R1((R
R&s&
	
c	Csg}d}d}x?|iiD].}|i|i}t
i|||}q"Wxl|D]d}yt
i|Wn,tj
o }|idd|q[q[X|idd||d7}q[Wd|}d|gfS(NRisCannot remove package %sisPackage %s removedis%d packages removed(R/R0R1RRRcRfRltpkgdirR:RR3tpkgR9RRR4RR
R(	RR4R/RfR0R5RR:R1((R
R<s&
	
c	Csg}d}d}x?|iiD].}|i|i}t
i|||}q"Wxl|D]d}yt
i|Wn,tj
o }|idd|q[q[X|idd||d7}q[Wd|}d|gfS(NtpickleisCannot remove cache file %sisCache file %s removedis%d cache files removed(R/R0R1RRRcRfRltcachedirR:RR3titemR9RRR4RR
R(	RR4R/RfR8R0RR:R1((R
tcleanPicklesRs&
	
c	Csg}d}d}x?|iiD].}|i|i}t
i|||}q"Wxl|D]d}yt
i|Wn,tj
o }|idd|q[q[X|idd||d7}q[Wd|}d|gfS(NR	is"Cannot remove sqlite cache file %sisCache file %s removedis%d cache files removed(R/R0R1RRRcRfRlR7R:RR3R8R9RRR4RR
R(	RR4R/RfR8R0RR:R1((R
tcleanSqlitegs&
	
c
Csg}dddg}d}xP|D]H}x?|iiD].}|i|i	}ti|||}q8Wq"Wxl|D]d}yti|Wn,tj
o }	|idd|ququX|idd||d7}quWd	|}d|gfS(
Nsxml.gztxmltcachecookieisCannot remove metadata file %sismetadata file %s removedis%d metadata files removed(R/textsR1R0RRRcRfRlR7R:RR3R8R9RRR4RR
R(
RR=R/RfR8R0RR:R1R4((R
t
cleanMetadata|s*
	
tallcCsti}g}g}g}g}
g}g}g}|djo|i|i
|ii}x0|iiD]}t|}|i|qvW|iio|ii}n|ii}x|D]H}|i|i|i|i |i!f}||jo|i|qqWn|djo|i|i
|i#xc|i$i%D]\}}}}}|ii+d|d|d|d|d|}t-|djo-|i|d	|i.d
d|d	qZt-|djo|i|d	qZ|i.d
d|||||fqZWn|d
joA|i
xg|iiD]}t|}|i|qVWn4|djo|i|i
|ii}|iio|ii}n|ii}x|D]H}|i|i|i|i |i!f}||jo|i|qqWn~|djon|i|i
|ii/}xJ|iiD]3}t|}|i"|jo|i|qsqsWn|djo|i|i
d|i_|i#x|i$i0D]\}}|\}}}}}|ii+d|d|d|d|d|}
|ii3|d	}t|}x.|
D]&}|
i||i||fqlWqWn|djot5i5}||iid}h}|i|iio|ii}n|ii}xf|D]^}t9|i:d}	|	|jo6|i<|	p|g||	<qo||	i|qqWx:|i=D](}x||D]}|i|qWqWn||_||_||_|
|_||_||_||_	|S(sBgenerates lists of packages, un-reduced, based on pkgnarrow optionR?R}RRttepochtvertreliiis,More than one identical match in sack for %ss*Nothing matches %s.%s %s:%s-%s from updatet	installedt	availabletextrasRtrecentiQtfiletimeN(?Rt
GenericHoldertyghRCRDR}RtobsoletesTuplesRFREt	pkgnarrowRRRRVRtinstt
getHdrListRRRR5RtshowdupesfromreposRpRtavailtreturnNewestByNameArchR5RRtR@tversiontreleaseRRRZtgetUpdatesListtntaR4tvRtsearchNevratmatchesRdR
RtgetObsoletesTuplestinstTuptpkgstreturnHeaderByTupletinstpottimetnowtrecentlimitt	ftimehashRR
tftimeRtkeystsometime(RRKRRCRdR5R_RORRbRR`RR[RDRXRJRLR}RIRFRUR4RRaR]RTRERVRZ((R
tdoPackageListss



$




+





$







-





							cCs9tid|oti|}nti|}|S(sqTakes a search string from the cli for Search or Provides
           and cleans it up so it doesn't make us vomits.*[\*,\[,\],\{,\},\?,\+].*N(tretmatchtargtfnmatcht	translateRtescape(RRhR((R
t_refineSearchPatterns
cCs5h}|i|i|ii}	t|	|\}}}t|djo|i
dd|nti||}x|D]}
h||
<|
id}|i||
}xq|D]i}|\}
}}|
idoqng}x*|i|
||D]}|i|qW|||<qWqW|S(sReturn the dependencies for a given package, as well
           possible solutions for those dependencies.
           
           Returns the deps as a dict  of:
             packageobject = [reqs] = [list of satisfying pkgs]isNo Match for arguments: %strequiressrpmlib(N(tresultsRRRRpRRORR[RRRRdRRtuniqueR5t
returnPrcotreqstsortt
pkgresultstreqRtfRVt
startswitht
satisfierstwhatProvidesRR5(RR[RsRtRuRVRnRRqRORRRwR5RR((R
tfindDeps#s4




ccs$|ix|D]}|i|}yti|dti}	Wn(t
ij
o}t
id|nXx|iD]u}
g}xE|D]=}|
i|}|o!|	i|o|i|qqWt|djo|
|fVqwqwWqW|ix|iiD]}t|}
g}x|D]}|i|}yti|dti}	Wn(t
ij
o}t
id|nXxk|D]c}|
i|}t|ti jot!|}n|o!|	i|o|i|qqWq-Wt|djo|
|fVqqWdS(ssGenerator method to lighten memory load for some searches.
           This is the preferred search function to use.tflagss8Search Expression: %s is an invalid Regular Expression.
iN("RRtcriteriatstringRlRRfRtItcrit_ret
sre_constantsRR4R1RRpRt	tmpvaluestfieldstfieldR
RtsearchR5RdRRVRMRRRRItListTypeRn(RRR{R4R|RRRRR~RR((R
tsearchGeneratorKsP


cCszh}|i||}x[|D]S\}}|o|||n|i	|pg||<n||i
|qW|S(sSearch specified fields for matches to criteria
           optional callback specified to print out results
           as you go. Callback is a simple function of:
           callback(po, matched values list). It will 
           just return a dict of dict[po]=matched values listN(RXRRRR{t	match_genRtmatched_stringsRiRtextend(RRR{RiRRRXR((R
tsearchPackageszsc	Cs,|ih}x}|D]u}	|idd|i|	}xM|D]E}|i	|oqCn|	g||<|o|||	gqCqCWqW|iddxr|D]j}	d}dddg}x7|D]/}ti|}|i|	o
d}qqW|p|iqqWxd|D]\}	|i}t|id	oGtid
|	p0|idd|	|ii|	dd
}qn|iddt||idd|	|i|	}|idd|yti|dti}Wn(tij
o}ti d|	nXxX|D]P}|idd|g}|iddxR|i"D]D}x;|i$d|D]'}
|i&|
o|i'|
qzqzWqaW|iddxk|i(dD]Z\}
}\}}}|i&|
o2|i.|
||||ff}|i'|qqWt|djo:|i	|p&|||<|o|||qpqtq$q$WqW|i0dddg}g}xq|D]i}	|i|	}yti|dti}Wn(tij
o}ti d|	nX|i'|qWx|i3i4D]}t6|}g}g}xe|D]]}|i9|}|djoqDnt<|t=i>jo|i?|qD|i'|qDWx@|D]8}x/|D]'}|i&|o|i'|qqWqW~t|djo&|o|||n|||<qqW|S(Nissearching the simple ways#fully populating the necessary datais	.*bin\/.*s.*\/etc\/.*s^\/usr\/lib\/sendmail$it	searchAlls.*[\*,\[,\],\{,\},\?,\+,\%].*sUsing the like search on %st
query_typetlikesSearching %d packagess$refining the search expression of %ssrefined search: %sRzs8Search Expression: %s is an invalid Regular Expression.
issearching package %sssearching in file entriestftypessearching in provides entriestprovidest	filenamestdirnames(ARRRXtargsRhR
treturnPackagesByDepR[RRRiRtglobsR?RfRtglobcRgRRptwhereRORRdRlRR}targ_reRRR4R1RRtreturnFileTypestfiletypetreturnFileEntriesR$RR5Rptp_nametp_flagtp_etp_vtp_rt
prcoPrintabletprovRttaglisttregRVRMRRt
searchlistttagR
ttagdataRbRRIRRR8(RRRiRRRRRRRhR$RR8RR[RRRXRR?RRRRR4RRRRRR((R
tsearchPackageProvidess

	 
!
!

cCsg}g}x|iiD]z}|io7|o|io|i|q\q|i|q|o|io|i|qq|i|qW||fS(sreturns two lists of groups, installed groups and available groups
           optional 'uservisible' bool to tell it whether or not to return
           only groups marked as uservisibleN(	RCRDRR[tgroupstgrptuservisibletuser_visibleR5(RRRDRRC((R
tdoGroupListss



cCsg}|i|ii|}|ptid|nt	|_
|i}xT|iD]I}|id|}|i|x!|D]}|ii|iqWqYW|S(s1mark all the packages in this group to be removedsNo Group named %s existsRN(ttxmbrs_usedRRR[treturn_grouptgrpidt	thisgroupR1RRttoremovetpackagesR[R5tremovettxmbrsRttxmbrRR5tgroupid(RRRRRR[RR5((R
tgroupRemove!s 
		

cCs|i|ii|}|ptid|nt|_	|i
}x|i
D]}x|i
D]}|ii|jo|iitjo~y|ii|Wn3tj
o'|idd|i|fqcnXt|idjo|i
i|iiq
qcqcWqSWdS(s3unmark any packages in the group from being removedsNo Group named %s existsis%package %s was not marked in group %siN(RRR[RRRR1RR\RRR[R5RTRRRtstatetTS_INSTALL_STATESRRRR
RdR(RRRR[RR5((R
t
groupUnremove5s&
		

&cCslg}|ip|in|ii|ptid|n|ii|}|ptid|n|i
o|Snt|_
|ii
|ii
}x|D]}
|idd|
|ify|id|
}Wn,tij
o}|idd|
qX|i|x!|D]}|ii|iq,WqW|iiox|iiD]\}	}|i!|ojy|id|	}Wntij
o
qjnX|i|x!|D]}|ii|iqWqjn|i"i#d|	}|o|i$|}n|i%i&i'|o|i%i&|i|qj||i%i&|<qjWn|S(smark all the packages in the group to be installed
           returns a list of transaction members it added to the transaction 
           setsNo Group named %s existsisAdding package %s from group %sRis-No package named %s available to be installedN((RRR[Rt	has_groupRR1RRRtselectedRtmandatory_packagesRctdefault_packagesR[R5R
RtinstallRtInstallErrorR4RRRR5RRtconditional_packagest	iteritemstcondreqtcondt_isPackageInstalledRpRWtbestPackagesFromListRTtconditionalsR(RRR4RRRRR[RRR5((R
tselectGroupNsX

	


cCsE|ip|in|ii|ptid|n|ii|}|ptid|nt	|_
x|iD]}x|i
D]}|ii|jo|iitjo~y|ii|Wn3tj
o'|idd|i|fqnXt|idjo|i
i|iiq9qqWqWdS(s1de-mark all the packages in the group for installsNo Group named %s existsis%package %s was not marked in group %siN(RR[RRRR1RRRR\RRtpkgnameRTRRRRRRRRR
RdR(RRRRR((R
t
deselectGroups*
	

&c
Cs|\}}}}}x)|iD]}|i|jo|SqqW|i	i
|}t|djot
idt|dSnt|djo|d}	n|d}	|	S(sretrieves a packageObject from a pkgtuple - if we need
           to pick and choose which one is best we better call out
           to some method from here to pick the best pkgobj if there are
           more than one response - right now it's more rudimentary.is2Package tuple %s could not be found in packagesackiN(RRTRUR4RVRRRRRptpackagesByTupleR[RdR1tDepErrorRnRbR(
RRRUR4RTR[RVRRR((R
tgetPackageObjects

cCs,|ii|}|d}t|}|S(s;returns a YumInstallPackage object for the pkgtup specifiediN(RRVR\RthdrsRRR(RRRRR((R
tgetInstalledPackageObjects

cCs|iid}tii|odSntii	d|ii
}|it
it
iB|idd}|i}~~|djodSnWtii|}tii|pti|nt|d}|i~dSdS(	sbchecks for the presence of gpg keys in the rpmdb
           returns 0 if no keys returns 1 if keyss/.gpgkeyschecked.yumiR%Rs
gpg-pubkeyitwN(RRR7tgpgkeyscheckedR9R:R;RQRRRSR<tmytstpushVSFlagsRt_RPMVSF_NOSIGNATURESt_RPMVSF_NODIGESTStdbMatchtidxtcountRcRtmydirRRRR(RRRcRRRR((R
tgpgKeyChecks&

c	Csg}|i|}d}d}|ddjoti	d|oky|i
\}}}Wn!tj
o}tidnXti|ptidnt|}qn|i|||}|i}|S(s~Pass in a generic [build]require string and this function will 
           pass back the packages it finds providing that dep.iR!s[>=<]s4Invalid versioned dependency string, try quoting it.sInvalid version flagN(RnRRt	depstringtdepnameRbtdepflagstdepverRfRtsplitt
flagsymbolRR4R1RPtSYMBOLFLAGSRRxtsackR(	RRR4RnRRRRR((R
Rs$
cCsry|i|}Wn(tij
o}tid|nX|i|}|djotid|n|S(sPass in a generic [build]require string and this function will 
           pass back the best(or first) package it finds providing that dep.sNo Package found for %sN(
RRRRR1RPR4t_bestPackageFromListRRb(RRR4RR((R
treturnPackageByDeps
c
Csg}|i|}d}d}|ddjoti	d|oky|i
\}}	}Wn!tj
o}tidnXti|	ptidnt|	}qn|ii|||}x$|D]}|i|i|qW|S(sPass in a generic [build]require string and this function will 
           pass back the installed packages it finds providing that dep.iR!s[>=<]s4Invalid versioned dependency string, try quoting it.sInvalid version flagN(RnRRRRRbRRRfRRRRR4R1RPRRRVRxRRR5R(
RRR4RRnRRRRR((R
treturnInstalledPackagesByDeps(
cCst|djodSnt|djo|dSnt}|i||i}|d}x|dD]}t|i
t|i
jo
|}qqn't|i
t|i
joqqntii
|i|ig}||ijo
|}qqqqqqW|S(stake list of package objects and return the best package object.
           If the list is empty, return None. 
           
           Note: this is not aware of multilib so make sure you're only
           passing it packages of a single arch group.iiN(RdRRbtListPackageSacktmysacktaddListRPtbestlisttbestR5RRQRttgetBestArchFromList(RRRR5RtRR((R
R4s*	

c	Csg}tii|}g}g}x\|D]T}|i|joq+q+tii	d|io|i
|q+|i
|q+WxA||gD]3}|i|}|dj	o|i
|qqW|S(sTakes a list of packages, returns the best packages.
           This function is multilib aware so that it will not compare
           multilib to singlelib packagesRtN(t
returnlistRQRtRutcompatArchListtmultiLibt	singleLibRRtisMultiLibArchR5RRRRb(	RRRtRRRRRR((R
RVs$

cKs|i|i|i|ig}|oAt|tpt|t	o|i
|qYtidn|iptidn|idoLt|ii|dgdd\}}
}|i||i|
nk|i|}	|iid|	dd|	dd|	dd	|	d
d|	d}|o|i|}nt|d
jotidng}x|D]}|iid|io:|i dd||i|ii!d|iqn|i"i#i|io&|i$d|}|i|qn|i&i'd|i(d|i)d|i*d|i+d	|i,o|i-dd|qn|ii.|}|i
|qW|S(stry to mark for install the item specified. Uses provided package 
           object, if available. If not it uses the kwargs and gets the best
           packages from the keyword options provided 
           returns the list of txmbr of the items it installs
           
           s0Package Object was not a package object instancesNothing specified to installtpatternRiRR@RtRARQRBRRis"No package(s) available to installRis)Package: %s  - already in transaction setRis/Package %s already installed and latest versionN(0RRRRRR[Rt
isinstancetYumAvailablePackageRR5R1RtkwargsRcRRRpRRRRRt_nevra_kwarg_parset
nevra_dictRWRRdt	tx_returnRTR;RR
t
getMembersRZt
updating_dicttupdateRRVRCRRtR@RBRARt
addInstallR(RRRRRRRRR[RR((R
RrsT



 
.

$cKs|i|i|i|i|ii}|ii	o|ii
dd}
ng}
g}|o;|io-|iddxz|
D]r\}	}|i|	}|ii|d}t|}|ii||}|ii|||i|qWx|D]\}}|ii d|o|idd|q|i|}|ii|d}t|}|ii#||}|i|qW|Sng}g}|o2|i&djo|i|q|i|n|i'|}|i)i*d	|d	d
|d
d|dd|d
d|d}|ii+d	|d	d
|d
d|dd|d
d|d}x=|D]5}
|ii|
d}t|}|i|qWx|D]}|ii.i/|i0ol|ii	o_|ii.|i0d}	|i|	}|ii||}|ii|||i|qqWx|D]}|ii2i/|i0o|ii2|i0d}|ii |o|idd|q|ii|d}t|}|ii#||}|i|q_q_Wx|D]}|ii4i/|i0o}|ii4|i0d}|i|}|ii |i0o|idd|i0q|ii#||}|i|qqW|S(sutry to mark for update the item(s) specified. 
            po is a package object - if that is there, mark it for update,
            if possible
            else use **kwargs to match the package needing update
            if nothing is specified at all then attempt to update everything
            
            returns the list of txmbr of the items it marked for updatetnewestiisUpdating EverythingiRs>Not Updating Package that is already obsoleted: %s.%s %s:%s-%sRCRR@RtRARQRBRRN(6RRRRRRZtgetUpdatesTuplesR}RRRYRRRRcR
t
obsoletingRCRtobsoleting_pkgRVR\RRt
installed_pkgRTt
addObsoletingRtaddObsoletedR5tnewtoldtisObsoletedtupdating_pkgtupdated_pkgt	addUpdatetinstpkgst	availpkgsRRRRpRWtreturnTupleByKeywordtinstalled_tuplesttuptobsoleted_dictRRt
available_pkgRtupdatedtupdatesdicttupdating(RRRRR	RCRRRRRRRRRRRR}RRRRRR((R
Rs





&cKs;|o|iotidn|ig}g}|o
|g}n|i	|}	|iid|	dd|	dd|	dd|	dd|	d}
x=|
D]5}|ii|d	}t|}|i|qWt|d	jo|id
dnx-|D]%}|ii|}|i|qW|S(
stry to find and mark for remove the specified package(s) -
            if po is specified then that package object (if it is installed) 
            will be marked for removal.
            if no po then look at kwargs, if neither then raise an exceptionsNothing specified to removeRR@RtRARQRBRRiisNo package matched to removeN(RRRcR1tRemoveErrorRRRR[RRRVR
RRR\RRRR5RdRRTtaddEraseR(RRRRRRRRR[RR((R
R9s0

cCsh}y|d|d<Wntj
od|d<nXy|d|d<Wntj
od|d<nXy|d|d<Wntj
od|d<nXy|d|d<Wntj
od|d<nX|ddjo6y|d|d<Wqtj
od|d<qXny|d|d<Wntj
od|d<nX|ddjo2y|d}Wqtj
od|d<qXn|S(NRR@RtRQRARRRB(t
returndictRtKeyErrorRbRR(RRRRR((R
R_s@cCst}|iid|o
t}n|iid|}x&|D]}|i
tjotSqBqBW|ot|djotSn|S(NRi(
R\RCRRVRRRTt
matchNaevrtlstRtoutput_stateRRd(RRRCRR((R
R|s
(At__name__t
__module__t__doc__RRR
RRR RR'RRbRMRRR^RRRRRRRRyR{RRRRRRRRR$R.RRR9R:R>ReRlRyRRRRRRRRRRRRRRRRRRRRR(((R
R5s|						0				.!	 	/			 		!			 	P		3	5							(	/y			9							!	"J}&	(&R9Rtos.pathRRfRiRIRR^RR?R1RQtrpmUtils.updatest
rpmUtils.archR[R"R7RRRturlgrabber.grabberRRRCRRRRRtrepomdRt	constantstrepomd.packageSackRt__version__RR(R1RR7RRRCRRRRRRfRRRR#R"RR?RRR[RIRR^RiRQR9R((R
t?s:																					
		



Anon7 - 2021