ó
‚¼Lc           @   s7   d  d l  Z d  d l Z d „  Z d „  Z d „  Z d S(   iÿÿÿÿNc         C   sj   | d } | d } |  j  | |  j | d } |  j | d } | d k r` d } | d 8} n  | | f S(   s³   
    get the (year, month) tuple when the maintenance for the distribution
    ends. Needs the data of the release and the number of months that
    its is supported as input
    i   i    i   (   t   yeart   month(   t   release_datet   m_monthst   yearst   monthst   support_end_yeart   support_end_month(    (    s-   /usr/lib/python2.7/dist-packages/apt/utils.pyt   get_maintenance_end_date   s    


c         C   sf   |  s t  j j |  ƒ r d St j t |  ƒ ƒ } | j ƒ  } d | k rO d S| d } t j | ƒ S(   sF   
    return the release date as time_t for the given release file
    t   DateN(	   t   ost   patht   existst   Nonet   apt_pkgt   TagFilet   opent   nextt   str_to_time(   R   t   tagt   sectiont   date(    (    s-   /usr/lib/python2.7/dist-packages/apt/utils.pyt"   get_release_date_from_release_file,   s    
c         C   sV  | |  k r d S|  | } d } x… | j j D]w } | d k s- | j d k rT q- n  xM | j D]B \ } } | j | k r^ | j | k r^ | j | k r^ | } q^ q^ Wq- W| s² d S|  j j | j d d ƒ }	 x€ |  j j	 D]r }
 xi |
 j
 D]^ } |	 rì |	 j | j k rì |	 j rì t j j d ƒ } t j |
 j ƒ d |
 j } | | Sqì WqÜ Wd S(   s-    get the release file that provides this pkg i    s   Dir::State::listss   dists_%s_ReleaseN(   R   t   _pkgt   version_listt	   file_listt   origint   labelt   archivet   _listt
   find_indext   listt   index_filest   describet
   is_trustedR   t   configt   find_dirt   uri_to_filenamet   urit   dist(   t   cachet   pkgnameR   t   releaset   pkgt   vert   avert   ver_filet   _indext	   indexfilet	   metaindext   mt   dirnamet   name(    (    s-   /usr/lib/python2.7/dist-packages/apt/utils.pyt   get_release_filename_for_pkg:   s2    
	(   t   os.pathR
   R   R   R   R5   (    (    (    s-   /usr/lib/python2.7/dist-packages/apt/utils.pyt   <module>   s   		