U
ÀÒ.eÛ9 ã @ s¤ d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl
mZ dgZe
e¡Ze dej¡Ze d ejejB ¡Zejdd
… ZG dd„ deƒZdS )zu
Class representing the list of files in a distribution.
Equivalent to distutils.filelist, but fixes some problems.
é Né )ÚDistlibException)Úfsdecode©Úconvert_pathÚManifestz\\w*
z#.*?(?=
)|
(?=$)é c @ sz e Zd ZdZddd„Zdd„ Zdd„ Zd d
„ Zddd
„Zdd„ Z dd„ Z
dd„ Zddd„Zd dd„Z
d!dd„Zdd„ ZdS )"r z~A list of files built by on exploring the filesystem and filtered by
applying various patterns to what we find there.
Nc C s> t j t j |pt ¡ ¡¡| _| jt j | _d| _t ƒ | _
dS )zd
Initialise an instance.
:param base: The base directory to explore under.
N)ÚosÚpathÚabspathÚnormpathÚgetcwdÚbaseÚsepÚprefixÚallfilesÚsetÚfiles)Úselfr © r ú@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/manifest.pyÚ__init__* s zManifest.__init__c C s¨ ddl m}m}m} g | _}| j}|g}|j}|j}|r¤|ƒ }t |¡} | D ]R}
tj
||
¡}t |¡}|j}
||
ƒrˆ| t
|ƒ¡ qN||
ƒrN||
ƒsN||ƒ qNq6dS )zmFind all files under the base and set ``allfiles`` to the absolute
pathnames of files found.
r )ÚS_ISREGÚS_ISDIRÚS_ISLNKN)Ústatr r r r r ÚpopÚappendr Úlistdirr
ÚjoinÚst_moder )r r r r r ÚrootÚstackr ÚpushÚnamesÚnameÚfullnamer Úmoder r r Úfindall9 s"
zManifest.findallc C s4 | | j¡stj | j|¡}| j tj |¡¡ dS )zz
Add a file to the manifest.
:param item: The pathname to add. This can be relative to the base.
N) Ú
startswithr r r
r r r Úaddr )r Úitemr r r r* T s zManifest.addc C s |D ]}| |¡ qdS )z†
Add a list of files to the manifest.
:param items: The pathnames to add. These can be relative to the base.
N)r* )r Úitemsr+ r r r Úadd_many^ s zManifest.add_manyFc sb ‡ ‡fdd„‰ t ˆjƒ}|rFt ƒ }|D ]}ˆ |tj |¡ƒ q&||O }dd„ tdd„ |D ƒƒD ƒS )z8
Return sorted files in directory order
c sJ | |¡ t d|¡ |ˆjkrFtj |¡\}}|dks