HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/usr/share/python/debpython/pydist.pyc
�
}k^c@�soddlmZddlZddlZddlZddlmZmZmZddl	m
Z
ddlmZm
Z
ddlmZmZmZddlmZeje�Zejd�Zejd	ej�Zejd
ej�Zd�Zedd
dd��Zdd�Zd�Z d�Z!d�Z"d�Z#ejd�Z$ejd�Z%d�Z&d�Z'dS(i����(twith_statementN(texiststisdirtjoin(t	maketrans(tPIPEtPopen(tvreprtgetvertget_requested_versions(tmemoizes/.*?/usr/lib/python(\d.\d+)/(site|dist)-packagess�
    (?P<name>[A-Za-z][A-Za-z0-9_.\-]*)             # Python distribution name
    \s*
    (?P<vrange>(?:-?\d\.\d+(?:-(?:\d\.\d+)?)?)?) # version range
    \s*
    (?P<dependency>(?:[a-z][^;]*)?)              # Debian dependency
    (?:  # optional upstream version -> Debian version translator
        ;\s*
        (?P<standard>PEP386)?                    # PEP-386 mode
        \s*
        (?P<rules>(?:s|tr|y).*)?                 # translator rules
    )?
    s
    (?P<name>[A-Za-z][A-Za-z0-9_.]*)     # Python distribution name
    \s*
    (?P<enabled_extras>(?:\[[^\]]*\])?)  # ignored for now
    \s*
    (?:  # optional minimum/maximum version
        (?P<operator><=?|>=?|==|!=)
        \s*
        (?P<version>(\w|[-.])+)
    )?
    c
C�s�t|��y}xo|D]g}|jd�}|jd�s|rGqntj|�stjd|jdd�d|�tSqWWdQXt	S(s Check if pydist file looks good.s
t#s"invalid pydist data in file %s: %st/ii����N(
topentstript
startswitht	PYDIST_REtmatchtlogterrortrsplittFalsetTrue(tfpathtfptline((s%/usr/share/python/debpython/pydist.pytvalidate=s
	s/usr/share/python/dist/sdebian/pydist-overridess/usr/share/python/dist_fallbackc

�s�t|�r|g}ng}t��rS|j�fd�tj��D��nt|�ro|j|�ni}x|D]}t|���}x�|D]�}|jd�}|jd�s�|r�q�nt	j
|�}|s�td||f��n|j�}t
|d�}	t|d�|d<|dj�|d<|d	r_|d	jd
�|d	<n
g|d	<|j|	g�j|�q�WWdQXq|W|S(s5Load iformation about installed Python distributions.c3�s|]}t�|�VqdS(N(R(t.0ti(tdname(s%/usr/share/python/debpython/pydist.pys	<genexpr>Tss
Rsinvalid pydist line: %s (in %s)tnametvrangetversionst
dependencytrulest;N(RRtextendtostlistdirtappendR
RRRtsearcht	Exceptiont	groupdictt	safe_nameR	tsplitt
setdefault(
Rtfnametfbnametto_checktresultRRRtdistR((Rs%/usr/share/python/debpython/pydist.pytloadKs4)



'cC�stjd||rt|�nd�t|t�rCt|�}ntjd�j	|�j
�\}}t|�|}t�}t
j	|�}|s�tjd�td|��n|j�}|d}|j|j��}|r�x�|D]�}|r||jd|�krq�n|ds%dS|djd�r@|dS|d	r�|d
s^|dr�|ddkr�t|d	|d|d
�}d|d|d|fS|dSq�Wndtt|��}	|r�d|	t|�f}	n
d|	}	tjd|	�td|	dtdtdt�}
|
j�\}}|
jdkr�t�}
xC|jd�D]2}|j�swq_n|
j|jd�d�q_Wt|
�dkr�tj d|�q�|
j!�Sntjd||�t"|�}tjd||t|��|S(Ns-trying to guess dependency for %s (python=%s)s([^!><= \[]+)(.*)s[please ask dh_python2 author to fix REQUIRES_RE or your upstream author to fix requires.txtsrequirement is not valid: %sRR R!t)tversiontstandardR"toperators==s
%s (%s %s)s'*/%s-?*\.egg-info's"%s | grep '/python%s/\|/pyshared/'s$%s | grep '/python2\../\|/pyshared/'sinvoking dpkg -S %ss/usr/bin/dpkg -S %stshelltstdouttstderris
t:is,more than one package name found for %s dists'dpkg -S did not find package for %s: %ss�Cannot find installed package that provides %s. Using %s as package name. Please add "%s correct_package_name" line to debian/pydist-overrides to override it if this is incorrect.(Ns==(#RtdebugRtNonet
isinstancet
basestringRtretcompileRtgroupsR+R3tREQUIRES_REtinfoR)R*tgettlowertendswitht
_translatet	ci_regexpRRRtcommunicatet
returncodetsetR,RtaddtlenRtpoptsensible_pname(treqR5Rtresttdatatreq_dtdetailstitemtvtquerytprocessR9R:R1Rtpname((s%/usr/share/python/debpython/pydist.pytguess_dependencynsd	$	





	
	cC�s�tj|�}|r'|jd�}nd}g}t}}g}t|d���}g|j�D]}|j�^qb}	x�|	D]�}
|
s�|
jd�r�|j	|
�q�n|
jd�r�t
}n|r�|j	|
�q�nt|
|�}|r.|j	|�d|
j�krt
}q;|j	|
�q�|j	|
�q�WWdQX|r}t|d��}|j
d�|D��WdQXn|S(NitrRt[t
setuptoolstwcs�s|]}|dVqdS(s
N((RR((s%/usr/share/python/debpython/pydist.pys	<genexpr>�s(t
PUBLIC_DIR_RERtgroupR=RR
t	readlinesRRR'RR[RFt
writelines(R.t
public_dirtverR1tmodifiedtoptional_sectiont	processedRRtlinesRR!((s%/usr/share/python/debpython/pydist.pytparse_pydep�s:
%

	

	 cC�stjd�jd|�j�S(sEmulate distribute's safe_name.s[^A-Za-z0-9.]+t_(R@RAtsubRF(R((s%/usr/share/python/debpython/pydist.pyR+�scC�sBt|�jdd�}|jd�r4|d}nd|j�S(s(Guess Debian package name from Egg name.Rkt-spython-is	python-%s(R+treplaceRRF(tegg_name((s%/usr/share/python/debpython/pydist.pyRP�s
cC�sdjd�|j�D��S(s'Return case insensitive dpkg -S regexp.tcs�s7|]-}|j�r+d|j�|fn|VqdS(s[%s%s]N(tisalphatupper(RR((s%/usr/share/python/debpython/pydist.pys	<genexpr>�s(RRF(R((s%/usr/share/python/debpython/pydist.pyRI�ss[-.]?(alpha|beta|rc|dev|a|b|c)s\$(\d+)cC�stjd|�S(scConvert Perl RE patterns used in uscan to Python's

    >>> print _pl2py('foo$3')
    foo\g<3>
    s\\g<\1>(tGROUP_RERl(tpattern((s%/usr/share/python/debpython/pydist.pyt_pl2py�sc	C�scx;|D]3}|jd�ru|jd�r1dnd}||dj||�}|jt|d|d��}q|jd�r*|dj|d�}tj|d�}d}|dr|d}d|kr�d}nd|krtj|dtj�}qn|jt|d�||�}qt	j
d	|�qW|d
kr_tjd|�}n|S(
s>Translate Python version into Debian one.

    >>> _translate('1.C2betac', ['s/c//gi'], None)
    '1.2beta'
    >>> _translate('5-fooa1.2beta3-fooD',
    ...     ['s/^/1:/', 's/-foo//g', 's:([A-Z]):+$1:'], 'PEP386')
    '1:5~a1.2~beta3+D'
    >>> _translate('x.y.x.z', ['tr/xy/ab/', 'y,z,Z,'], None)
    'a.b.a.Z'
    ttrtyiiitstgRsunknown rule ignored: %stPEP386s~\g<1>(RvRw(RR,t	translateRR@RAtIRlRuRtwarnt
PRE_VER_RE(	R5R"R6truletposttmpRttcounttflags((s%/usr/share/python/debpython/pydist.pyRH�s(
#

	"((t
__future__RtloggingR%R@tos.pathRRRtstringRt
subprocessRRtdebpython.versionRRR	tdebpython.toolsR
t	getLoggert__name__RRAR`tVERBOSERRCRR3R=R[RjR+RPRIR~RsRuRH(((s%/usr/share/python/debpython/pydist.pyt<module>s6
	!H	&