�
4�Ad� � �2 � d dl Z d dlZd dlZd dlZ d dlZddlmZmZ nA# e$ r9Z ej
� � dk rn ee � � e j d� � Y dZ [ ndZ [ ww xY wd dl
Z
d dlZd dlZd dlZd dlZd dlZd dlZddlmZ ddlmZ dZdgZd d
ddd
�Zg d
�ZeD ]7Z ede� � � e� e� � fz � � �8[ddl m!Z! d dl"m#Z# dZ$g d�Z%dddddddddd� Z& e'd� e(e&�) � � � � D � � � � Z* ej+ � � Z,d� Z-g d�Z.d � Z/dVd!�Z0d"� Z1dWd$�Z2d%� Z3dWd&�Z4dXd(�Z5d)� Z6d*� Z7d+� Z8dYd-�Z9dZd/�Z:i Z;dXd0�Z< G d1� d2e=� � Z>d3� Z?d4� Z@d5� ZAd6� ZBdXd7�ZCdXd8�ZDd9� ZEd[d;�ZFdXd<�ZGg d=�ZHd>� ZId?� ZJd@� ZKdA� ZLdB� ZMd,d,dCddd,d,d,d,eNddd'dfdD�ZO G dE� dFe
j
� � ZPejQ �R dG� � ZSdHeSfZTdIZUdJ� ZVdK� ZWdL� ZXdM� ZYdN� ZZdO� Z[ej
fdP�Z\dQ� Z]dR� Z^dS� Z_dT� Z`dU� ZadS )\� N� )�TempFile�cleanup_temp_file�Windows)�open_url)�MUA)�Package�Source�Version�Severity�File�Tags�
JustificationzFollowup-For�Owner�User�Usertags� Forwarded�Control�X-Debbugs-Ccr z4Offer simple prompts, bypassing technical questions.z�Offer more extensive prompts, including asking about things that a moderately sophisticated user would be expected to know about Debian.zRLike standard, but assumes you know a bit more about Debian, including "incoming".z�Bypass most handholding measures and preliminary triage routines. This mode should not be used by people unfamiliar with Debian's policies and operating procedures.)�novice�standard�advanced�expertz
MODE_%s=%d)�debbugs)�
AVAILABLE_UISaf Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?
*** End of the template - remove these template lines ***)�/z/usrz
/usr/sharez/varz
/usr/X11R6z/usr/manz/usr/doc�/usr/bin�oldoldoldoldstable�oldoldoldstable�oldoldstable� oldstable�stable�testingznext-testing�unstable�experimental) �jessie�stretch�buster�bullseye�bookworm�trixie�forky�sidr% c � � g | ] \ }}||f��
S � r/ )�.0�codename�suites �1/usr/lib/python3/dist-packages/reportbug/utils.py�
<listcomp>r4 b s! � �]�]�]�_�X�u��x�(�]�]�]� c � � t j � | � � } | � d� � }t dt |� � dz � � D ]�}d� |d|� � � }|t v r�)t j � |� � r�t j |� � }t j � |� � \ }}t j �
t j � ||� � � � }t j j |g||d� z � }t |� � c S ��| S )a�
Return the real path of file `filename`
This is similar to ``os.path.realpath()``. The difference is that
symlinks to a small set of basic directories are not resolved and
just kept in the path if present.
This function is a helper function called only by
:func:`search_path_for()`.
Parameters
----------
filename : string
name of a file, may include relative or absolute path
Returns
-------
str
the real path of the given file
r � r r N)�os�path�abspath�split�range�len�join�fhs_directories�islink�readlink�normpath�realpath)�filename�bits�i� component�resolved�dir�file�newpaths r3 rC rC g s � �* �w���x�(�(�H��>�>�#���D�
�1�c�$�i�i�!�m�
$�
$�
%�
%���H�H�T�!�A�#�Y�'�'� ���'�'��
�7�>�>�)�$�$� %��{�9�-�-�H��'�-�-� �2�2�K�S�$��w�'�'�����S�(�(C�(C�D�D�H��g�l�X�J��a�b�b��$9�:�G��G�$�$�$�$�$� %� �Or5 )� /usr/sbinr z/sbinz/binz/usr/X11R6/binz
/usr/gamesc �� � t j � | � � \ }}|rt | � � S t j � dt j � � � d� � }t D ]}||vr|� |� � �|D ]R}t j � ||� � }t j �
|� � rt |� � c S �SdS )a�
Searches for a file in PATH and common application directories
Given the filename of an executable, this function tries to locate
the file in common application directories (/usr/sbin, /usr/bin/,
/sbin, /bin, /usr/X11R6/bin, /usr/games) and in any additional
directories included in PATH.
:func:`realpath()` is called on the result (if found).
This function is a helper function called only by
:func:`find_package_for()`.
Parameters
----------
filename : string
name of a file, may include relative or absolute path
Returns
-------
str or None
the real path of the given file; None if the file was not found
�PATH�:N)r8 r9 r; rC �environ�get�defpath�pathdirs�appendr> |