;ò
>5¡@c           @   s1   d  k  Z  d  k Z d „  Z d „  Z d „  Z d  S(   Nc         C   s.   t  |  ƒ t i j o t |  ƒ }  n |  Sd  S(   N(   s   types   args   typess
   StringTypes   str(   s   arg(    (    s5   /usr/share/rhn/up2date_client/repoBackends/mdUtils.pys   rpmOutToStr   s    c   	      C   s’   |  \ } } } | \ } } } t | ƒ } t | ƒ } t | ƒ } t | ƒ } t | ƒ } t | ƒ } t i | | | f | | | f ƒ } | Sd  S(   N(
   s   e1s   v1s   r1s   e2s   v2s   r2s   rpmOutToStrs   rpms   labelCompares   rc(	   s   .0s   .2s   e1s   v1s   r1s   e2s   v2s   r2s   rc(    (    s5   /usr/share/rhn/up2date_client/repoBackends/mdUtils.pys
   compareEVR   s   $c         C   sY  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
 ~ n‚ X| d j p t
 ‚ | d } d } } xM | | j  o? | | | j o  | | | | <} | d 7} n | d 7} qÇ W| |  Sg  } x, |  D]$ } | | j o | i | ƒ q)q)W| Sd 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(   s   lens   ss   ns   us   xs	   TypeErrors   keyss   lists   ts   sorts   AssertionErrors   lasts   lastis   is   append(   s   ss   lasts   is   lastis   ns   us   ts   x(    (    s5   /usr/share/rhn/up2date_client/repoBackends/mdUtils.pys   unique1   sB      
	

  (   s   rpms   typess   rpmOutToStrs
   compareEVRs   unique(   s
   compareEVRs   rpmOutToStrs   uniques   rpms   types(    (    s5   /usr/share/rhn/up2date_client/repoBackends/mdUtils.pys   ?   s   				