U vÆ_%ã@stdZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZddlmZddlmZer¨ddlmZmZmZmZmZdd lmZe e¡Zee ZzddlZee 7ZWne k rìe !d ¡YnXzddl"Z"ee7ZWn e k r"e !d ¡YnXd d „Z#dd„Z$dd„Z%dd„Z&dd„Z'dd„Z(ddd„Z)dd„Z*d dd„Z+dS)!zUtilities related archives. é)Úabsolute_importN)ÚInstallationError)ÚBZ2_EXTENSIONSÚTAR_EXTENSIONSÚ XZ_EXTENSIONSÚZIP_EXTENSIONS)Ú ensure_dir)ÚMYPY_CHECK_RUNNING)ÚIterableÚListÚOptionalÚTextÚUnion)ÚZipInfozbz2 module is not availablezlzma module is not availablecCst d¡}t |¡|S)zBGet the current umask which involves having to set it temporarily.r)ÚosÚumask)Úmask©rúŒ/builddir/build/BUILDROOT/alt-python38-pip-20.2.4-1.el7.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/utils/unpacking.pyÚ current_umask/s  rcCsh| d¡ d¡}d|krHd|kr4| d¡| d¡ksd}n8| ¡ t¡rRd}n$| ¡ d¡rfd}nt d|¡d }t ||¡}z–t d d „|  ¡Dƒƒ}|  ¡D]p}|j }|rÀt |ƒd }tj ||¡}t||ƒsîd }t| |||¡ƒ‚| ¡rt|ƒq¤| ¡r^z| ||¡Wn>tk rZ} zt d||j | ¡WY¢q¤W5d} ~ XYnXq¤z| |¡} WnBttfk r®} zt d||j | ¡WY¢q¤W5d} ~ XYnXttj |¡ƒ| dk sÎt‚t|dƒ} t | | ¡W5QRX|   ¡| ||¡|j d@r¤t!|ƒq¤W5|  ¡XdS)aŸ Untar the file (with path `filename`) to the destination `location`. All files are written based on system defaults and umask (i.e. permissions are not preserved), except that regular file members with any execute permissions (user, group, or world) have "chmod +x" applied after being written. Note that for windows, any execute changes using os.chmod are no-ops per the python docs. z.gzz.tgzzr:gzzr:bz2zr:xzz.tarÚrz-Cannot determine compression type for file %szr:*cSsg|] }|j‘qSr)rL)Ú.0ÚmemberrrrÚ ½szuntar_file..rzQThe tar file ({}) has a file ({}) trying to install outside target directory ({})z/In the tar file %s the member %s is invalid: %sNr9r,)"rÚlowerrDrrÚloggerÚwarningÚtarfiler:r;r$Ú getmembersrLrrrrAr+rrCÚisdirÚissymÚ_extract_memberÚ ExceptionÚ extractfileÚKeyErrorÚAttributeErrorrBÚAssertionErrorrErFÚutimer5r.) r@rGr5ÚtarrKrUrMrrOÚexcrPrQrrrÚ untar_file£s| ÿ ÿ  ÿ ÿ   þþ   rgcCsštj |¡}|dks,| ¡ t¡s,t |¡rDt||| d¡ dnR|dkslt   |¡sl| ¡ t t t ¡rxt||ƒnt d|||¡td |¡ƒ‚dS)Nzapplication/zipz.whl)rHzapplication/x-gzipzZCannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatz%Cannot determine archive format of {})rrÚrealpathrWrDrr<Ú is_zipfilerRrZÚ is_tarfilerrrrgrXÚcriticalrrC)r@rGÚ content_typerrrÚ unpack_fileös< ÿ þý ýÿþ ÿý ýÿrm)T)N),Ú__doc__Ú __future__rÚloggingrrEr2rZr<Úpip._internal.exceptionsrÚpip._internal.utils.filetypesrrrrÚpip._internal.utils.miscrÚpip._internal.utils.typingr Útypingr r r r rrÚ getLoggerÚ__name__rXÚSUPPORTED_EXTENSIONSÚbz2Ú ImportErrorÚdebugÚlzmarrr$r+r.r6rRrgrmrrrrÚsH           /Vý