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/misc.pyo
m
ODc@sdkZdkZdkZdkZdklZdkZdkZdkZdk	Z	dk
Z
dkZdkZdk
Z
dkTdkZdklZdZdddZdZd	fd
YZdZdZd
ZdZddZdZdS(N(sStringIO(t*(s	MiscErrorcCsAt|}|djogSnh}yx|D]}d||<q1WWntj
o
~nX|iSyt|}|i	Wntj
o
~nnX|d}d}}xM||jo?|||jo ||||<}|d7}n|d7}qW|| 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(tlentstntutxt	TypeErrortkeystlisttttsorttlasttlastititappend(RRR
RRRR	R((t,/usr/lib/python2.4/site-packages/yum/misc.pytuniquesB

	



iic	Cs#yt|tij	o
|}nt|d|}|djodk}|i	}n4|djodk}|i	}ntd||i
}x(|o |i
|}|i|qWt|tijo|i~n|iSWn(ttfj
o}td|nXdS(stakes filename, hand back Checksum of it
       sumtype = md5 or sha
       filename = /path/to/file
       CHUNK=65536 by defaulttrtmd5Ntshas-Error Checksumming file, bad checksum type %ss#Error opening file for checksum: %s(ttypetfilettypest
StringTypetfotopentCHUNKtsumtypeRtnewtsumRt	MiscErrortreadtchunktupdatetcloset	hexdigesttIOErrortOSErrorte(	RRRR&R RRRR((Rtchecksum\s.

	
	
	
cCst|}yti|}Wn(tj
o}t	d||fnXx|D]}tii|d|ot|d|||}qQti||d|jo+tii|d|}|i|qQqQW|S(sfReturn all files in path matching ext, store them in filelist, 
       recurse dirs return list objects Error accessing directory %s, %st/s%sN(Rtexttextlentostlistdirtpathtdir_listR%R&RtdtisdirtgetFileListtfilelisttstringtlowertnormpathtnewpathR(R-R)R2R*R6R&R/R.((RR1~st
GenericHoldercBstZdZdZRS(sGeneric 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 itcCs.t||ot||Sn
t|dS(N(thasattrtselftitemtgetattrtKeyError(R9R:((Rt__getitem__s(t__name__t
__module__t__doc__R=(((RR7scCstidid|}t}d}d}x|idD]}|i
do
d}q@|o|idjo
d}q@|o|i
doPq@|o|i
doPq@|o|i|dq@q@Wt
i|iS(
s-Convert ASCII armoured GPG key to binary
    s(
|
|
)s
is$-----BEGIN PGP PUBLIC KEY BLOCK-----its"-----END PGP PUBLIC KEY BLOCK-----t=N(tretcompiletsubtrawkeytStringIOtblocktinblocktpastheaderstsplittlinet
startswithtstriptwritetbase64tdecodestringtgetvalue(RFRJRIRLRH((Rt
procgpgkeys$	

cCs<yti|}Wn'tj
o}tt|nX|d	jotdn|i	i
}hd|i<dt
id|d<d|i	i<}x|idD]}t|tipqn|i
|joPt|do<|iti}|d	jot|d|d<Pq0q4qqW|S(
sReturn a dict of info for the given ASCII armoured key text

    Returned dict will have the following keys: 'userid', 'keyid', 'timestamp'

    Will raise ValueError if there was a problem decoding the key.
    sNo key found in given key datatuseridtkeyids>Qit	timestampthashed_subpaksiN(tpgpmsgt
decode_msgRFtkeyt	ExceptionR&t
ValueErrortstrtNonet
public_keytkey_idt
keyid_blobtuser_idtstructtunpackRVtinfotuser_idsRTt
isinstancet	signatureR8tget_hashed_subpaktSIG_SUB_TYPE_CREATE_TIMEttspkttint(RFReR&RTRZRkRa((Rt
getgpgkeyinfos(
:
cCsd|d@S(s[Convert an integer representing a GPG key ID to the hex version string
    used by RPM
    s%08xlN(RU(RU((Rt
keyIdToRPMVerscCst|}xp|iddD]\}|d|joEt|dd}||jodSq{||jodSq{dSqqWd	S(sWReturn if the GPG key described by the given keyid and timestamp are
    installed in the rpmdb.  

    The keyid and timestamp should both be passed as integers.
    The ts is an rpm transaction set object

    Return values:
        -1      key is not installed
        0       key with matching ID and timestamp is installed
        1       key with matching ID is installed but has a older timestamp
        2       key with matching ID is installed but has a newer timestamp

    No effort is made to handle duplicates. The first matching keyid is used to 
    calculate the return result.
    tnames
gpg-pubkeytversiontreleaseiiiiiN(RnRUttstdbMatchthdrRltinstalledtsRV(RrRURVRtRu((RtkeyInstalleds

s/var/tmpc
Csti}yti|}|d}Wntj
odSnXd|}d||f}	ti|	}x^|D]V}ti|}t|do0t|ddjo|d|jo|SqsqsWtid|d|}|S(	sqreturn a path to a valid and safe cachedir - only used when not running
       as root or when --tempcache is setisyum-%s-s%s/%s*iitprefixtdirN(R+tgeteuidtuidtpwdtgetpwuidtusertuptusernameR<R^Rwttmpdirtdirpathtglobt	cachedirstthisdirtlstattstatstS_ISDIRtS_IMODEttempfiletmkdtemptcachedir(
RR~RRRzRwRRR}R((RtgetCacheDir
s"	
9cCs>|i|ijodSn |i|ijodSndSdS(s+sorts a list of yum package objects by nameiiiN(tpkg1Rotpkg2(RR((Rt
sortPkgObj#s(RR3R+tos.patht	cStringIORGRPRcRCRXRRtrpmR{tstattrpmUtilstErrorsRRR'R1R7RSRmRnRvRR(RvR1RSRRcRRPRCRRR3RR{RnRRRGR'RXR7RRmRR+((Rt?s2				
									
	D"			(		 

Anon7 - 2021