/usr/lib/python3/dist-packages/debian/__pycache__
Edit: /usr/lib/python3/dist-packages/debian/__pycache__/debfile.cpython-310.pyc (13218B)
o
a~bM> @ st d Z ddlZddlZddlZddlZddlZz$ddlmZm Z m
Z
mZmZm
Z
mZmZmZmZmZmZ ddlmZ W n eyI esGdd ZY nw ddlmZmZmZ ddlmZ dd lmZ d
ZdZ g dZ!d
Z"g dZ#dZ$dZ%dZ&dZ'G dd deZ(G dd de)Z*G dd de*Z+G dd de*Z,G dd deZ-e.dkre-ej/d dZ0e0j12 Z2e3e24d dS dS ) zX Representation of Debian binary package (.deb) files
Debfile Classes
===============
N)AnyBinaryIODictIOIteratorListOptionalTextTypeVarUnionoverload
TYPE_CHECKING)Literalc C d S N )fr r 0/usr/lib/python3/dist-packages/debian/debfile.py
4 s r )ArFileArErrorArMember) Changelog)Deb822zdata.tarzcontrol.tar)gzbz2xzlzmazstz
debian-binary)preinstpostinstprermpostrmconfigcontrolzusr/share/doc/%s/changelog.gzz$usr/share/doc/%s/changelog.Debian.gzmd5sumsc @ e Zd ZdS )DebErrorN__name__
__module____qualname__r r r r r' H s r' c @ s e Zd ZdZdd Zdd Zedd Zdd Ze dddZ
e dd
dZ
dddZ
e
dddZe
dddZ
dddZdd Zdd Z
dd Zdd Zd
S )DebParta 'Part' of a .deb binary package.
A .deb package is considered as made of 2 parts: a 'data' part
(corresponding to the possibly compressed 'data.tar' archive embedded
in a .deb) and a 'control' part (the 'control.tar.gz' archive). Each of
them is represented by an instance of this class. Each archive should
be a compressed tar archive although an uncompressed data.tar is permitted;
supported compression formats are: .tar.gz, .tar.bz2, .tar.xz .
When referring to file members of the underlying .tar.gz archive, file
names can be specified in one of 3 formats "file", "./file", "/file". In
all cases the file is considered relative to the root of the archive. For
the control part the preferred mechanism is the first one (as in
deb.control.get_content('control') ); for the data part the preferred
mechanism is the third one (as in deb.data.get_file('/etc/vim/vimrc') ).
c C s || _ d | _d S r )_DebPart__member
_DebPart__tgz)selfmemberr r r __init__^ s
zDebPart.__init__c
s fdd} j du r^ jj}tj|d dd }|tv s'|tks'|tkrX|dkr2|ddg}n j}zt j
|dd _ W j S t jt jfyW } zt
d
| d}~ww t
d| j S )zReturn a TarFile object corresponding to this part of a .deb
package.
Despite the name, this method gives access to various kind of
compressed tar archives, not only gzipped ones.
c
s zdd l }dd l dd l}|j| |j|jd fddd}W n ttfy2 } ztd| d }~ww |j
d }|jdkrItd|j ||S )Nr Fc s j jS r )signalSIGPIPESIG_DFLr r2 r r r x s z9DebPart.tgz.._custom_decompress..)stdinstdoutuniversal_newlines
preexec_fnz%sz!command has failed with code '%s')
subprocessr2 ioPopenPIPEOSError
ValueErrorr' communicater- read
returncodeBytesIO)command_listr: r; procedatar/ r5 r _custom_decompressl s(
z'DebPart.tgz.._custom_decompressN r unzstdz--stdoutzr:*)fileobjmodez#tarfile has returned an error: '%s'z"part '%s' has unexpected extension)r. r- nameospathsplitext PART_EXTS DATA_PART CTRL_PARTtarfileopen ReadErrorCompressionErrorr' )r/ rI rN extensionbufferrF r rH r tgzc s"
zDebPart.tgzc C s4 | dr
| dd } | S | dr| dd } | S )zw try (not so hard) to obtain a member file name in a form relative
to the .tar.gz root and with no heading '.' ./ N/rJ )
startswith)fnamer r r __normalize_member s
zDebPart.__normalize_memberc C s" t |}| }d| |v S )z.Check if this part contains a given file name.r\ )r, _DebPart__normalize_memberr[ getnames)r/ r` namesr r r has_file s
zDebPart.has_fileNc C r r r r/ r` encodingerrorsr r r get_file zDebPart.get_filec C r r r rf r r r ri rj c C sH t |}| d| }|du rtd|dur"tj|||dS |S )zReturn a file object corresponding to a given file name.
If encoding is given, then the file object will return Unicode data;
otherwise, it will return binary data.
r\ NzFile not found inside packagerg rh )r, rb r[ extractfiler' r;
TextIOWrapper)r/ r` rg rh fobjr r r ri s
c C r r r rf r r r get_content zDebPart.get_contentc C r r r rf r r r ro rp c C s, | j |||d}d}|r| }| |S )zReturn the string content of a given file, or None (e.g. for
directories).
If encoding is given, then the content will be a Unicode object;
otherwise, it will contain binary data.
rk N)ri rA close)r/ r` rg rh r contentr r r ro s
c C s t | S r )iterr[ rc rH r r r __iter__ s zDebPart.__iter__c C
| |S r )re r/ r` r r r __contains__
zDebPart.__contains__c C ru r )ro rv r r r __getitem__ rx zDebPart.__getitem__c C s | j d S r )r- rq rH r r r rq s z
DebPart.closeNNr )r) r* r+ __doc__r1 r[ staticmethodrb re r ri ro rt rw ry rq r r r r r, L s4 5
r, c @ r&