%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/__pycache__/lsb_release.cpython-310.pyc

o

x�b]5:�@sddlmZddlZddlZddlZddlZddlZddlZd+dd�Ze�d,dd�Z	dZ
e�d	�Zd
d�Z
zeWneyJddlZejZYnwdd
�Zdddddd�Zdd�Zdd�Zdd�Zdd�Zddddddifd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zed*kr�e�dSdS)-�)�print_functionN�DebiancCs�zt}Wntyt}Ynwz
td|���}Wn
|y'td�}Ynwt�|�}dd�|D�att�	��a
t
jdd�d�tttt
��d�a
|��d	kr[d
a
t
�gd��|��dS)Nz/usr/share/distro-info/%s.csvz!/usr/share/distro-info/debian.csvcSs"i|]
}|dr|d|d�qS)�version�series�)�.0�rrr�-/usr/lib/python3/dist-packages/lsb_release.py�
<dictcomp>.s"z#get_distro_info.<locals>.<dictcomp>cSst|d�S�Nr)�float)�nrrr	�<lambda>0sz!get_distro_info.<locals>.<lambda>��key��debianzunknown.new.testing)�stablezproposed-updates�testingztesting-proposed-updates�unstable�sid)�FileNotFoundError�	NameError�IOError�open�lower�csv�
DictReader�RELEASE_CODENAME_LOOKUP�list�items�RELEASES_ORDER�sort�zip�TESTING_CODENAME�extend�close)�origin�FileNotFoundException�csvfile�readerrrr	�get_distro_infos&��
r+cCsRt�d|�}|s
|St|�d��dkrd|�dd�}nd|�d�}t�||�S)Nz(\d+)\.(\d+)(r(\d+))?r�z%s.%s�z%s)�re�match�int�groupr�get)�release�unknown�m�shortreleaserrr	�lookup_codename<sr7z`lsb-core lsb-cxx lsb-graphics lsb-desktop lsb-languages lsb-multimedia lsb-printing lsb-securityzIlsb-(?P<module>[a-z0-9]+)-(?P<arch>[^ ]+)(?: \(= (?P<version>[0-9.]+)\))?cCsJ|dkrddgS|dkr|dvrdgS|dkrddgSgd�S|dkrE|dkr+ddgS|d	kr2dgS|d
vr9dgS|dkrAgd�Sgd�S|d
krs|dkrQgd�S|d	krXdgS|d
vr`dd
gS|dkrgd
gS|dkrogd�Sgd�S|dkr�|dkrgd�S|d	kr�dgS|d
vr�gd�S|dkr�d
dgS|dkr�gd�Sgd�S|gS)N�3.0�2.0�3.1)�desktop�qt4�cxx)r9r8r:�3.2r;r<)�printing�	languages�
multimedia)r8r:r>)r9r8r:r>�4.0)r:r>rB�security)r8r:r>rB)r9r8r:r>rB�4.1)r:r>rBrD)r>rBrD)r8r:r>rBrD)r9r8r:r>rBrDr)r�modulerrr	�valid_lsb_versionsLsVrFcCstj��}d|d<tjgd�t��|tjtjdd���d�	d�}|s&gSt
�}|�tj�D]S}|s5nN|�dd	�\}}t�d
|d	�d}|�d�D]6}t
�|�}|sUqK|��}|�d�rhd
|}	|�|	�qK|d}	t||	�D]}
|
|d<d
|}	|�|	�qqqKq/t|�}|��|S)N�C�LC_ALL)z
dpkg-queryz-fz${Version} ${Provides}
z-WT��env�stdout�stderr�	close_fdsr�utf-8� rz[-+~]�,rz%(module)s-%(version)s-%(arch)srE)�os�environ�copy�
subprocess�Popen�PACKAGES�split�PIPE�communicate�decode�set�linesepr.�	modnamere�search�	groupdictr2�addrFrr")�C_env�output�modules�liner�provides�pkg�mob�mgroupsrE�vrrr	�check_modules_installed�sJ���

��rjrr'�suite�	component�label)ri�o�a�c�lcCsXi}|�d�}|D] }|�dd�}t|�dkr)|dd�\}}|tvr)||t|<q	|S)NrP�=rr-)rW�len�	longnames)�data�retval�bits�bit�kv�krirrr	�parse_policy_line�s
�r{cCsT|d�d�}|r(|tvrttt�t�|��Szt|�WSty'YdSwdS)Nrrkr)r2r!r0rs�indexr�
ValueError)�xrkrrr	�
release_index�s
�rcCsNtjdtdd�t|�}t|�}z||WSty&||k||kYSw)Nz^compare_release(x,y) is deprecated; please use the release_index(x) as key for sort() instead.r-)�
stacklevel)�warnings�warn�DeprecationWarningr�	TypeError)r~�y�	suite_x_i�	suite_y_irrr	�compare_release�s
�r�cCs�g}tj��}d|d<tjddg|tjtjdd���d�d�}|�d	�D]1}|�	�}t
�d
|�}|r:t|�
d��}|�d�rV|�d
d�}t|�dkrV|�|t|d�f�q%|S)NzC.UTF-8rHz	apt-cache�policyTrIrrN�
z(-?\d+)rr3rO)rQrRrSrTrUrXrYrZrW�stripr.r/r0r1�
startswithrs�appendr{)rurar�rdr5�priorityrwrrr	�parse_apt_policy�s.
���
�r��main�experimental�Debian Ports�zftp.ports.debian.orgzftp.debian-ports.orgcsxt�}|sdS�����fdd�|D�}|sdS|jdd�dd�|dd��fdd�|D�}|jtd	�|dd
S)Nc	s�g|]I}|d�dd��kr,|d�dd��vr,|d�dd��kr,|d�dd��ksI|d�dd��vrK|d�dd���|d�dd��vr|�qS)rr'�rkrlrm)r2�rr~)�alternate_olabelsrl�ignoresuitesrmr'rr	�
<listcomp>�s&�z*guess_release_from_apt.<locals>.<listcomp>cSs|dSrr)�tuplerrr	r�sz(guess_release_from_apt.<locals>.<lambda>T)r�reversercsg|]
}|d�kr|�qS)rrr�)�max_priorityrr	r�srr)r�r"r)r'rlr�rmr��releasesr)r�rlr�rmr�r'r	�guess_release_from_apt�s	r�c

Cs6i}d|d<tj�dd�}tj�|�rrz>t|��0}|D]%}z|�dd�\}}|��}|��}|dkr6||d<Wqt	y@YqwWd�n1sKwYWn t
yq}ztd|d	t|�t
jd
�WYd}~nd}~wwt|d�t��d}|dvr�d
||d<n|dkr�d||d<n
|dvr�||d<nd|d<d||d<tj�dd�}tj�|��r)zt|��}	|	����}
Wd�n1s�wYWn"t
y�}ztd|d	t|�t
jd
�d}
WYd}~nd}~ww|
dd����st|
d�}|�|
|d��n|
�d��r%|
�d���dk�r |
�d�ad|d<n|
|d<|�d��syt�}|�ry|�d�}
|
d k�rX|�d!�d"k�rX|�d#�d$v�rXd}
|�d%d&i�|
�rat|
d�}n|�d%d&�}
|
dk�rot}nd'}|�|
|d��|�d��r�|dd(|7<|�d��r�|dd)|7<|S)*Nr�ID�LSB_ETC_DPKG_ORIGINS_DEFAULTz/etc/dpkg/origins/defaultz: r�vendor�Unable to open �:��filer)�Linux�Hurd�NetBSDzGNU/�OS�FreeBSDzGNU/k)z	GNU/LinuxzGNU/kFreeBSD�GNUz
%(ID)s %(OS)s�DESCRIPTION�LSB_ETC_DEBIAN_VERSIONz/etc/debian_versionr4zn/a)�RELEASE�CODENAMEz/sidrztesting/unstabler�r�rz1.0r'r�rmr�rkrrz %(RELEASE)sz (%(CODENAME)s))rQrRr2�path�existsrrWrr�r}r�print�str�sysrLr+�uname�read�isalphar7�update�endswith�rstripr$r�)
�distinfo�etc_dpkg_origins_default�dpkg_origins_filerd�header�content�msg�kern�etc_debian_version�debian_versionr3�codename�rinforrr	�guess_debian_release
s�
�����
(��

����




*
r�c
CsHi}tj�dd�}tj�|�r�zqt|��b}|D]U}|��}|s qd|vr%q|�dd�\}}|�d�r=|�	d�r=|dd�}|rl|dkrJ|��|d<q|d	krU|��|d
<q|dkrb|���
�|d<q|dkrl|��|d
<qWd�W|S1sywYW|Sty�}ztd|dt
|�tjd�WYd}~|Sd}~ww|S)N�LSB_OS_RELEASEz/usr/lib/os-releaserrr�"����
VERSION_IDr��VERSION_CODENAMEr�r��PRETTY_NAMEr�r�r�r�)rQrRr2r�r�rr�rWr�r��titlerr�r�r�rL)r��
os_release�os_release_filerd�var�argr�rrr	�get_os_releasehsF
�����&��r�cCs4t�}dD]}||vrt�}|�|�|Sq|S)N)r�r�r�r�)r�r�r�)�lsbinforr�rrr	�get_distro_information�s
�r�cCstt��tt��dS�N)r�r�rjrrrr	�test�s
r��__main__)rr�)�
__future__rr�rTrQr.r�rr+r7rV�compiler]rFr[r�sets�Setrjrtr{rr�r�r�r�r�r�r��__name__rrrr	�<module>sN


5
�(�

�!^!
�

Zerion Mini Shell 1.0