σ οRec@@s€ddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z ddlmZmZddlmZerλddlmZmZmZmZmZmZed d d ƒZnejeƒZed d ddddƒZda e d„ƒZ!de"fd„ƒYZ#da$e d„ƒZ%de"fd„ƒYZ&e&ƒZ'd e"fd„ƒYZ(de(fd„ƒYZ)dS(i(tabsolute_importN(tcontextmanager(t ExitStack(t ensure_text(tenumtrmtree(tMYPY_CHECK_RUNNING(tAnytDicttIteratortOptionaltTypeVartUniont_Ttboundt TempDirectoryt BUILD_ENVs build-envtEPHEM_WHEEL_CACHEsephem-wheel-cachet REQ_BUILDs req-buildcc@s6tƒ'}t|}az dVWd|aXWdQXdS(N(Rt_tempdir_manager(tstacktold_tempdir_manager((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pytglobal_tempdir_manager%s    tTempDirectoryTypeRegistrycB@s)eZdZd„Zd„Zd„ZRS(s$Manages temp directory behavior cC@s i|_dS(N(t_should_delete(tself((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt__init__5scC@s||j|(R5t __class__R!R3(R((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt__repr__scC@s|S(N((R((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt __enter__‘scC@sS|jdk r|j}n!tr6tj|jƒ}nt}|rO|jƒndS(N(R0R+R$R RRtcleanup(RtexcRttbR0((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt__exit__₯s cC@s;tjjtjddj|ƒƒƒ}tjd|ƒ|S(sECreate a temporary directory and store its path in self.path tprefixspip-{}-sCreated temporary directory: %s(tosR3trealpathttempfiletmkdtempR5tloggertdebug(RRR3((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR-±s cC@s8t|_tjj|jƒr4tt|jƒƒndS(s?Remove the temporary directory created and reset state N(RR/R>R3texistsR.RR(R((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR9Ώs N(R!R"R#R+R*R,RtpropertyR3R7R8R<R-R9(((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRas    tAdjacentTempDirectorycB@s8eZdZdZdd„Zed„ƒZd„ZRS(sͺHelper class that creates a temporary directory adjacent to a real one. Attributes: original The original directory to create a temp directory for. path After calling create() or entering, contains the full path to the temporary directory. delete Whether the directory should be deleted when exiting (when used as a contextmanager) s-~.=%0123456789cC@s/|jdƒ|_tt|ƒjd|ƒdS(Ns/\R0(trstriptoriginalR)RFR(RRHR0((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRίscc@sβxptdt|ƒƒD]Y}xPtj|j|dƒD]5}ddj|ƒ||}||kr6|Vq6q6WqWxhtt|jƒƒD]Q}xHtj|j|ƒD]1}ddj|ƒ|}||kr₯|Vq₯q₯Wq‰WdS(s Generates a series of temporary names. The algorithm replaces the leading characters in the name with ones that are valid filesystem characters, but are not valid package names (for both Python and pip definitions of package). it~tN(trangetlent itertoolstcombinations_with_replacementt LEADING_CHARStjoin(tclstnametit candidatetnew_name((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt_generate_namesδs     cC@sΧtjj|jƒ\}}x₯|j|ƒD]m}tjj||ƒ}ytj|ƒWn+tk r„}|jtj kr˜‚q˜q+Xtjj |ƒ}Pq+Wtjj t j ddj |ƒƒƒ}tjd|ƒ|S(NR=spip-{}-sCreated temporary directory: %s(R>R3tsplitRHRVRPtmkdirtOSErrorterrnotEEXISTR?R@RAR5RBRC(RRtrootRRRTR3tex((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR-ύs  N( R!R"R#ROR+Rt classmethodRVR-(((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRFΚs   (*t __future__RRZRMtloggingtos.pathR>R@t contextlibRtpip._vendor.contextlib2Rtpip._vendor.sixRtpip._internal.utils.miscRRtpip._internal.utils.typingRttypingRRR R R R R t getLoggerR!RBt tempdir_kindsR+RRtobjectRR$R&R'R*RRF(((s‹/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyts6     .   i