
    \e                         d dl Z d dlZd dlZd dlZde j                   dedeeef   fdZdededz  fdZdej                  d	ed
edededz  f
dZ
y)    Nrelease_datem_monthsreturnc                     |dz  }|dz  }| j                   |z   | j                  |z   dz  z   }| j                  |z   dz  }|dk(  rd}|dz  }||fS )z
    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
       r      )yearmonth)r   r   yearsmonthssupport_end_yearsupport_end_months         +/usr/lib/python3/dist-packages/apt/utils.pyget_maintenance_end_dater      sx     NE]F#((50L4F4F4OTV3VV%++f4:AA/00    pathc                 R   | rt         j                  j                  |       syt        j                  t	        j
                  |             5 }t	        j                  |      }t        |      }d|vr
	 ddd       y|d   }t	        j                  |      cddd       S # 1 sw Y   yxY w)zF
    return the release date as time_t for the given release file
    NDate)	osr   existsfdopenapt_pkgopen_maybe_clear_signed_fileTagFilenextstr_to_time)r   datatagsectiondates        r   "get_release_date_from_release_filer!   /   s     rww~~d+	777=	> )$ood#s) 	) )
 v""4() ) )s   &B:BB&cachepkgnamelabelreleasec                 "   || vry| |   }d}|j                   j                  D ]W  }||j                  |j                  D ]7  \  }}|j                  |k(  s|j                  |k(  s&|j
                  |k(  s6|}9 Y |sy| j                  j                  |j                  d   d         }	| j                  j                  D ]  }
|
j                  D ]  }|	s|	j                  |j                  k(  s |	j                  s-t        j                  j                  d      }dD ]k  }t        j                  |
j                         dj#                  |
j$                  |      z   }t&        j(                  j+                  ||z         sb||z   c c c S    y)z+get the release file that provides this pkgNr   zDir::State::lists)	InReleaseReleasezdists_{}_{})_pkgversion_list	file_listoriginr$   archive_list
find_indexlistindex_filesdescribe
is_trustedr   configfind_diruri_to_filenameuriformatdistr   r   r   )r"   r#   r$   r%   pkgveraverver_file_index	indexfile	metaindexmdirnamerelfilenames                  r   get_release_filename_for_pkgrE   ?   s    e
.C
C %% 
<4>>1 $ 	Hf 5(NNe+$$/	
 &&s}}Q'7':;I[[%% .	&& 	.AY//1::=)BVBV!..112EF7 .G"22!%,,!D ww~~gn5&~-.	.. r   )datetimer   r   aptinttupler   strr!   CacherE    r   r   <module>rM      s   &  	  
1##1/21
38_1()S )S4Z ) %99%"%+.%9<%4Z%r   