Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
rpmUtils
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/rpmUtils/miscutils.pyo
mò •F»Oc�����������@���sÜ���d��k��Z��d��k�Z�d��k�Z�d��k�Z�d��k�Z�d��k�Z�d��k�Z�d��k�Z�d�„��Z �d�„��Z �d�„��Z�d�„��Z�d�„��Z �d�„��Z�d�„��Z�d�„��Z�d �„��Z�e�i�d �d�„�Z�d�„��Z�d �„��Z�d�„��Z�d�„��Z�d�„��Z�d��S(���Nc���������C���s*���t��|��ƒ�t�i�j�o�t�|��ƒ�}��n�|��S(���N(���t���typet���argt���typest ���StringTypet���str(���R���(����(����t6���/usr/lib/python2.4/site-packages/rpmUtils/miscutils.pyt���rpmOutToStr���s����c��� ������C���sŽ���|��\�}�}�}�|�\�}�}�}�t�|�ƒ�}�t�|�ƒ�}�t�|�ƒ�}�t�|�ƒ�}�t�|�ƒ�}�t�|�ƒ�}�t�i�|�|�|�f�|�|�|�f�ƒ�}�|�S(���N( ���t���e1t���v1t���r1t���e2t���v2t���r2R���t���rpmt���labelComparet���rc( ���t���.0t���.2R���R���R ���R ���R���R���R���(����(����R���t ���compareEVR$���s���$c��� ������C���sB��d�}�|��i�d�ƒ�}�t�i�|�t�i�ƒ�}�y�|��i �|�ƒ�}�WnŒ�t�i�j �o}�}�t�|�ƒ�d�j�o �d�}�n�t�|�ƒ�d�j�o �d�}�n�t�|�ƒ�d�j�o �d�}�n�t�|�ƒ�d�j�o �d�}�qn>�Xt�|�ƒ�\�}�}�|�d �j�o�t�i�|�ƒ�~�d �}�n�~�y�t�i�|�ƒ�Wn�t�j �o �}�n�X|��i�|�ƒ�|�S(���s��Takes 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 signedi����s���public key not availaiablei���s���public key not availables���public key not trustedi���s���error reading package headeri���ie���i���N(���t���valuet���tst ���setVSFlagst���currentflagst���ost���opent���packaget���O_RDONLYt���fdnot���hdrFromFdnot���hdrR ���t���errort���eR���t ���getSigInfot���siginfot���closet���OSError( ���R���R���R!���R���R���R���R���R���R���(����(����R���t���checkSig3���s6����� c���������C���sˆ���t��i�t��i�d�ƒ�d�}�|��i�|�ƒ�}�|�d�j�o"�d�}�|�i�d�ƒ�\�}�}�}�n�d�}�d�}�d�}�d�}�|�|�|�f�}�|�|�f�S( ���sX���checks signature from an hdr hand back signature information and/or an error codet���CsŽ���%|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:{%|SIGGPG?{%{SIGGPG:pgpsig}}:{%|SIGPGP?{%{SIGPGP:pgpsig}}:{(none)}|}|}|}|s���(none)i����t���,ie���t���MD5t���NoneN( ���t���localet ���setlocalet���LC_ALLt���stringR���t���sprintfR!���R���t���splitt���sigtypet���sigdatet���sigidt ���infotuple(���R���R!���R1���R2���R/���R0���R���R,���(����(����R���R ���Z���s����� c���������C���sŽ���|��d�}�|��t�i�p�|��t�i�d�j�o�|��d�}�n�d�}�|��d�}�|��d�}�|��d�}�|�d �j�o �d�}�n�|�|�|�|�|�f�}�|�S( ���s^���return a pkgtuple (n, a, e, v, r) from a hdr object, converts None epoch to 0, as well.t���namei���t���archt���srct���versiont���releaset���epocht���0N(���R���R3���R ���t���RPMTAG_SOURCERPMt���RPMTAG_SOURCEPACKAGER4���t���vert���relR8���R(���t���pkgtuple(���R���R<���R8���R>���R=���R4���R3���(����(����R���t���pkgTupleFromHeaderm���s����� " c���������C���s4���|�\�}�}�}�}�}�t�|��|�d�|�|�|�f�f�ƒ�S(���su���returns true if the package epoch-ver-rel satisfy the range requested in the reqtuple: ex: foo >= 2.1-1t���EQN(���R>���t���nt���aR���t���vt���rt���rangeComparet���reqtuple(���RF���R>���RB���R���RA���RD���RC���(����(����R���t ���rangeCheck„���s�����c��� ��� ���C���s ��|��\�}�}�\�}�}�}�|�\�}�}�\�}�} �} �|�|�j�o�d�Sn�|�d�j�p �|�d�j�o�d�Sn�|�d�j�o �d�} �n�|�d�j�o �d�}�n�|�d�j�o �d�} �n�| �d�j�o �d�}�n�t �|�| �| �f�|�|�|�f�ƒ�}�|�d�j�oW�|�d�d�d�d�g�j�o�d�Sn�|�d�d�g�j�o�|�d �d �g�j�o�d�SqDqHn�|�d�j�o:|�d�d�g�j�o%�|�d�d�d�d�g�j�o�d�Sqn�|�d�d�g�j�o1�|�d�d�d�d �d�d�d�d �g�j�o�d�SqÑn�|�d�d�g�j�o+�|�d�d�d �d�d�d �g�j�o�d�Sqn�|�d �d �g�j�o1�|�d�d �d�d�d�d �d�d�g�j�o�d�SqSn�|�d�d�g�j�o%�|�d �d�d �d�g�j�o�d�Sq‹qn�|�d �j�oi�|�d�d�d�d�d�d�g�j�o%�|�d�d�d�d�g�j�o�d�Sqàn�|�d �d�d �d�g�j�o�d�Sqn�d�S(���s,���returns true if provtuple satisfies reqtuplei����i���t���GTt���GEi���i���R@���i���t���LEi ���t���LTi���iÿÿÿÿN(���RF���t���reqnt���reqft���reqet���reqvt���reqrt ���provtupleRA���t���fR���RC���RD���R(���R���R���( ���RF���RQ���R���RR���RO���R���RP���RA���RL���RD���RC���RN���RM���(����(����R���RE���Ž���sZ����� ! %% c���������C���sA��t��|��ƒ�}�|�d�j�o�g��Sn�h��}�y�x�|��D]�}�d�|�|�<q1�WWn�t�j �o �~�n�X|�i�ƒ��Sy�t�|��ƒ�}�|�i �ƒ��Wn�t�j �o �~�nn�X|�d�}�d�}�}�xM�|�|�j��o?�|�|�|�j�o �|�|�|�|�<}�|�d�7}�n�|�d�7}�q³�W|�|� Sg��}�x,�|��D]$�}�|�|�j�o�|�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. i����i���N(���t���lent���sRA���t���ut���xt ���TypeErrort���keyst���listt���tt���sortt���lastt���lastit���it���append(���RT���R\���R^���R]���RA���RU���RZ���RV���(����(����R���t���uniqueÙ���sB����� � � � � c��� ������C���sØ���|��d�d�j�o�|��d� }��n�|��i�d�ƒ�}�|��|�d�}�|��|� i�d�ƒ�} �|��| �d�|�!}�|��| � i�d�ƒ�}�|��|�d�| �!}�|��i�d�ƒ�}�|�d�j�o �d�}�n�|��|� }�|��|�d�|�!}�|�|�|�|�|�f�S( ���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���.i���t���-t���:iÿÿÿÿt����N(���t���filenamet���rfindt ���archIndexR4���t���relIndexR=���t���verIndexR<���t���findt ���epochIndexR8���R3���( ���Re���Ri���R<���R3���R8���Rk���Rg���R=���R4���Rh���(����(����R���t ���splitFilename��s����� i���c���������C���sÁ���t��i�i�ƒ��}�|�i�|��ƒ�}�~�|�t�i�p�d�}�|�d�j�o�t��i �d�|�‚�n�t�i�d�d�d�t�i�|��d�|�ƒ�ƒ�}�x3�|�i�|�ƒ�}�|�d�j�o�Pn�|�i�|�ƒ�q€�W|�i�ƒ��d�S(���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.t���gzips$���Unsupported payload compressor: "%s"t���rbi���Rd���N(���t���rpmUtilst���transactiont���initReadOnlyTransactionR���R���R���R���R ���t���RPMTAG_PAYLOADCOMPRESSORt���comprt ���RpmUtilsErrorRm���t���GzipFileR(���R���t���fdopent���bufsizeRR���t���readt���tmpt���outt���writeR"���(���R���Rz���Rw���Ry���R���RR���R���Rs���(����(����R���t���rpm2cpio=��s����� '�� �c���������C���s®���|��}�|�o�|�t�i�t�i�Bt�i�B@o}�|�d�}�|�t�i�@o�|�d�}�n�|�t�i�@o�|�d�}�n�|�t�i�@o�|�d�}�n�|�o�d�|�|�f�}�q¦�qª�n�|�S(���Nt��� t���<t���>t���=s���%s %s(���R3���RT���t���flagsR ���t ���RPMSENSE_LESSt���RPMSENSE_GREATERt���RPMSENSE_EQUALR6���(���R3���R6���R���RT���(����(����R���t ���formatRequireT��s���� c���������C���sŒ���|��d�@}��|��d�j�o�d��Snj�|��d�j�o�d�SnU�|��d�j�o�d�Sn@�|��d�j�o�d�Sn+�|��d �j�o�d �Sn�|��d�j�o�d�Sn�|��S( ���Ni���i����i���RK���i���RH���i���R@���i ���RJ���i���RI���(���R���R(���(���R���(����(����R���t���flagToStringe��s���� � � � � � �c���������C���s��|��d��d�g�j�o�d�Sn�|��i�d�ƒ�}�|�d�j�o:�y�t�t�|��|� ƒ�ƒ�}�Wqw�t�j �o �d�}�qw�Xn�d�}�|��i�d�ƒ�}�|�d�j�oE�|��|�d�|�!d�j�o �d��}�n�|��|�d�|�!}�|��|�d�}�n4�|��|�d�d�j�o �d��}�n�|��|�d�}�d��}�|�|�|�f�S(���NRd���Rc���iÿÿÿÿR9���Rb���i���(���NNN(���t ���verstringR(���Rj���R^���R���t���longR8���t ���ValueErrort���jR6���R7���(���R‡���R^���RŠ���R8���R6���R7���(����(����R���t���stringToVersionq��s(���� c���������C���sÈ���y�t��i�|�t��i�ƒ�}�Wn!�t�j �o�}�t�i�d�‚�n�Xy�|��i �|�ƒ�}�Wn1�t�i �j �o"�}�t��i�|�ƒ�t�i�d�‚�n�Xt�|�ƒ�t�i�j�o�t��i�|�ƒ�t�i�d�‚�n�t��i�|�ƒ�|�S(���s>���hand back the rpm header or raise an Error if the pkg is fubars���Unable to open files���RPM Error opening PackageN(���R���R���R���R���R���R#���R���Ro���Rt���R���R���R���R ���R���R"���R����(���R���R���R���R���R���(����(����R���t���hdrFromPackageŒ��s����� c�����������C���sg���t��t�d�ƒ�oS�t��t�d�ƒ�oC�t�i�t�i�t�i�t�i�t�i�t�i�g�ƒ�o�t �i �d�ƒ�qc�n�d��S(���Nt���checkSignalst ���signalsCaughti���(���t���hasattrR ���RŽ���t���signalt���SIGINTt���SIGTERMt���SIGPIPEt���SIGQUITt���SIGHUPt���syst���exit(����(����(����R���R���¡��s���� .(���R ���R���Rm���R���R–���R)���R���t���rpmUtils.transactionRo���R���R���R$���R ���R?���RG���RE���R`���Rl���t���stdoutR|���R…���R†���R‹���RŒ���R���(���R���R$���R)���R ���R‹���R���R†���R|���R…���R���RG���R–���R`���Rl���R���RE���R���R���R?���Rm���R ���Ro���RŒ���(����(����R���t���?���s,��� ' K E