‹“ReÛ9 ã @ sè d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l
m Z d g Z e j
e ƒ Z e j d e j ƒ Z e j d e j e j Bƒ Z e j d d
… Z Gd d „ d e ƒ Z d S)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 @ sÇ e Z d Z d Z d d d „ Z d d „ Z d d „ Z d d
„ Z d d d
„ Z d d „ Z d d „ Z
d d „ Z d d d d d „ Z d d d d d „ Z
d d d d d „ Z d d „ Z d S)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 sY t j j t j j | p! t j ƒ ƒ ƒ | _ | j t j | _ d | _ t ƒ | _
d S)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 ú‹/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/manifest.pyÚ__init__* s - zManifest.__init__c C sù d d l m } m } m } g | _ } | j } | g } | j } | j } x¥ | rô | ƒ } t j | ƒ } x€ | D]x }
t j
j | |
ƒ } t j | ƒ } | j }
| |
ƒ rÊ | j t
| ƒ ƒ qu | |
ƒ ru | |
ƒ ru | | ƒ qu WqP Wd S)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 sJ | j | j ƒ s* t j j | j | ƒ } | j j t j j | ƒ ƒ d S)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" x | D] } | j | ƒ q Wd S)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 s‹ ‡ ‡ f d d † ‰ t ˆ j ƒ } | rg t ƒ } x' | D] } ˆ | t j j | ƒ ƒ q: W| | O} d d „ t d d „ | Dƒ ƒ Dƒ S)z8
Return sorted files in directory order
c sg | j | ƒ t j d | ƒ | ˆ j k rc t j j | ƒ \ } } | d k sV t ‚ ˆ | | ƒ d S)Nzadd_dir added %sÚ ú/)r- r. )r) ÚloggerÚdebugr
r r ÚsplitÚAssertionError)ÚdirsÚdÚparentÚ_)Úadd_dirr r r r7 l s
z Manifest.sorted.