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/rpmUtils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/rpmUtils/miscutils.pyc
mň
ýÉODc@sÁdkZdkZdkZdkZdkZdkZdkZdkZd„Z	d„Z
d„Zd„Zd„Z
d„Zd„Zd„Zeid	d
„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
cCsb|d}|d}|d}|d}|d}|djo
d}n|||||f}|S(s^return a pkgtuple (n, a, e, v, r) from a hdr object, converts
       None epoch to 0, as well.tnametarchtversiontreleasetepocht0N(RR3R4tvertrelR7R(tpkgtuple(RR9R7R;R:R4R3((RtpkgTupleFromHeaderms






c
CsH|\}}\}}}|\}}}}
}	||jodSn|djo
d}	n|djo
d}n|djo
d}
nt
||
|	f|||fƒ}|djo%|ddddgjodSqÚn|djo+|dddd	d
dgjodSqn|djo%|ddd
d
gjodSqDndS(sureturns true if the package epoch-ver-rel satisfy the range
       requested in the reqtuple:
       ex: foo >= 2.1-1iitGTtGEiitLEtEQii
i˙˙˙˙tLTiN(treqtupletreqntreqftreqetreqvtreqrR;tntaRtvtrR(RR(
RBR;RIRRFRRGRHRCRKRJRERD((Rt
rangeCheck|s,






!


cCsUt|ƒ}|djogSnh}yx|D]}d||<q1WWntj
o
~nX|iƒSyt|ƒ}|i	ƒWntj
o
~n‚X|djpt
‚|d}d}}xM||jo?|||jo ||||<}|d7}n|d7}qÇW|| Sg}x,|D]$}||jo|i|ƒq)q)W|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(tlentsRHtutxt	TypeErrortkeystlisttttsorttAssertionErrortlasttlastititappend(RNRWRYRXRHRORTRP((Rtunique¤sB

	



c
Csä|ddjo|d }nti|dƒ}||d}ti|| dƒ}	||	d|!}ti||	 dƒ}||d|	!}ti	|dƒ}|djo
d}n|| }||d|!}|||||fS(
sÖpass in a standard style rpm fullname and it returns
    a name, version, release, epoch, arch
    aka  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(
tfilenameR,trfindt	archIndexR4trelIndexR:tverIndexR9tfindt
epochIndexR7R3(
R`RdR9R3R7RfRbR:R4Rc((Rt
splitFilenameés


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"trbiR_N(trpmUtilsttransactiontinitReadOnlyTransactionRRRRR
tRPMTAG_PAYLOADCOMPRESSORtcomprt
RpmUtilsErrorRhtGzipFileR(RtfdopentbufsizetftreadttmptouttwriteR"(RRvRrRuRRsRRn((Rtrpm2cpios
'
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(R3RNtflagsR
t
RPMSENSE_LESStRPMSENSE_GREATERtRPMSENSE_EQUALR5(R3R5R}RN((Rt
formatRequires
cCs|djodSnti|dƒ}|djo7yti|| ƒ}Wqqtj
o
d}qqXnd}ti|dƒ}|djoE||d|!djo
d}n||d|!}||d}n4||ddjo
d}n||d}d}|||fS(NR^i˙˙˙˙R8R]iR_(NNN(t	verstringR(R,ReRYtatolR7t
ValueErrortjR5R6(R‚RYR…R7R5R6((RtstringToVersion.s(




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#RRjRoRRRR
RR"R(RRRRR((RthdrFromPackageIs


(R,R
RRhRtsysR)trpmUtils.transactionRjRRR$R R<RLR[RgtstdoutRxRR†R‡(RR‡R†R,R$R)R
RLRRˆR<RxRRhR RjR[RRgR((Rt?s&											'			(	E			

Anon7 - 2021