KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/rpmUtils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/rpmUtils/miscutils.pyo
mň
üüPc@sÜdkZdkZdkZdkZdkZdkZdkZdkZd„Z	d„Z
d„Zd„Zd„Z
d„Zd„Zd„Zd	„Zeid
d„Zd„Zd
„Zd„Zd„Zd„ZdS(NcCs*t|ƒtijot|ƒ}n|S(N(ttypetargttypest
StringTypetstr(R((t6/usr/lib/python2.4/site-packages/rpmUtils/miscutils.pytrpmOutToStrsc	CsŽ|\}}}|\}}}t|ƒ}t|ƒ}t|ƒ}t|ƒ}t|ƒ}t|ƒ}ti|||f|||fƒ}|S(N(
te1tv1tr1te2tv2tr2RtrpmtlabelComparetrc(	t.0t.2RRR	R
RRR((Rt
compareEVR$s$c	CsBd}|idƒ}ti|tiƒ}y|i	|ƒ}WnŒtij
o}}t|ƒdjo
d}nt|ƒdjo
d}nt|ƒdjo
d}nt|ƒdjo
d}qn>Xt|ƒ\}}|d	joti|ƒ~d
}n~yti|ƒWntj
o	}nX|i|ƒ|S(sTakes a transaction set and a package, check it's sigs, 
    return 0 if they are all fine
    return 1 if the gpg key can't be found
    return 2 if the header is in someway damaged
    return 3 if the key is not trusted 
    return 4 if the pkg is not gpg or pgp signedispublic key not availaiableispublic key not availablespublic key not trustediserror reading package headeriieiN(tvaluettst
setVSFlagstcurrentflagstostopentpackagetO_RDONLYtfdnothdrFromFdnothdrR
terrorteRt
getSigInfotsiginfotclosetOSError(	RRR!RRRRRR((RtcheckSig3s6






cCsˆtitidƒd}|i|ƒ}|djo"d}|idƒ\}}}nd}d}d}d}|||f}||fS(
sXchecks signature from an hdr hand back signature information and/or
       an error codetCsŽ%|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:{%|SIGGPG?{%{SIGGPG:pgpsig}}:{%|SIGPGP?{%{SIGPGP:pgpsig}}:{(none)}|}|}|}|s(none)it,ietMD5tNoneN(
tlocalet	setlocaletLC_ALLtstringRtsprintfR!Rtsplittsigtypetsigdatetsigidt	infotuple(RR!R1R2R/R0RR,((RR Zs
cCsŽ|d}|tip|tidjo|d}nd}|d}|d}|d}|d	jo
d}n|||||f}|S(
s^return a pkgtuple (n, a, e, v, r) from a hdr object, converts
       None epoch to 0, as well.tnameitarchtsrctversiontreleasetepocht0N(RR3R
tRPMTAG_SOURCERPMtRPMTAG_SOURCEPACKAGER4tvertrelR8R(tpkgtuple(RR<R8R>R=R4R3((RtpkgTupleFromHeaderms
"




cCs4|\}}}}}t||d|||ffƒS(sureturns true if the package epoch-ver-rel satisfy the range
       requested in the reqtuple:
       ex: foo >= 2.1-1tEQN(R>tntaRtvtrtrangeComparetreqtuple(RFR>RBRRARDRC((Rt
rangeCheck„sc
	Cs	|\}}\}}}|\}}\}}
}	||jodSn|djp
|djodSn|djo
d}	n|djo
d}n|djo
d}
n|	djo
d}nt
||
|	f|||fƒ}|djoW|ddddgjodSn|ddgjo|d	d
gjodSqDqHn|djo:|ddgjo%|ddddgjodSqn|ddgjo1|dddd	dddd
gjodSqŃn|ddgjo+|ddd	ddd
gjodSqn|d	d
gjo1|dd	dddd
ddgjodSqSn|ddgjo%|d	dd
dgjodSq‹qn|d
joi|ddddddgjo%|ddddgjodSqŕn|d	dd
dgjodSqndS(s,returns true if provtuple satisfies reqtupleiitGTtGEiiR@itLEi
tLTii˙˙˙˙N(RFtreqntreqftreqetreqvtreqrt	provtupleRAtfRRCRDR(RR(
RFRQRRRRORRPRARLRDRCRNRM((RREŽsZ








!

%%
cCsAt|ƒ}|djogSnh}yx|D]}d||<q1WWntj
o
~nX|iƒSyt|ƒ}|i	ƒWntj
o
~nnX|d}d}}xM||jo?|||jo ||||<}|d7}n|d7}qłW|| Sg}x,|D]$}||jo|i
|ƒqqW|S(sReturn a list of the elements in s, but without duplicates.

    For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],
    unique("abcabc") some permutation of ["a", "b", "c"], and
    unique(([1, 2], [2, 3], [1, 2])) some permutation of
    [[2, 3], [1, 2]].

    For best speed, all sequence elements should be hashable.  Then
    unique() will usually work in linear time.

    If not possible, the sequence elements should enjoy a total
    ordering, and if list(s).sort() doesn't raise TypeError it's
    assumed that they do enjoy a total ordering.  Then unique() will
    usually work in O(N*log2(N)) time.

    If that's not possible either, the sequence elements must support
    equality-testing.  Then unique() will usually work in quadratic
    time.
    iiN(tlentsRAtutxt	TypeErrortkeystlisttttsorttlasttlastititappend(RTR\R^R]RARURZRV((RtuniqueŮsB

	



c
CsŘ|ddjo|d }n|idƒ}||d}|| idƒ}	||	d|!}||	 idƒ}||d|	!}|idƒ}|djo
d}n|| }||d|!}|||||fS(
sß
    Pass in a standard style rpm fullname 
    
    Return a name, version, release, epoch, arch, e.g.::
        foo-1.0-1.i386.rpm returns foo, 1.0, 1, i386
        1:bar-9-123a.ia64.rpm returns bar, 9, 123a, 1, ia64
    iü˙˙˙s.rpmt.it-t:i˙˙˙˙tN(tfilenametrfindt	archIndexR4trelIndexR=tverIndexR<tfindt
epochIndexR8R3(
ReRiR<R3R8RkRgR=R4Rh((Rt
splitFilenames


icCsÁtiiƒ}|i|ƒ}~|tipd}|djoti
d|‚ntidddti|d|ƒƒ}x3|i|ƒ}|djoPn|i|ƒq€W|iƒdS(sŸPerforms roughly the equivalent of rpm2cpio(8).
       Reads the package from fdno, and dumps the cpio payload to out,
       using bufsize as the buffer size.tgzips$Unsupported payload compressor: "%s"trbiRdN(trpmUtilsttransactiontinitReadOnlyTransactionRRRRR
tRPMTAG_PAYLOADCOMPRESSORtcomprt
RpmUtilsErrorRmtGzipFileR(RtfdopentbufsizeRRtreadttmptouttwriteR"(RRzRwRyRRRRRs((Rtrpm2cpio=s
'
cCsŽ|}|o|titiBtiB@o}|d}|ti@o|d}n|ti@o|d}n|ti@o|d}n|od||f}qŚqŞn|S(Nt t<t>t=s%s %s(R3RTtflagsR
t
RPMSENSE_LESStRPMSENSE_GREATERtRPMSENSE_EQUALR6(R3R6RRT((Rt
formatRequireTs
cCsŒ|d@}|djodSnj|djodSnU|djodSn@|djodSn+|d	jod
Sn|djodSn|S(
NiiiRKiRHiR@i
RJiRI(RR((R((RtflagToStringes






cCs|ddgjodSn|idƒ}|djo:ytt|| ƒƒ}Wqwtj
o
d}qwXnd}|idƒ}|djoE||d|!djo
d}n||d|!}||d}n4||ddjo
d}n||d}d}|||fS(NRdRci˙˙˙˙R9Rbi(NNN(t	verstringR(RjR^RtlongR8t
ValueErrortjR6R7(R‡R^RŠR8R6R7((RtstringToVersionqs(



cCsČyti|tiƒ}Wn!tj
o}tid‚nXy|i
|ƒ}Wn1ti
j
o"}ti|ƒtid‚nXt|ƒtijoti|ƒtid‚nti|ƒ|S(s>hand back the rpm header or raise an Error if the pkg is fubarsUnable to open filesRPM Error opening PackageN(RRRRRR#RRoRtRRRR
RR"R(RRRRR((RthdrFromPackageŒs


cCsgttdƒoSttdƒoCtitititititigƒot	i
dƒqcndS(NtcheckSignalst
signalsCaughti(thasattrR
RŽtsignaltSIGINTtSIGTERMtSIGPIPEtSIGQUITtSIGHUPtsystexit(((RRĄs .(R
RRmRR–R)RtrpmUtils.transactionRoRRR$R R?RGRER`RltstdoutR|R…R†R‹RŒR(RR$R)R
R‹RR†R|R…RRGR–R`RlRRERRR?RmR RoRŒ((Rt?s,											'			
	K	E					

Anon7 - 2021