403Webshell
Server IP : 35.236.43.222  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64
User : deploy ( 1002)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/debian/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/debian/__pycache__/debfile.cpython-39.pyc
a

|P�_VB�@srdZddlmZmZddlZddlZddlZddlZzDddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZddlmZWney�dd�ZYn0ddlmZmZmZdd	lmZdd
lmZdZ dZ!gd
�Z"dZ#gd�Z$dZ%dZ&dZ'dZ(Gdd�de�Z)Gdd�de*�Z+Gdd�de+�Z,Gdd�de+�Z-Gdd�de�Z.e/dk�rne.ej0dd �Z1e1j2�3�Z3e4e3�5d��dS)!zX Representation of Debian binary package (.deb) files


Debfile Classes
===============
�)�absolute_import�print_functionN)�Any�BinaryIO�Dict�IO�Iterator�List�Optional�Text�TypeVar�Union�overload)�LiteralcCsdS�N�)�frr�0/usr/lib/python3/dist-packages/debian/debfile.py�<lambda>3�r)�ArFile�ArError�ArMember)�	Changelog)�Deb822zdata.tarzcontrol.tar)�gz�bz2�xzZlzmaz
debian-binary)ZpreinstZpostinstZprermZpostrmZconfig�controlzusr/share/doc/%s/changelog.gzz$usr/share/doc/%s/changelog.Debian.gz�md5sumsc@seZdZdS)�DebErrorN��__name__�
__module__�__qualname__rrrrr Gsr c@s�eZdZdZdd�Zdd�Zedd��Zdd	�Ze	ddd��Z
e	d d
d��Z
d!dd�Z
e	d"dd��Ze	d#dd��Zd$dd�Zdd�Zdd�Z
ejddkr�dd�Zdd�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') ).
    cCs||_d|_dSr)�_DebPart__member�
_DebPart__tgz)�self�memberrrr�__init__]szDebPart.__init__c	
st|jdu�rn|jj}tj�|�ddd�}|tvsF|tksF|tk�rbt	j
dk�r
|dk�r
z@ddl}ddl�ddl
}|jddg|j|jd�fd	d
�d�}Wn4ttfy�}ztd|��WYd}~n
d}~00|�|j���d}|jdkr�td
|j��|�|�}n|j}ztj|dd�|_Wn:tjtjf�y^}ztd|��WYd}~n
d}~00ntd|��|jS)z�Return 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.
        N�)�r,rrZunxzz--stdoutFcs���j�j�Sr)�signal�SIGPIPE�SIG_DFLr�r-rrr|szDebPart.tgz.<locals>.<lambda>)�stdin�stdoutZuniversal_newlinesZ
preexec_fnz%sz!command has failed with code '%s'zr:*)�fileobj�modez#tarfile has returned an error: '%s'z"part '%s' has unexpected extension)r'r&�name�os�path�splitext�	PART_EXTS�	DATA_PART�	CTRL_PART�sys�version_info�
subprocessr-�io�Popen�PIPE�OSError�
ValueErrorr Zcommunicate�read�
returncode�BytesIO�tarfile�openZ	ReadErrorZCompressionError)	r(r5�	extensionr>r?�proc�e�data�bufferrr0r�tgzbs<	
�
"
�$zDebPart.tgzcCs2|�d�r|dd�}n|�d�r.|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�/r+)�
startswith)�fnamerrrZ__normalize_member�s


zDebPart.__normalize_membercCs*t�|�}|����}d||vp(||vS)z.Check if this part contains a given file name.rO)r%�_DebPart__normalize_memberrN�getnames)r(rS�namesrrr�has_file�s

�zDebPart.has_fileNcCsdSrr�r(rS�encoding�errorsrrr�get_file�szDebPart.get_filecCsdSrrrXrrrr[�scCs�t�|�}z|���d|�}Wn ty@|���|�}Yn0|durRtd��|dur�tjddkr�ddl}t	|d�s�dd�|_
|j|||d	�Sddl}|dur�d
}|j
|||d�S|S)z�Return 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.
        rONzFile not found inside packagerr,�flushcSsdSrrrrrrr�rz"DebPart.get_file.<locals>.<lambda>�rYrZ�strict)rZ)r%rTrNZextractfile�KeyErrorr r<r=r?�hasattrr\�
TextIOWrapper�codecs�EncodedFile)r(rSrYrZZfobjr?rbrrrr[�s$


cCsdSrrrXrrr�get_content�szDebPart.get_contentcCsdSrrrXrrrrd�scCs,|j|||d�}d}|r(|��}|��|S)z�Return 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.
        r]N)r[rD�close)r(rSrYrZrZcontentrrrrd�s
cCst|�����Sr)�iterrNrU�r(rrr�__iter__�szDebPart.__iter__cCs
|�|�Sr�rW�r(rSrrr�__contains__szDebPart.__contains__rr,cCs
|�|�Srrirjrrr�has_keyszDebPart.has_keycCs
|�|�Sr)rdrjrrr�__getitem__szDebPart.__getitem__cCs|j��dSr)r&rergrrrresz
DebPart.close)NN)N)NN)NN)N)NN)r"r#r$�__doc__r*rN�staticmethodrTrWrr[rdrhrkr<r=rlrmrerrrrr%Ks61
	
��
�
r%c@seZdZdS)�DebDataNr!rrrrrpsrpc@sBeZdZdd�Zdd�Zed
dd��Zeddd��Zdd	d�ZdS)
�
DebControlcCs6i}tD](}|�|�r|�|�}|dur|||<q|S)zo Return a dictionary of maintainer scripts (postinst, prerm, ...)
        mapping script names to script text. N)�
MAINT_SCRIPTSrWrd)r(�scriptsrSrLrrrrss


zDebControl.scriptscCst|�t��S)z� Return the debian/control as a Deb822 (a Debian-specific dict-like
        class) object.

        For a string representation of debian/control try
        .get_content('control') )rrd�CONTROL_FILErgrrr�
debcontrol*szDebControl.debcontrolNcCsdSrr�r(rYrZrrrr4szDebControl.md5sumscCsdSrrrvrrrr9sc	Cs�|�t�stdt��|jt||d�}i}d}|dur:d}|��D]H}|�|��dd�\}}tjddkr�t	|t
�r�|��||<qB|||<qB|��|S)	a� Return a dictionary mapping filenames (of the data part) to
        md5sums. Fails if the control part does not contain a 'md5sum' file.

        Keys of the returned dictionary are the left-hand side values of lines
        in the md5sums member of control.tar.gz, usually file names relative to
        the file system root (without heading '/' or './').

        The returned keys are Unicode objects if an encoding is specified,
        otherwise binary. The returned values are always Unicode.z('%s' file not found, can't list MD5 sumsr]z
Ns
r+rr,)
rW�MD5_FILEr r[�	readlines�rstrip�splitr<r=�
isinstance�bytes�decodere)	r(rYrZZmd5_fileZsums�newline�lineZmd5rSrrrr>s 
�
)NN)N)NN)r"r#r$rsrurrrrrrrqs
rqc@s�eZdZdZddd�Zdd�Zedd	��Zed
d��Zedd
��Z	dd�Z
dd�Zeddd��Z
eddd��Z
ddd�Z
dd�Zdd�ZdS)�DebFilea�Representation of a .deb file (a Debian binary package)

    DebFile objects have the following (read-only) properties:
        - version       debian .deb file format version (not related with the
                        contained package version), 2.0 at the time of writing
                        for all .deb packages in the Debian archive
        - data          DebPart object corresponding to the data.tar.gz (or
                        other compressed or uncompressed tar) archive contained
                        in the .deb file
        - control       DebPart object corresponding to the control.tar.gz (or
                        other compressed tar) archive contained in the .deb
                        file
    N�rcs�t�||||�t|�����fdd�}t�vr<tdt��i|_t|�|t	���|jt	<t
|�|t���|jt<d|_|�t�}|�
���|_|��dS)Ncsj�fdd�tD�}�ttfvr(|�����t|��}|sFtd|��t|�dkr^td|��t|�dS)Ncsg|]}d�|f�qS)z%s.%sr)�.0Zext��basenamerr�
<listcomp>wrzBDebFile.__init__.<locals>.compressed_part_name.<locals>.<listcomp>z9missing required part in given .deb (expected one of: %s)r+z>too many parts in given .deb (was looking for only one of: %s)r)	r9r:r;�append�intersection�setr �len�list)r�Z
candidates�parts�Zactual_namesr�r�compressed_part_nameus"
����z.DebFile.__init__.<locals>.compressed_part_namez4missing required part in given .deb (expected: '%s'))rr*r�rU�	INFO_PARTr �_DebFile__partsrq�	getmemberr;rpr:�_DebFile__pkgnamerD�strip�_DebFile__versionre)r(�filenamer4r3r�rrr�rr*ps(����
zDebFile.__init__cCs|��d|_dS)N�package)rur�rgrrrZ__updatePkgName�szDebFile.__updatePkgNamecCs|jSr)r�rgrrr�version�szDebFile.versioncCs
|jtSr)r�r:rgrrrrL�szDebFile.datacCs
|jtSr)r�r;rgrrrr�szDebFile.controlcCs
|j��S)z See .control.debcontrol() )rrurgrrrru�szDebFile.debcontrolcCs
|j��S)z See .control.scripts() )rrsrgrrrrs�szDebFile.scriptscCsdSrrrvrrrr�szDebFile.md5sumscCsdSrrrvrrrr�scCs|jj||d�S)z See .control.md5sums() r])rrrvrrrr�scCsl|jdur|��t|jt|jfD]@}|j�|�r&tj|j�|�d�}|�	�}|�
�t|�Sq&dS)z� Return a Changelog object for the changelog.Debian.gz of the
        present .deb package. Return None if no changelog can be found. N)r3)r��_DebFile__updatePkgName�CHANGELOG_DEBIAN�CHANGELOG_NATIVErLrW�gzipZGzipFiler[rDrer)r(rSrZ
raw_changelogrrr�	changelog�s
�zDebFile.changelogcCs|j��|j��dSr)rrerLrgrrrre�s
z
DebFile.close)Nr�N)NN)N)NN)r"r#r$rnr*r��propertyr�rLrrursrrr�rerrrrr�`s$
(



r��__main__r+)r�)6rnZ
__future__rrr�rGr<�os.pathr6�typingrrrrrr	r
rrr
rZtyping_extensionsr�ImportErrorZ
debian.arfilerrrZdebian.changelogrZ
debian.deb822rr:r;r9r�rrrtr�r�rwr �objectr%rprqr�r"�argvZdebrrN�printr�rrrr�<module>s@4
KF}



Youez - 2016 - github.com/yon3zu
LinuXploit