Ë
    R/jC  ã                   ó¸   — d dl mZ d dlmZmZ d dlmZ d dlZddlm	Z	 ddl
mZ  G d„ d	e«      Zed
„ «       Zd„ Z G d„ d«      Z G d„ de«      Z G d„ de«      Zy)é    )Úcontextmanager)Úcreate_string_bufferÚ	string_at)ÚIntEnumNé   )Úffi)ÚArchiveErrorc                   óD   — e Zd ZdxZZdxZZdxZZdxZ	Z
dxZZdxZZdxZZy)	ÚFileTypeé   é    é @  é `  é €  é    é À  N)Ú__name__Ú
__module__Ú__qualname__Ú
NAMED_PIPEÚAE_IFIFOÚCHAR_DEVICEÚAE_IFCHRÚ	DIRECTORYÚAE_IFDIRÚBLOCK_DEVICEÚAE_IFBLKÚREGULAR_FILEÚAE_IFREGÚSYMBOLINK_LINKÚAE_IFLNKÚSOCKETÚ	AE_IFSOCK© ó    úB/home/josh/.local/lib/python3.12/site-packages/libarchive/entry.pyr   r   
   sH   „ Ø!)Ð)€J�XØ!)Ð)€K�XØ!)Ð)€I�XØ!)Ð)€L�XØ!)Ð)€L�XØ!)Ð)€N�XØ!)Ð)€F‘Yr%   r   c               #   óœ   K  — t        j                  «       } 	 | –— t        j                  | «       y # t        j                  | «       w xY w­w©N)r   Ú	entry_newÚ
entry_free)Úentry_ps    r&   Únew_archive_entryr,      s3   è ø€ ä�m‰m‹o€Gð ØŠä�‰�wÕøŒ�‰�wÕüs   ‚A˜2 œA²A	Á	Ac                 óP   — |rt        | «      t        |«      dz  z   S t        | «      S )zC return float of seconds.nanos when nanos set, or seconds when not g    eÍÍA)ÚfloatÚint)ÚsecondsÚnanoss     r&   Úformat_timer2      s'   € áÜ�W‹~¤ e£¨|Ñ ;Ñ;Ð;Üˆw‹<Ðr%   c                   óN  — e Zd ZdZd@d„Zd„ Zd„ ZdAd„Zed„ «       Z	e	j                  d„ «       Z	ed	„ «       Zej                  d
„ «       Zed„ «       Zej                  d„ «       Zed„ «       Zej                  d„ «       Zed„ «       Zej                  d„ «       Zej                   fd„Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zej                  d„ «       ZdBd„Zed„ «       Zej                  d „ «       ZdBd!„Zed"„ «       Z e j                  d#„ «       Z dBd$„Z!ed%„ «       Z"e"j                  d&„ «       Z"dBd'„Z#ed(„ «       Z$e$j                  d)„ «       Z$ed*„ «       Z%e%j                  d+„ «       Z% ee$jL                  e$jN                  d,¬-«      Z(e(Z) ee%jL                  e%jN                  d.¬-«      Z*ed/„ «       Z+e+j                  d0„ «       Z+ed1„ «       Z,e,j                  d2„ «       Z,ed3„ «       Z-ed4„ «       Z.e.j                  d5„ «       Z.ed6„ «       Z/e/j                  d7„ «       Z/ed8„ «       Z0e0j                  d9„ «       Z0ed:„ «       Z1e1j                  d;„ «       Z1ed<„ «       Z2e2j                  d=„ «       Z2d>„ Z3d?„ Z4y)CÚArchiveEntry)Ú
_archive_pÚ_entry_pÚheader_codecNc                 ó|   — || _         t        j                  «       | _        || _        |r | j
                  di |¤Ž yy)zØAllocate memory for an `archive_entry` struct.

        The `header_codec` is used to decode and encode file paths and other
        attributes.

        The `**attributes` are passed to the `modify` method.
        Nr$   )r5   r   r)   r6   r7   Úmodify)ÚselfÚ	archive_pr7   Ú
attributess       r&   Ú__init__zArchiveEntry.__init__(   s9   € ð $ˆŒÜŸ™›ˆŒØ(ˆÔÙØˆD�K‰KÑ%˜*Ó%ð r%   c                 óB   — t        j                  | j                  «       y)zFree the C structN)r   r*   r6   ©r:   s    r&   Ú__del__zArchiveEntry.__del__6   s   € ä�‰�t—}‘}Õ%r%   c                 ó   — | j                   S )zReturns the file's path)Úpathnamer?   s    r&   Ú__str__zArchiveEntry.__str__:   s   € à�}‰}Ðr%   c                 ó`   — |r|| _         |j                  «       D ]  \  }}t        | ||«       Œ y)a¦  Convenience method to modify the entry's attributes.

        Args:
            filetype (int): the file's type, see the `FileType` class for values
            pathname (str): the file's path
            linkpath (str): the other path of the file, if the file is a link
            size (int | None): the file's size, in bytes
            perm (int): the file's permissions in standard Unix format, e.g. 0o640
            uid (int): the file owner's numerical identifier
            gid (int): the file group's numerical identifier
            uname (str | bytes): the file owner's name
            gname (str | bytes): the file group's name
            atime (int | Tuple[int, int] | float | None):
                the file's most recent access time,
                either in seconds or as a tuple (seconds, nanoseconds)
            mtime (int | Tuple[int, int] | float | None):
                the file's most recent modification time,
                either in seconds or as a tuple (seconds, nanoseconds)
            ctime (int | Tuple[int, int] | float | None):
                the file's most recent metadata change time,
                either in seconds or as a tuple (seconds, nanoseconds)
            birthtime (int | Tuple[int, int] | float | None):
                the file's creation time (for archive formats that support it),
                either in seconds or as a tuple (seconds, nanoseconds)
            rdev (int | Tuple[int, int]): device number, if the file is a device
            rdevmajor (int): major part of the device number
            rdevminor (int): minor part of the device number
            stored_digests (dict[str, bytes]): hashes of the file's contents
        N)r7   ÚitemsÚsetattr)r:   r7   r<   ÚnameÚvalues        r&   r9   zArchiveEntry.modify>   s7   € ñ< Ø ,ˆDÔØ%×+Ñ+Ó-ò 	'‰KˆD�%Ü�D˜$ Õ&ñ	'r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Úentry_filetyper6   r?   s    r&   ÚfiletypezArchiveEntry.filetypea   s   € ä×!Ñ! $§-¡-Ó0Ð0r%   c                 óD   — t        j                  | j                  |«       y r(   )r   Úentry_set_filetyper6   ©r:   rH   s     r&   rK   zArchiveEntry.filetypee   s   € ä×Ñ˜tŸ}™}¨eÕ4r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Ú	entry_uidr6   r?   s    r&   ÚuidzArchiveEntry.uidi   ó   € ä�}‰}˜TŸ]™]Ó+Ð+r%   c                 óD   — t        j                  | j                  |«       y r(   )r   Úentry_set_uidr6   )r:   rQ   s     r&   rQ   zArchiveEntry.uidm   ó   € ä×Ñ˜$Ÿ-™-¨Õ-r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Ú	entry_gidr6   r?   s    r&   ÚgidzArchiveEntry.gidq   rR   r%   c                 óD   — t        j                  | j                  |«       y r(   )r   Úentry_set_gidr6   )r:   rX   s     r&   rX   zArchiveEntry.gidu   rU   r%   c                 óæ   — t        j                  | j                  «      }|s?t        j                  | j                  «      }|�	 |j	                  | j
                  «      }|S |S # t        $ r Y |S w xY wr(   )r   Úentry_uname_wr6   Úentry_unameÚdecoder7   ÚUnicodeError)r:   Úunames     r&   r`   zArchiveEntry.unamey   ón   € ä×!Ñ! $§-¡-Ó0ˆÙÜ—O‘O D§M¡MÓ2ˆEØÐ ðØ!ŸL™L¨×):Ñ):Ó;�Eð ˆˆuˆøô $ò ØØˆðúó   ÁA# Á#	A0Á/A0c                 óú   — t        |t        «      s|j                  | j                  «      }| j                  dk(  r!t	        j
                  | j                  |«       y t	        j                  | j                  |«       y ©Nzutf-8)Ú
isinstanceÚbytesÚencoder7   r   Úentry_update_uname_utf8r6   Úentry_copy_unamerN   s     r&   r`   zArchiveEntry.uname…   óV   € ä˜%¤Ô'Ø—L‘L ×!2Ñ!2Ó3ˆEØ×Ñ Ò'Ü×'Ñ'¨¯©°uÕ=ä× Ñ  §¡°Õ6r%   c                 óæ   — t        j                  | j                  «      }|s?t        j                  | j                  «      }|�	 |j	                  | j
                  «      }|S |S # t        $ r Y |S w xY wr(   )r   Úentry_gname_wr6   Úentry_gnamer^   r7   r_   )r:   Úgnames     r&   rn   zArchiveEntry.gnameŽ   ra   rb   c                 óú   — t        |t        «      s|j                  | j                  «      }| j                  dk(  r!t	        j
                  | j                  |«       y t	        j                  | j                  |«       y rd   )re   rf   rg   r7   r   Úentry_update_gname_utf8r6   Úentry_copy_gnamerN   s     r&   rn   zArchiveEntry.gnameš   rj   r%   c              #   óÐ   K  — | j                   }|st        d«      ‚t        |«      }t        j                  }	  ||||«      }|dk(  r	 t        | _        y|j
                  d| –— Œ.­w)zêRead the file's content, keeping only one chunk in memory at a time.

        Don't do anything like `list(entry.get_blocks())`, it would silently fail.

        Args:
            block_size (int): the buffer's size, in bytes
        z&this entry isn't linked to any contentr   N)r5   Ú	TypeErrorr   r   Ú	read_dataÚrawÚConsumedArchiveEntryÚ	__class__)r:   Ú
block_sizer;   ÚbufÚreadÚrs         r&   Ú
get_blockszArchiveEntry.get_blocks£   sl   è ø€ ð —O‘Oˆ	ÙÜÐDÓEÐEÜ" :Ó.ˆÜ�}‰}ˆØÙ�Y  ZÓ0ˆAØ�AŠvØä-ˆ�ð —'‘'˜!˜A�,Òð	 ùs   ‚A$A&c                 ó&   — | j                   dz  dk(  S )Né ð  r   ©rK   r?   s    r&   ÚisblkzArchiveEntry.isblk·   ó   € à�}‰}˜xÑ'¨8Ñ3Ð3r%   c                 ó&   — | j                   dz  dk(  S )Nr~   r   r   r?   s    r&   ÚischrzArchiveEntry.ischr»   r�   r%   c                 ó&   — | j                   dz  dk(  S )Nr~   r   r   r?   s    r&   ÚisdirzArchiveEntry.isdir¿   r�   r%   c                 ó&   — | j                   dz  dk(  S )Nr~   r   r   r?   s    r&   ÚisfifozArchiveEntry.isfifoÃ   r�   r%   c                 ó”   — t        t        j                  | j                  «      xs t        j                  | j                  «      «      S r(   )Úboolr   Úentry_hardlink_wr6   Úentry_hardlinkr?   s    r&   ÚislnkzArchiveEntry.islnkÇ   s7   € ä”C×(Ñ(¨¯©Ó7ò 6Ü×&Ñ& t§}¡}Ó5ó7ð 	7r%   c                 ó&   — | j                   dz  dk(  S )Nr~   r   r   r?   s    r&   ÚissymzArchiveEntry.issymÌ   r�   r%   c                 ó&   — | j                   dz  dk(  S )Nr~   r   r   r?   s    r&   ÚisregzArchiveEntry.isregÐ   r�   r%   c                 ó   — | j                   S r(   )r�   r?   s    r&   ÚisfilezArchiveEntry.isfileÔ   s   € à�z‰zÐr%   c                 ó&   — | j                   dz  dk(  S )Nr~   r   r   r?   s    r&   ÚissockzArchiveEntry.issockØ   r�   r%   c                 ón   — | j                   xs( | j                  xs | j                  xs | j                  S r(   )rƒ   r€   r‡   r”   r?   s    r&   ÚisdevzArchiveEntry.isdevÜ   s'   € à�z‰zÒE˜TŸZ™ZÒE¨4¯;©;ÒE¸$¿+¹+ÐEr%   c                 óÖ   — t        j                  | j                  «      sy t        j                  | j                  «      }t        j                  | j                  «      }t        ||«      S r(   )r   Úentry_atime_is_setr6   Úentry_atimeÚentry_atime_nsecr2   ©r:   Úsec_valÚnsec_vals      r&   ÚatimezArchiveEntry.atimeà   óJ   € ä×%Ñ% d§m¡mÔ4ØÜ—/‘/ $§-¡-Ó0ˆÜ×'Ñ'¨¯©Ó6ˆÜ˜7 HÓ-Ð-r%   c                 óJ  — |€ t        j                  | j                  «       y t        |t        «      r| j                  |«       y t        |t        «      r | j
                  |Ž  y t        j                  |«      \  }}| j                  t	        |«      t	        |dz  «      «       y ©Ni Êš;)	r   Úentry_unset_atimer6   re   r/   Ú	set_atimeÚtupleÚmathÚmodf©r:   rH   r0   Úfractions       r&   rž   zArchiveEntry.atimeè   óv   € àˆ=Ü×!Ñ! $§-¡-Õ0Ü˜œsÔ#Ø�N‰N˜5Õ!Ü˜œuÔ%ØˆD�N‰N˜EÒ"ä $§	¡	¨%Ó 0ÑˆG�XØ�N‰Nœ3˜w›<¬¨X¸Ñ-EÓ)FÕGr%   c                 óD   — t        j                  | j                  ||«      S )zFKept for backward compatibility. `entry.atime = ...` is supported now.)r   Úentry_set_atimer6   ©r:   Útimestamp_secÚtimestamp_nsecs      r&   r£   zArchiveEntry.set_atimeô   ó   € ä×"Ñ" 4§=¡=°-ÀÓPÐPr%   c                 óÖ   — t        j                  | j                  «      sy t        j                  | j                  «      }t        j                  | j                  «      }t        ||«      S r(   )r   Úentry_mtime_is_setr6   Úentry_mtimeÚentry_mtime_nsecr2   r›   s      r&   ÚmtimezArchiveEntry.mtimeø   rŸ   r%   c                 óJ  — |€ t        j                  | j                  «       y t        |t        «      r| j                  |«       y t        |t        «      r | j
                  |Ž  y t        j                  |«      \  }}| j                  t	        |«      t	        |dz  «      «       y r¡   )	r   Úentry_unset_mtimer6   re   r/   Ú	set_mtimer¤   r¥   r¦   r§   s       r&   r´   zArchiveEntry.mtime   r©   r%   c                 óD   — t        j                  | j                  ||«      S )zFKept for backward compatibility. `entry.mtime = ...` is supported now.)r   Úentry_set_mtimer6   r¬   s      r&   r·   zArchiveEntry.set_mtime  r¯   r%   c                 óÖ   — t        j                  | j                  «      sy t        j                  | j                  «      }t        j                  | j                  «      }t        ||«      S r(   )r   Úentry_ctime_is_setr6   Úentry_ctimeÚentry_ctime_nsecr2   r›   s      r&   ÚctimezArchiveEntry.ctime  rŸ   r%   c                 óJ  — |€ t        j                  | j                  «       y t        |t        «      r| j                  |«       y t        |t        «      r | j
                  |Ž  y t        j                  |«      \  }}| j                  t	        |«      t	        |dz  «      «       y r¡   )	r   Úentry_unset_ctimer6   re   r/   Ú	set_ctimer¤   r¥   r¦   r§   s       r&   r¾   zArchiveEntry.ctime  r©   r%   c                 óD   — t        j                  | j                  ||«      S )zFKept for backward compatibility. `entry.ctime = ...` is supported now.)r   Úentry_set_ctimer6   r¬   s      r&   rÁ   zArchiveEntry.set_ctime$  r¯   r%   c                 óÖ   — t        j                  | j                  «      sy t        j                  | j                  «      }t        j                  | j                  «      }t        ||«      S r(   )r   Úentry_birthtime_is_setr6   Úentry_birthtimeÚentry_birthtime_nsecr2   r›   s      r&   Ú	birthtimezArchiveEntry.birthtime(  sL   € ä×)Ñ)¨$¯-©-Ô8ØÜ×%Ñ% d§m¡mÓ4ˆÜ×+Ñ+¨D¯M©MÓ:ˆÜ˜7 HÓ-Ð-r%   c                 óJ  — |€ t        j                  | j                  «       y t        |t        «      r| j                  |«       y t        |t        «      r | j
                  |Ž  y t        j                  |«      \  }}| j                  t	        |«      t	        |dz  «      «       y r¡   )	r   Úentry_unset_birthtimer6   re   r/   Úset_birthtimer¤   r¥   r¦   r§   s       r&   rÈ   zArchiveEntry.birthtime0  s|   € àˆ=Ü×%Ñ% d§m¡mÕ4Ü˜œsÔ#Ø×Ñ˜uÕ%Ü˜œuÔ%ØˆD×Ñ Ò&ä $§	¡	¨%Ó 0ÑˆG�XØ×Ñœs 7›|¬S°¸MÑ1IÓ-JÕKr%   c                 óD   — t        j                  | j                  ||«      S )zJKept for backward compatibility. `entry.birthtime = ...` is supported now.)r   Úentry_set_birthtimer6   r¬   s      r&   rË   zArchiveEntry.set_birthtime<  s    € ä×&Ñ&Ø�M‰M˜=¨.ó
ð 	
r%   c                 óæ   — t        j                  | j                  «      }|s?t        j                  | j                  «      }|�	 |j	                  | j
                  «      }|S |S # t        $ r Y |S w xY wr(   )r   Úentry_pathname_wr6   Úentry_pathnamer^   r7   r_   ©r:   Úpaths     r&   rB   zArchiveEntry.pathnameB  sp   € ä×#Ñ# D§M¡MÓ2ˆÙÜ×%Ñ% d§m¡mÓ4ˆDØÐðØŸ;™; t×'8Ñ'8Ó9�Dð ˆˆtˆøô $ò ØØˆðúrb   c                 óú   — t        |t        «      s|j                  | j                  «      }| j                  dk(  r!t	        j
                  | j                  |«       y t	        j                  | j                  |«       y rd   )re   rf   rg   r7   r   Úentry_update_pathname_utf8r6   Úentry_copy_pathnamerN   s     r&   rB   zArchiveEntry.pathnameN  sV   € ä˜%¤Ô'Ø—L‘L ×!2Ñ!2Ó3ˆEØ×Ñ Ò'Ü×*Ñ*¨4¯=©=¸%Õ@ä×#Ñ# D§M¡M°5Õ9r%   c                 óš  — | j                   r@t        j                  | j                  «      xs_ t        j                  | j                  «      n?t        j
                  | j                  «      xs t        j                  | j                  «      }t        |t        «      r	 |j                  | j                  «      }|S |S # t        $ r Y |S w xY wr(   )rŽ   r   Úentry_symlink_wr6   Úentry_symlinkrŠ   r‹   re   rf   r^   r7   r_   rÑ   s     r&   ÚlinkpathzArchiveEntry.linkpathW  s­   € ð —’ô ×#Ñ# D§M¡MÓ2ò 1Ü×!Ñ! $§-¡-Ô0ä×$Ñ$ T§]¡]Ó3ò 2Ü×"Ñ" 4§=¡=Ó1ð 	ô �dœEÔ"ðØ—{‘{ 4×#4Ñ#4Ó5�ð ˆˆtˆøô  ò ØØˆðús   ÂB= Â=	C
Ã	C
c                 óú   — t        |t        «      s|j                  | j                  «      }| j                  dk(  r!t	        j
                  | j                  |«       y t	        j                  | j                  |«       y rd   )re   rf   rg   r7   r   Úentry_update_link_utf8r6   Úentry_copy_linkrN   s     r&   rÙ   zArchiveEntry.linkpathi  sV   € ä˜%¤Ô'Ø—L‘L ×!2Ñ!2Ó3ˆEØ×Ñ Ò'Ü×&Ñ& t§}¡}°eÕ<ä×Ñ §¡¨uÕ5r%   zalias of pathname)Údoczalias of linkpathc                 ó€   — t        j                  | j                  «      rt        j                  | j                  «      S y r(   )r   Úentry_size_is_setr6   Ú
entry_sizer?   s    r&   ÚsizezArchiveEntry.sizew  s,   € ä× Ñ  §¡Ô/Ü—>‘> $§-¡-Ó0Ð0ð 0r%   c                 óˆ   — |€ t        j                  | j                  «       y t        j                  | j                  |«       y r(   )r   Úentry_unset_sizer6   Úentry_set_sizerN   s     r&   rá   zArchiveEntry.size|  s-   € àˆ=Ü× Ñ  §¡Õ/ä×Ñ˜tŸ}™}¨eÕ4r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Ú
entry_moder6   r?   s    r&   ÚmodezArchiveEntry.modeƒ  ó   € ä�~‰~˜dŸm™mÓ,Ð,r%   c                 óD   — t        j                  | j                  |«       y r(   )r   Úentry_set_moder6   rN   s     r&   rç   zArchiveEntry.mode‡  ó   € ä×Ñ˜4Ÿ=™=¨%Õ0r%   c                 ó\   — t        j                  | j                  «      j                  «       S )z.The file's mode as a string, e.g. '?rwxrwx---')r   Úentry_strmoder6   Ústripr?   s    r&   ÚstrmodezArchiveEntry.strmode‹  s"   € ô
 × Ñ  §¡Ó/×5Ñ5Ó7Ð7r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Ú
entry_permr6   r?   s    r&   ÚpermzArchiveEntry.perm’  rè   r%   c                 óD   — t        j                  | j                  |«       y r(   )r   Úentry_set_permr6   rN   s     r&   rò   zArchiveEntry.perm–  rë   r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Ú
entry_rdevr6   r?   s    r&   ÚrdevzArchiveEntry.rdevš  rè   r%   c                 óò   — t        |t        «      rGt        j                  | j                  |d   «       t        j
                  | j                  |d   «       y t        j                  | j                  |«       y )Nr   r   )re   r¤   r   Úentry_set_rdevmajorr6   Úentry_set_rdevminorÚentry_set_rdevrN   s     r&   r÷   zArchiveEntry.rdevž  sP   € ä�eœUÔ#Ü×#Ñ# D§M¡M°5¸±8Ô<Ü×#Ñ# D§M¡M°5¸±8Õ<ä×Ñ˜tŸ}™}¨eÕ4r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Úentry_rdevmajorr6   r?   s    r&   Ú	rdevmajorzArchiveEntry.rdevmajor¦  ó   € ä×"Ñ" 4§=¡=Ó1Ð1r%   c                 óD   — t        j                  | j                  |«       y r(   )r   rù   r6   rN   s     r&   rþ   zArchiveEntry.rdevmajorª  ó   € ä×Ñ §¡¨uÕ5r%   c                 ó@   — t        j                  | j                  «      S r(   )r   Úentry_rdevminorr6   r?   s    r&   Ú	rdevminorzArchiveEntry.rdevminor®  rÿ   r%   c                 óD   — t        j                  | j                  |«       y r(   )r   rú   r6   rN   s     r&   r  zArchiveEntry.rdevminor²  r  r%   c                 óh   — t         j                  D �ci c]  }|| j                  |«      “Œ c}S c c}w )aÂ  The file's hashes stored in the archive.

        libarchive only supports reading and writing digests from and to 'mtree'
        files. Setting the digests requires at least version 3.8.0 of libarchive
        (released in May 2025). It also requires including the names of the
        digest algorithms in the string of options passed to the archive writer
        (e.g. `file_writer(archive_path, 'mtree', options='md5,rmd160,sha256')`).
        )r   ÚDIGEST_ALGORITHMSÚget_stored_digest)r:   rG   s     r&   Ústored_digestszArchiveEntry.stored_digests¶  s0   € ô @C×?TÑ?TÖU°t��d×,Ñ,¨TÓ2Ñ2ÒUÐUùÒUs   “/c                 óX   — |j                  «       D ]  \  }}| j                  ||«       Œ y r(   )rE   Úset_stored_digest)r:   ÚvaluesrG   rH   s       r&   r	  zArchiveEntry.stored_digestsÂ  s+   € à!Ÿ<™<›>ò 	0‰KˆD�%Ø×"Ñ" 4¨Õ/ñ	0r%   c           
      ó¦  — t         j                  |   }	 t        j                  | j                  |j                  «      }t        ||j                  «      S # t
        $ r4 t        dt        j                  «       › dt         j                  › d�«      d ‚t        $ r7 t        dt        j                  «       › dt         j                  › d|› d�«      d ‚w xY w)Nú#the libarchive being used (version ú, path z') doesn't support reading entry digestsú) doesn't support ú digests)r   r  Úentry_digestr6   Úlibarchive_idÚAttributeErrorÚNotImplementedErrorÚversion_numberÚlibarchive_pathr	   r   Úbytes_length)r:   Úalgorithm_nameÚ	algorithmÚptrs       r&   r  zArchiveEntry.get_stored_digestÇ  sÞ   € Ü×)Ñ)¨.Ñ9ˆ	ð	Ü×"Ñ" 4§=¡=°)×2IÑ2IÓJˆCô ˜˜i×4Ñ4Ó5Ð5øô ò 	Ü%Ø5´c×6HÑ6HÓ6JÐ5KÈ7Ü×&Ñ&Ð'Ð'NðPóð ðô ò 	Ü%Ø5´c×6HÑ6HÓ6JÐ5KÈ7Ü×&Ñ&Ð'Ð'9¸.Ð9IÈðSóð ðð	ús   •*A ÁA;Cc           	      ó   — t         j                  |   }|j                  }t        |«      |k7  rt	        d|› dt        |«      › �«      ‚	 t        j
                  | j                  |j                  |t         j                  z  j                  |«      «      }|dk  r6t        dt        j                  «       › dt         j                  › d|› d�«      d ‚y # t        $ r4 t        dt        j                  «       › dt         j                  › d�«      d ‚w xY w)	Nzinvalid input digest: expected z bytes, got r  r  z') doesn't support writing entry digestsr   r  r  )r   r  r  ÚlenÚ
ValueErrorÚentry_set_digestr6   r  Úc_ubyteÚfrom_buffer_copyr  r  r  r  )r:   r  rH   r  Úexpected_lengthÚretcodes         r&   r  zArchiveEntry.set_stored_digest×  s(  € Ü×)Ñ)¨.Ñ9ˆ	Ø#×0Ñ0ˆÜˆu‹:˜Ò(ÜØ1°/Ð1Bð CÜ˜5“z�lð$óð ð
	Ü×*Ñ*Ø—‘Ø×'Ñ'Ø ¤3§;¡;Ñ.×@Ñ@ÀÓGóˆGð �QŠ;Ü%Ø5´c×6HÑ6HÓ6JÐ5KÈ7Ü×&Ñ&Ð'Ð'9¸.Ð9IÈðSóð ðð øô ò 	Ü%Ø5´c×6HÑ6HÓ6JÐ5KÈ7Ü×&Ñ&Ð'Ð'NðPóð ðð	ús   Á	AC Ã=Drd   r(   )r   )5r   r   r   Ú	__slots__r=   r@   rC   r9   ÚpropertyrK   ÚsetterrQ   rX   r`   rn   r   Ú	page_sizer|   r€   rƒ   r…   r‡   rŒ   rŽ   r�   r’   r”   r–   rž   r£   r´   r·   r¾   rÁ   rÈ   rË   rB   rÙ   ÚfgetÚfsetrÒ   rG   Úlinknamerá   rç   rï   rò   r÷   rþ   r  r	  r  r  r$   r%   r&   r4   r4   $   s†  „ à:€Ió&ò&òó!'ðF ñ1ó ð1ð ‡_�_ñ5ó ð5ð ñ,ó ð,ð 	‡Z�Zñ.ó ð.ð ñ,ó ð,ð 	‡Z�Zñ.ó ð.ð ñ	ó ð	ð ‡\�\ñ7ó ð7ð ñ	ó ð	ð ‡\�\ñ7ó ð7ð %(§M¡Mó .ð( ñ4ó ð4ð ñ4ó ð4ð ñ4ó ð4ð ñ4ó ð4ð ñ7ó ð7ð ñ4ó ð4ð ñ4ó ð4ð ñó ðð ñ4ó ð4ð ñFó ðFð ñ.ó ð.ð ‡\�\ñ	Hó ð	HóQð ñ.ó ð.ð ‡\�\ñ	Hó ð	HóQð ñ.ó ð.ð ‡\�\ñ	Hó ð	HóQð ñ.ó ð.ð ×Ññ	Ló ð	Ló
ð ñ	ó ð	ð ‡_�_ñ:ó ð:ð ñó ðð" ‡_�_ñ6ó ð6ñ �H—M‘M 8§=¡=Ð6IÔJ€DØ€DÙ˜Ÿ™ x§}¡}Ð:MÔN€Hàñ1ó ð1ð 
‡[�[ñ5ó ð5ð ñ-ó ð-ð 
‡[�[ñ1ó ð1ð ñ8ó ð8ð ñ-ó ð-ð 
‡[�[ñ1ó ð1ð ñ-ó ð-ð 
‡[�[ñ5ó ð5ð ñ2ó ð2ð ×Ññ6ó ð6ð ñ2ó ð2ð ×Ññ6ó ð6ð ñ	Vó ð	Vð ×Ññ0ó ð0ò6ó r%   r4   c                   ó   — e Zd ZdZd„ Zy)rv   r$   c                 ó   — t        d«      ‚)Nz/the content of this entry has already been read©rs   ©r:   Úkws     r&   r|   zConsumedArchiveEntry.get_blocksõ  s   € ÜÐIÓJÐJr%   N©r   r   r   r$  r|   r$   r%   r&   rv   rv   ñ  s   „ à€IóKr%   rv   c                   ó   — e Zd ZdZd„ Zy)ÚPassedArchiveEntryr$   c                 ó   — t        d«      ‚)Nz7this entry is passed, it's too late to read its contentr-  r.  s     r&   r|   zPassedArchiveEntry.get_blocksý  s   € ÜÐQÓRÐRr%   Nr0  r$   r%   r&   r2  r2  ù  s   „ à€IóSr%   r2  )Ú
contextlibr   Úctypesr   r   Úenumr   r¥   Ú r   Ú	exceptionr	   r   r,   r2   r4   rv   r2  r$   r%   r&   ú<module>r9     se   ðÝ %ß 2Ý Û å Ý #ô*ˆwô *ð ñ ó ð ò÷Jñ JôZK˜<ô KôS˜õ Sr%   