�
�xkd�
� �T � d dl mZ d dlZd dlZd dlmZmZ d dlZd dlZd� Z d� Z
d� ZdS )� )�print_functionN)�Optional�Tuplec � � |dz }|dz }| j |z | j |z dz z }| j |z dz }|dk rd}|dz }||fS )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)�release_date�m_months�years�months�support_end_year�support_end_months �+/usr/lib/python3/dist-packages/apt/utils.py�get_maintenance_end_dater sr � �
��N�E�
��]�F�#�(�5�0�L�4F��4O�TV�3V�V��%�+�f�4��:���A������A����/�0�0� c �j � | rt j � | � � sdS t j t j | � � � � 5 }t j |� � }t |� � }d|vr ddd� � dS |d }t j |� � cddd� � S # 1 swxY w Y dS )zF
return the release date as time_t for the given release file
N�Date) �os�path�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# 1 s � �
� �r�w�~�~�d�+�+� ��t� ��7�7��=�=� >� >� )�$��o�d�#�#���s�)�)���� � �� )� )� )� )� )� )� )� )�
�v����"�4�(�(�
)� )� )� )� )� )� )� )� )� )� )� )���� )� )� )� )� )� )s �
)B(� B(�(B,�/B,c �j � || vrdS | | }d}|j j D ]<}|�|j ��|j D ](\ }}|j |k r|j |k r
|j |k r|}�)�=|sdS | j � |j d d � � } | j j D ]�}
|
j D ]�}| r�| j
|j
k r| j rxt j
� d� � }dD ]V}
t j |
j � � d|
j �d|
��z }t$ j � ||z � � r||z c c c S �W����dS )z+get the release file that provides this pkgNr zDir::State::lists)� InRelease�Release�dists_�_)�_pkg�version_list� file_list�origin�label�archive�_list�
find_index�list�index_files�describe�
is_trustedr �config�find_dir�uri_to_filename�uri�distr r r )�cache�pkgnamer- �release�pkg�ver�aver�ver_file�_index� indexfile� metaindex�m�dirname�relfile�names r �get_release_filename_for_pkgrH B s� � � �e����t�
��.�C�
�C� ��%�
�
���<�4�>�1�� $�� � ��H�f� ��5�(�(��N�e�+�+��$��/�/���� � � ��t���&�&�s�}�Q�'7��':�;�;�I��[�%�
.�
.� ��&� .� .�A��
.�Y�/�1�:�=�=�)�BV�=�!�.�1�1�2E�F�F��7� .� .�G�"�2�9�=�A�A�A�!������E� �D� �w�~�~�g��n�5�5� .�&��~�-�-�-�-�-�-�-�.�� .� �4r )�
__future__r �datetimer �typingr r �aptr r r# rH � r r �<module>rN s� ��& |