ó
    Eñi$!  ã                  ó*  • S r SSKJr  SSKrSSKJrJr   SSKrSSK	J
r
  SSKJr  SSKJr  SS	KJr   SS
KJr   SSKJr  S rS r    S              S!S jjr S"       S#S jjr\S/S4\S/S4\S/S4\S/S4\S/S4\/ S4S.rS r\     S$               S%S jj5       r\    S&               S'S jj5       r     S$               S(S jjrg! \ a    Sr NÛf = f! \ a    Sr NÊf = f! \ a    Sr NÑf = f))zodistutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing).é    )ÚannotationsN)ÚLiteralÚoverloadé   )Úlog)Úmkpath)ÚDistutilsExecError)Úspawn)Úgetpwnam)Úgetgrnamc                óf   • [         b  U c  g [        U 5      nUb  US   $ g! [         a    Sn Nf = f)z"Returns a gid, given a group name.Né   )r   ÚKeyError©ÚnameÚresults     Ú_/home/mande/repo/quber/.venv/lib/python3.13/site-packages/setuptools/_distutils/archive_util.pyÚ_get_gidr   !   óH   € äÑ˜4™<ØðÜ˜$“ˆð ÑØ�a‰yÐØøô	 ó ØŠðúó   �! ¡0¯0c                óf   • [         b  U c  g [        U 5      nUb  US   $ g! [         a    Sn Nf = f)z"Returns an uid, given a user name.Nr   )r   r   r   s     r   Ú_get_uidr   .   r   r   c                óö  ^^^^• SSSSS.nSSSS	.nUb  X'R                  5       ;  a  [        S5      eU S-   nX‡R                  US5      -  n[        [        R
                  R                  U5      5        SS
Kn	[        R                  " S5        [        T5      m[        T5      mUUUU4S jn
U	R                  USXb    35      n UR                  XS9  UR                  5         U$ ! UR                  5         f = f)aÚ  Create a (possibly compressed) tar file from all the files under
'base_dir'.

'compress' must be "gzip" (the default), "bzip2", "xz", or None.

'owner' and 'group' can be used to define an owner and a group for the
archive that is being built. If not provided, the current owner and group
will be used.

The output tar file will be named 'base_dir' +  ".tar", possibly plus
the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").

Returns the output filename.
ÚgzÚbz2ÚxzÚ )ÚgzipÚbzip2r   Nz.gzz.bz2z.xz)r   r   r   Nz=bad value for 'compress': must be None, 'gzip', 'bzip2', 'xz'z.tarr   zCreating tar archivec                óL   >• Tb  TU l         TU l        Tb  TU l        TU l        U $ ©N)ÚgidÚgnameÚuidÚuname)Útarinfor"   ÚgroupÚownerr$   s    €€€€r   Ú_set_uid_gidÚ"make_tarball.<locals>._set_uid_gidl   s.   ø€ Ø‰?ØˆGŒKØ!ˆGŒMØ‰?ØˆGŒKØ!ˆGŒMØˆó    zw|)Úfilter)ÚkeysÚ
ValueErrorÚgetr   ÚosÚpathÚdirnameÚtarfiler   Úinfor   r   ÚopenÚaddÚclose)Ú	base_nameÚbase_dirÚcompressÚverboser(   r'   Útar_compressionÚcompress_extÚarchive_namer3   r)   Útarr"   r$   s       ``      @@r   Úmake_tarballr@   ;   sü   û€ ð. ØØØñ	€Oð "¨F¸%Ñ@€Lð Ñ ×0AÑ0AÓ0CÓ CÜØKó
ð 	
ð ˜vÑ%€LØ×$Ñ$ X¨rÓ2Ñ2€Lä
Œ2�7‰7�?‰?˜<Ó(Ô)ó ä‡H‚HÐ#Ô$ä
�5‹/€CÜ
�5‹/€C÷ð ð �,‰,�| r¨/Ñ*CÐ)DÐ%EÓ
F€CðØ�‰�ˆÑ.à�	‰	ŒàÐøð 	�	‰	�ús   ÃC& Ã&C8c           
     ó6  • U S-   n[        [        R                  R                  U5      5        [        c  U(       a  SnOSn [        SXCU/5        U$ [        R                  " SX15         [        R                  " US	[        R                  S
9nU   U[        R                  :w  ae  [        R                  R                  [        R                  R                  US5      5      nUR!                  Xf5        [        R                  " SU5        [        R"                  " U5       GH  u  pxn	U Hh  n
[        R                  R                  [        R                  R                  XzS5      5      nUR!                  Xf5        [        R                  " SU5        Mj     U	 H�  n
[        R                  R                  [        R                  R                  Xz5      5      n[        R                  R%                  U5      (       d  Me  UR!                  Xf5        [        R                  " SU5        M�     GM     SSS5        U$ ! [         a    [        SU S35      ef = f! [         a(    [        R                  " US	[        R                  S
9n GN÷f = f! , (       d  f       U$ = f)a^  Create a zip file from all the files under 'base_dir'.

The output zip file will be named 'base_name' + ".zip".  Uses either the
"zipfile" Python module (if available) or the InfoZIP "zip" utility
(if installed and found on the default search path).  If neither tool is
available, raises DistutilsExecError.  Returns the name of the output zip
file.
z.zipNz-rz-rqÚzipzunable to create zip file 'zN': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to itÚw)Úcompressionr   zadding '%s')r   r0   r1   r2   Úzipfiler
   r	   r   r4   ÚZipFileÚZIP_DEFLATEDÚRuntimeErrorÚ
ZIP_STOREDÚcurdirÚnormpathÚjoinÚwriteÚwalkÚisfile)r8   r9   r;   Úzip_filenameÚ
zipoptionsrB   r1   ÚdirpathÚdirnamesÚ	filenamesr   s              r   Úmake_zipfilerU   ~   s  € ð ˜vÑ%€LÜ
Œ2�7‰7�?‰?˜<Ó(Ô)ô �ÞØ‰JàˆJð		Ü�5˜*°HÐ=Ô>ðD Ðô/ 	�ŠÐ6¸ÔOð	UÜ—/’/ ,°Ä×AUÑAUÑVˆCò Øœ2Ÿ9™9Ó$Ü—w‘w×'Ñ'¬¯©¯©°X¸rÓ(BÓC�Ø—	‘	˜$Ô%Ü—’˜¨Ô-Ü02·²¸×0AÑ,� 9Û$�DÜŸ7™7×+Ñ+¬B¯G©G¯L©L¸ÈÓ,KÓL�DØ—I‘I˜dÔ)Ü—H’H˜]¨DÖ1ñ %ó &�DÜŸ7™7×+Ñ+¬B¯G©G¯L©L¸Ó,GÓH�DÜ—w‘w—~‘~ d×+Ó+ØŸ	™	 $Ô-ÜŸš °Ö5ô	 &ñ 1B÷ ð  ÐøôC "ó 	ô %Ø-¨l¨^ð <0ð 0óð ð	ûô ó 	UÜ—/’/ ,°Ä×ASÑASÑT‹Cð	Uú÷ ŒSð  Ðús1   ÁH7 Á*$I ÂE(J	Ç<1J	È7IÉ.JÊJÊ	
J)r:   r   zgzip'ed tar-file)r:   r   zbzip2'ed tar-file)r:   r   zxz'ed tar-file)r:   r:   zcompressed tar file)r:   Nzuncompressed tar filezZIP file)ÚgztarÚbztarÚxztarÚztarr?   rB   c                ó2   • U  H  nU[         ;  d  M  Us  $    g)ziReturns the first format from the 'format' list that is unknown.

If all formats are known, returns None
N)ÚARCHIVE_FORMATS)ÚformatsÚformats     r   Úcheck_archive_formatsr^   Æ   s    € ó
 ˆØœÕ(ØŠMñ ð r+   c                ó   • g r!   © ©r8   r]   Úroot_dirr9   r;   r(   r'   s          r   Úmake_archiverc   Ñ   ó   € ð r+   c                ó   • g r!   r`   ra   s          r   rc   rc   Û   rd   r+   c                ót  • [         R                  " 5       nUbL  [        R                  " SU5        [         R                  R                  U 5      n [         R                  " U5        Uc  [         R                  n0 n [        U   n	U	S   n
UR                  U	S   5        US:w  a  XXS'   XhS'    U
" X40 UD6nUb-  [        R                  " S	U5        [         R                  " U5        U$ ! [         a    [        SU S35      ef = f! Ub.  [        R                  " S	U5        [         R                  " U5        f f = f)
aÌ  Create an archive file (eg. zip or tar).

'base_name' is the name of the file to create, minus any format-specific
extension; 'format' is the archive format: one of "zip", "tar", "gztar",
"bztar", "xztar", or "ztar".

'root_dir' is a directory that will be the root directory of the
archive; ie. we typically chdir into 'root_dir' before creating the
archive.  'base_dir' is the directory where we start archiving from;
ie. 'base_dir' will be the common prefix of all files and
directories in the archive.  'root_dir' and 'base_dir' both default
to the current directory.  Returns the name of the archive file.

'owner' and 'group' are used when creating a tar archive. By default,
uses the current owner and group.
zchanging into '%s'zunknown archive format 'Ú'r   r   rB   r(   r'   zchanging back to '%s')r0   Úgetcwdr   Údebugr1   ÚabspathÚchdirrJ   r[   r   r.   Úupdate)r8   r]   rb   r9   r;   r(   r'   Úsave_cwdÚkwargsÚformat_infoÚfuncÚfilenames               r   rc   rc   å   s  € ô2 �yŠy‹{€HØÑÜ�	Š	Ð&¨Ô1Ü—G‘G—O‘O IÓ.ˆ	Ü
�Š�ÔàÑÜ—9‘9ˆà%'€Fð?Ü% fÑ-ˆð �q‰>€DØ
‡M�M�+˜a‘.Ô!à�ƒØˆw‰Øˆw‰ðÙ˜	Ñ6¨vÑ6ˆàÑÜ�IŠIÐ-¨xÔ8Ü�HŠH�XÔà€Oøô# ó ?ÜÐ3°F°8¸1Ð=Ó>Ð>ð?ûð ÑÜ�IŠIÐ-¨xÔ8Ü�HŠH�XÕð  ús   Á;	C' Â,	D Ã'DÄ3D7)r   FNN)r8   Ústrr9   ústr | os.PathLike[str]r:   z%Literal['gzip', 'bzip2', 'xz'] | Noner;   Úboolr(   ú
str | Noner'   ru   Úreturnrr   )F)r8   rr   r9   rs   r;   rt   rv   rr   )NNFNN)r8   rr   r]   rr   rb   ú:str | os.PathLike[str] | bytes | os.PathLike[bytes] | Noner9   ru   r;   rt   r(   ru   r'   ru   rv   rr   )NFNN)r8   rs   r]   rr   rb   z3str | os.PathLike[str] | bytes | os.PathLike[bytes]r9   ru   r;   rt   r(   ru   r'   ru   rv   rr   )r8   rs   r]   rr   rb   rw   r9   ru   r;   rt   r(   ru   r'   ru   rv   rr   )Ú__doc__Ú
__future__r   r0   Útypingr   r   rE   ÚImportErrorÚ_logr   Údir_utilr   Úerrorsr	   r
   Úpwdr   Úgrpr   r   r   r@   rU   r[   r^   rc   r`   r+   r   Ú<module>r�      s¾  ðñõ
 #ã 	ß $ðÛõ
 Ý Ý &Ý ðÝðÝò

ò
ð  7=ØØØð@Øð@à$ð@ð 4ð@ð ð	@ð
 ð@ð ð@ð 	õ@ðL ð;Øð;à$ð;ð ð;ð 	õ	;ð~ Ð1Ð2Ð4FÐGØÐ2Ð3Ð5HÐIØÐ/Ð0Ð2BÐCØÐ4Ð5Ð7LÐMØÐ-Ð.Ð0GÐHØ˜"˜jÐ)ñ€òð 
ð LPØØØØðØðàðð Iðð ð	ð
 ðð ðð ðð 	ôó 
ðð 
ð
  ØØØðØ%ðàðð Bðð ð	ð
 ðð ðð ðð 	ôó 
ðð LPØØØØð7Ø%ð7àð7ð Ið7ð ð	7ð
 ð7ð ð7ð ð7ð 	ö7øðq ó Ø‚Gðûð ó Ø‚Hðûð
 ó Ø‚Hðús3   –C+ ³C9 ºD Ã+C6Ã5C6Ã9DÄDÄDÄD