U Ê—Rei ã @ sZ d dl Z d dlZd dlZd dlZd dlZd dlZd dlZejdd„ ƒZdd„ Z dd„ Z dS )é Nc c s$ t ¡ } z | V W 5 t | ¡ X dS )z2Create a temporary directory in a context manager.N)ÚtempfileÚmkdtempÚshutilÚrmtree)Útd© r úŠ/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/pep517/dirtools.pyÚtempdir s r c O sD zt j| |ŽW S tk r> } z|jtjkr.‚ W 5 d}~X Y nX dS )zWLike `mkdir`, but does not raise an exception if the directory already exists. N)ÚosÚmkdirÚOSErrorÚerrnoÚEEXIST)ÚargsÚkwargsÚexcr r r Úmkdir_p s r c C s– t ¡ }t |d¡}t | ¡D ]r\} }}|D ]0}tj | |¡}tj || ¡}| |d d¡ q,|D ],}tj | |¡}tj || ¡}| ||¡ qbq|S )z0Construct an in-memory zip file for a directory.Úwú/Ú )ÚioÚBytesIOÚzipfileÚZipFiler ÚwalkÚpathÚjoinÚrelpathÚwritestrÚwrite)ÚrootÚbufferÚzip_fileÚdirsÚfilesr Zfs_pathÚrel_pathr r r Údir_to_zipfile s r&