%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/apport/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/apport/__pycache__/sandboxutils.cpython-312.pyc

�

�s�f�2���dZddlZddlZddlZddlZddlZddlZddlZddl	m
Zd�Zd�Z
dd�Zdeeedezfddfd	�Z						dd
ej&dedzdedzd
edzdeedzdedededeeeeffd�Zy)zFunctions to manage sandboxes.�N)�implc�d�i}|jdd��d|jdd���j�D]/}|j�s�	|j�dd\}}|||<�1t|j��S#t$r#t
jjd|�Y�vwxYw)z�Determine necessary packages for given report.

    Return list of (pkgname, version) pairs. version might be None for unknown
    package versions.
    �Package��
�DependenciesN��%invalid Package/Dependencies line: %s)
�get�
splitlines�strip�split�
ValueError�apport�logging�warning�list�items)�report�pkgs�line�pkg�versions     �5/usr/lib/python3/dist-packages/apport/sandboxutils.py�needed_packagesrs����D��:�:�i��$�
%�R��
�
�>�2�(F�'G�H��j�l����z�z�|��	�!�Z�Z�\�"�1�-�N�S�'�
��S�	����
�
�����
�	��N�N�"�"�#J�D�Q��	�s�
B�)B/�.B/c�6�i}|jdd��d|jdd���j�D]/}|j�s�	|j�dd\}}|||<�1|S#t$r#t
jjd|�Y�_wxYw)z1Return package -> version dictionary from report.rrrrNr	r
)rrr
rrrrr)r�pkg_versrrrs     r�report_package_versionsr1s����H��:�:�i��$�
%�R��
�
�>�2�(F�'G�H��j�l� ���z�z�|��	�!�Z�Z�\�"�1�-�N�S�'�
 ���
� ��O��
�	��N�N�"�"�#J�D�Q��	�s�
A,�,)B�Bc
�z�t�}t�}d|vr�|dj�D]t}|j�s�|j�}t	|�dvs�2d|dvs�:d|dvs�Bt
jj|d�}|j|��vn0tjj|d�j�}t
jj|�stj|�|D]�}tj |d||d	|j#d
���}	|	r:|r&tj$j'd|�d
|	�d��|j|	��ktj$j)d|���|D�
cgc]}
|
|j#|
�f��c}
Scc}
w)a�Determine necessary runtime packages for given report.

    This determines libraries dynamically loaded at runtime in two cases:
    1. The executable has already run: /proc/pid/maps is used, from the report
    2. The executable has not already run: shared_libraries() is used

    The libraries are resolved to the packages that installed them.

    Return list of (pkgname, None) pairs.

    When pkgmap_cache_dir is specified, it is used as a cache for
    get_file_package().
    �ProcMaps>���x�z.so��ExecutablePathT�
DistroRelease�Architecture��release�archzdynamically loaded z needs package z
, queueingz/%s is needed, but cannot be mapped to a package)�setrr
r�len�os�path�realpath�addr�	fileutils�shared_libraries�values�exists�makedirs�	packaging�get_file_packagerr�logr)r�pkgmap_cache_dir�pkg_versions�verboser�libsr�cols�libr�ps           r�needed_runtime_packagesrADs��� �5�D��5�D��V���:�&�1�1�3�	�D��:�:�<���:�:�<�D��4�y�F�"�s�d�1�g�~�%�4��7�:J��g�g�&�&�t�A�w�/������
�
	����0�0��8H�1I�J�Q�Q�S��
�7�7�>�>�*�+�
���$�%�����(�(�����?�+����N�+�
�������"�"�)�$���s�e�:�N��
�H�H�S�M��N�N�"�"�A�4�
��&/3�3��Q�� � ��#�$�3�3��3s�F8r�returnc�p�t|�D](\}\}}|dk(s�|j|�d|fg|ddyy)z2Move base-files to the front or add it if missing.z
base-filesNr)�	enumerate�pop)r�irrs    r�_move_base_files_firstrG{sG��&�t�_����>�C���,���H�H�Q�K�%�w�/�0�D��!�H��	�r�
config_dir�	cache_dir�sandbox_dir�extra_packagesr<�log_timestamps�dynamic_originsc�N
�|rVtjj|�}tjj|�stj|�d}n<tjd��}tjtj|�d}|r tjj|�}n:tjd��}tjtj|�tjj||d�}	g}
d|vs'd|jd	d
�|jdd
�zvrt|�}
|dk(rd
}d
}|rz|jd	d
��d|jdd
���}tjd�}
t!|
j#|��}|r"t$j&j)d|���t+|
�	t-j.|||d|
||||jd�|��	}|rF	t-j.|||d|D�cgc]}|d
f��c}||||jd�|dd��z
}t7|�}t9||	||�}
dD]�}||vs�t-j:||d|	|d|jd���}|dk(r|ddk(rd|d<d}|rIt$j&j)d|�d|��|�|
j=||j|�f���t$j&j3d|||���|
r4	t-j.|||d|
||||jd�|��	z
}d	|vr�dD]�}||vs�tjj?|||z�r�.||jAd�r`tjj?|||d d
z�r||d d
||<�vt$j&j3d!||||z|d	���t$j&j3d!||||z|d	���r||d"<t$j&jCd#�|||fS#t0$r4}t$j&j3dt5|��Yd
}~���d
}~wwxYwcc}w#t0$r4}t$j&j3dt5|��Yd
}~���d
}~wwxYw#t0$r4}t$j&j3dt5|��Yd
}~���d
}~wwxYw)$a1	Build a sandbox with the packages that belong to a particular report.

    This downloads and unpacks all packages from the report's Package and
    Dependencies fields, plus all packages that ship the files from ProcMaps
    (often, runtime plugins do not appear in Dependencies), plus optionally
    some extra ones, for the distro release and architecture of the report.

    For unpackaged executables, there are no Dependencies. Packages for shared
    libraries are unpacked.

    report is an apport.Report object to build a sandbox for. Presence of the
    Package field determines whether to determine dependencies through
    packaging (via the optional report['Dependencies'] field), or through ldd
    via needed_runtime_packages() -> shared_libraries().  Usually
    report['Architecture'] and report['Uname'] are present.

    config_dir points to a directory with by-release configuration files for
    the packaging system, or "system"; this is passed to
    apport.packaging.install_packages(), see that method for details.

    cache_dir points to a directory where the downloaded packages and debug
    symbols are kept, which is useful if you create sandboxes very often. If
    not given, the downloaded packages get deleted at program exit.

    sandbox_dir points to a directory with a permanently unpacked sandbox with
    the already unpacked packages. This speeds up operations even further if
    you need to create sandboxes for different reports very often; but the
    sandboxes can become very big over time, and you must ensure that an
    already existing sandbox matches the DistroRelease: and Architecture: of
    report. If not given, a temporary directory will be created which gets
    deleted at program exit.

    extra_packages can specify a list of additional packages to install which
    are not derived from the report and will be installed along with their
    dependencies.

    If verbose is True (False by default), this will write some additional
    logging to stdout.

    If log_timestamps is True, these log messages will be prefixed with the
    current time.

    If dynamic_origins is True (False by default), the sandbox will be built
    with packages from foreign origins that appear in the report's
    Packages:/Dependencies:.

    Return a tuple (sandbox_dir, cache_dir, outdated_msg).
    T�apport_sandbox_)�prefixF�
apport_cache_r'r z[originrrr�systemNrz+\[origin: ([a-zA-Z0-9][a-zA-Z0-9\+\.\-]+)\]z	Origins: r()�architecture�originsz%s)rTrU�install_dbg�install_deps)�InterpreterPathr&r)�	systemctl�
SourcePackage�systemdz/bin/systemctlr&zInstalling extra package z to get z%Cannot find package which ships %s %sz/usr�z2%s %s does not exist (report specified package %s)�RetraceOutdatedPackagesz
built sandbox)"r.r/�abspath�isdirr6�tempfile�mkdtemp�atexit�register�shutil�rmtree�joinrr�re�compiler,�findallrrr9rGr7�install_packages�SystemError�fatal�strrrAr8�appendr5�
startswith�memdbg)rrIrJrKrLr<rMrN�permanent_rootdirr:rrU�pkg_list�match�outdated_msg�errorr@r;r/rs                    r�make_sandboxrv�s���z��g�g�o�o�k�2���w�w�}�}�[�)��K�K��$� ���&�&�.?�@������
�
�{�3�!����G�G�O�O�I�.�	��$�$�O�<�	�����
�
�y�1��w�w�|�|�I�v�o�/F�G��
�D�
���9��
�
�9�b�!�F�J�J�~�r�$B�B�$��v�&���X���
��G���j�j��B�/�0��6�:�:�n�b�3Q�2R�S���
�
�I�J���e�m�m�H�-�.����N�N����7�)�4�5��4� �
/� �1�1����?�#��������N�3��

���	3��I�6�6�����'�$2�3�q�!�T��3���!�#�Z�Z��7��!�!��
�L� +�6�2�L�"�6�+;�\�7�S�D�6����6�>��,�,��t��� ���/��Z�Z��/��C��k�!��/�*�i�7�/?�F�+�,�#�C�����"�"�/��u�H�T�F�C�^�����S�,�"2�"2�3�"7�8�9����$�$�;�T�6�$�<��/�8�
	3��I�6�6�����'����!�#�Z�Z��7��
�

�L�$�F��9�	�D��v�~�b�g�g�n�n�[�6�$�<�5O�&P��$�<�*�*�6�2��w�w�~�~�k�F�4�L���4D�&D�E�'-�d�|�A�B�'7��t�����,�,�P� �'�&��,�6�"�9�-�	��N�N�(�(�L��#�f�T�l�2��y�)�	�	�(�,8��(�)�
�N�N���/�*��	�<�/�/��K�/������T�3�u�:�.�.��/��4���	3��N�N� � ��s�5�z�2�2��	3��b�	3��N�N� � ��s�5�z�2�2��	3�sZ�0Q"�R'�*R"�5 R'�/3S'�"	R�+)R�R�"R'�'	S$�0)S�S$�'	T$�0)T�T$)F)NNNFFF)�__doc__rbr.rgrdr`�apport.fileutilsr�apport.logging�apport.packaging_implrr7rrrAr�tuplermrG�Report�boolrv�rHr�<module>rs���$��	�	�
����3��2�&44�n��e�C����O�&<�!=��$��!�"�'+�� �!�Z0��M�M�Z0��d�
�Z0��T�z�Z0��t��	Z0�
��I��$�Z0��
Z0��Z0��Z0��3��S�=��Z0rH

Zerion Mini Shell 1.0