%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__/packaging.cpython-312.pyc

�

�!f@3��<�dZddlZddlZddlZddlZGd�d�Zy)�$Abstraction of packaging operations.�Nc���eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Z	dd�Zed��Zd�Zd�Zdd�Zd�Zd�Zd�Z							dd�Zd�Zd�Zd�Zd
Zed��Zd�Zy
)�PackageInforz/etc/default/apportc��td��)zhReturn the installed version of a package.

        Throw ValueError if package does not exist.
        �6this method must be implemented by a concrete subclass��NotImplementedError��self�packages  �2/usr/lib/python3/dist-packages/apport/packaging.py�get_versionzPackageInfo.get_version���
"�D�
�	
�c��td��)zoReturn the latest available version of a package.

        Throw ValueError if package does not exist.
        rrr
s  r
�get_available_versionz!PackageInfo.get_available_version!rrc��td��)z/Return a list of packages a package depends on.rrr
s  r
�get_dependencieszPackageInfo.get_dependencies*���!�D�
�	
rc��td��)zkReturn the source package name for a package.

        Throw ValueError if package does not exist.
        rrr
s  r
�
get_sourcezPackageInfo.get_source0rrc��td��)z�Return package origin.

        Return the repository name from which a package was installed, or None
        if it cannot be determined.

        Throw ValueError if package is not installed.
        rrr
s  r
�get_package_originzPackageInfo.get_package_origin9���"�D�
�	
rc��td��)z�Check package origin.

        Return True if the package is a genuine distro package, or False if it
        comes from a third-party source.

        Throw ValueError if package does not exist.
        rrr
s  r
�is_distro_packagezPackageInfo.is_distro_packageErrc��td��)z�Return the architecture of a package.

        This might differ on multiarch architectures (e. g. an i386 Firefox
        package on a x86_64 system)
        rrr
s  r
�get_architecturezPackageInfo.get_architectureQ���"�D�
�	
rc��td��)zhReturn list of files shipped by a package.

        Throw ValueError if package does not exist.
        rrr
s  r
�	get_fileszPackageInfo.get_files[rrc��td��)z/Return list of all modified files of a package.rrr
s  r
�get_modified_fileszPackageInfo.get_modified_filesdrrc��iS)a?Return modified configuration files of a package.

        Return a file name -> file contents map of all configuration files of
        package. Please note that apport.hookutils.attach_conffiles() is the
        official user-facing API for this, which will ask for confirmation and
        allows filtering.
        �r
s  r
�get_modified_conffilesz"PackageInfo.get_modified_conffilesjs	���	rNc��td��)apReturn the package a file belongs to.

        Return None if the file is not shipped by any package.

        If uninstalled is True, this will also find files of uninstalled
        packages; this is very expensive, though, and needs network access and
        lots of CPU and I/O resources. In this case, map_cachedir can be set to
        an existing directory which will be used to permanently store the
        downloaded maps. If it is not set, a temporary directory will be used.
        Also, release and arch can be set to a foreign release/architecture
        instead of the one from the current system.
        rr)r�file�uninstalled�map_cachedir�release�archs      r
�get_file_packagezPackageInfo.get_file_packagevs��"�D�
�	
rc��td��)zuReturn the architecture of the system.

        This should use the notation of the particular distribution.
        rrr%rr
�get_system_architecturez#PackageInfo.get_system_architecture�rrc��y)z�Return a list of default library search paths.

        The entries should be separated with a colon ':', like for
        $LD_LIBRARY_PATH. This needs to take any multiarch directories into
        account.
        z
/lib:/usr/libr%�rs r
�get_library_pathszPackageInfo.get_library_paths�s��rc��td��)aExplicitly set a distribution mirror URL.

        This might be called for operations that need to fetch distribution
        files/packages from the network.

        By default, the mirror will be read from the system configuration
        files.
        rr)r�urls  r
�
set_mirrorzPackageInfo.set_mirror�s��"�D�
�	
rc��td��)a�Download source package and unpack it into output_dir.

        This also has to care about applying patches etc., so that output_dir
        will eventually contain the actually compiled source. output_dir needs
        to exist and should be empty.

        If version is given, this particular version will be retrieved.
        Otherwise this will fetch the latest available version.

        If sandbox is given, that sandbox is used to download the source
        package, otherwise it uses the system configuration.

        Return the directory that contains the actual source root directory
        (which might be a subdirectory of output_dir). Return None if the
        source is not available.
        rr)r�
srcpackage�
output_dir�version�sandboxs     r
�get_source_treezPackageInfo.get_source_tree�s��""�D�
�	
rc��td��)ztCompare two package versions.

        Return -1 for ver < ver2, 0 for ver1 == ver2, and 1 for ver1 > ver2.
        rr)r�ver1�ver2s   r
�compare_versionszPackageInfo.compare_versions�rrc���	t|jd��5}|j�}ddd�t	j
dtj�duS#1swY�0xYw#t$rYywxYw)a�Return whether Apport should generate crash reports.

        Signal crashes are controlled by /proc/sys/kernel/core_pattern, but
        some init script needs to set that value based on a configuration file.
        This also determines whether Apport generates reports for Python,
        package, or kernel crashes.

        Implementations should parse the configuration file which controls
        Apport (such as /etc/default/apport in Debian/Ubuntu).
        zutf-8)�encodingNTz^\s*enabled\s*=\s*0\s*$)�open�
configuration�read�OSError�re�search�M)r�config_file�confs   r
�enabledzPackageInfo.enabled�sl��	��d�(�(�7�;�
*�{�"�'�'�)��
*��y�y�3�T�2�4�4�@�D�H�H�

*�
*���	��	�s'�A%�A�A%�A"�A%�%	A1�0A1c��td��)z�Return the actual Linux kernel package name.

        This is used when the user reports a bug against the "linux" package.
        rrr1s r
�get_kernel_packagezPackageInfo.get_kernel_package�rrc��td��)a�Install packages into a sandbox (for apport-retrace).

        In order to work without any special permissions and without touching
        the running system, this should only download and unpack packages into
        the given root directory, not install them into the system.

        configdir points to a directory with by-release configuration files for
        the packaging system; this is completely dependent on the backend
        implementation, the only assumption is that this looks into
        configdir/release/, so that you can use retracing for multiple
        DistroReleases. As a special case, if configdir is None, it uses the
        current system configuration, and "release" is ignored.

        release is the value of the report's 'DistroRelease' field.

        packages is a list of ('packagename', 'version') tuples. If the version
        is None, it should install the most current available version.

        If cache_dir is given, then the downloaded packages will be stored
        there, to speed up subsequent retraces.

        If permanent_rootdir is True, then the sandbox created from the
        downloaded packages will be reused, to speed up subsequent retraces.

        If architecture is given, the sandbox will be created with packages of
        the given architecture (as specified in a report's "Architecture"
        field). If not given it defaults to the host system's architecture.

        If origins is given, the sandbox will be created with apt data sources
        for foreign origins.

        If install_deps is True, then the dependencies of packages will also
        be installed.

        Return a string with outdated packages, or None if all packages were
        installed.

        If something is wrong with the environment (invalid configuration,
        package servers down, etc.), this should raise a SystemError with a
        meaningful error message.
        rr)r�rootdir�	configdirr+�packages�verbose�	cache_dir�permanent_rootdir�architecture�origins�install_dbg�install_depss            r
�install_packageszPackageInfo.install_packages�s��n"�D�
�	
rc��td��)z2Return known package names which match given glob.rr)r�nameglobs  r
�package_name_globzPackageInfo.package_name_glob rrc��y)z�Check if a package is one which has been allow listed.

        Return True for a package which came from an origin which is listed in
        native-origins.d, False if it comes from a third-party source.
        Fr%r
s  r
�is_native_origin_packagez$PackageInfo.is_native_origin_package&s��rc��|jd�D]&}|j|�s�	|j|��(y#t$r|cYcSwxYw)z�Return a valid package name which is not installed.

        This is only used in the test suite. The default implementation should
        work, but might be slow for your backend, so you might want to
        reimplement this.
        �*N)r\rr�
ValueErrorr
s  r
�get_uninstalled_packagez#PackageInfo.get_uninstalled_package1s`���-�-�c�2�	�G��)�)�'�2��
�� � ��)��	����
���
�s�<�A�Ac�R�|jd�r|jd��d}|S)Nz
 GNU/Linux�)�maxsplitr)�endswith�rsplit)�names r
�_sanitize_operating_system_namez+PackageInfo._sanitize_operating_system_nameDs*���=�=��&��;�;��;�*�1�-�D��rc��|jr|jS	tj�}|j|d�}|j	d�}|r|r||f|_|jStjddgdtjtjd�	�}|jj�jd
d�j�\}}|j�|j�f|_|jS#t
$r,}tjj|�d��Yd}~��d}~wwxYw)z�Return (osname, osversion) tuple.

        This is read from /etc/os-release, or if that doesn't exist,
        'lsb_release -sir' output.
        �NAME�
VERSION_IDz-. Falling back to calling 'lsb_release -sir'.N�lsb_releasez-sirFT)�check�stdout�stderr�text�
� )�_os_version�platform�freedesktop_os_releaseri�getrE�sysrp�write�
subprocess�run�PIPEro�strip�replace�split)r�inforhr9�errorrms      r
�get_os_versionzPackageInfo.get_os_versionKs������#�#�#�	V��2�2�4�D��7�7��V��E�D��h�h�|�,�G���$(�'�?�� ��'�'�'�
!�n�n�
�F�#���?�?��?�?��
��&�,�,�2�2�4�<�<�T�3�G�M�M�O���w� �J�J�L�'�-�-�/�:���������	V��J�J����w�&S�T�U�U��	V�s�AD�	E�"E�E)FNNN)NN)FNFNNTF)�__name__�
__module__�__qualname__�__doc__rCrrrrrrrr!r#r&r-�staticmethodr/r2r5r;r?rKrMrYr\r^rbrtrir�r%rr
rrs���.�*�M�
�
�
�
�

�

�
�
�
�
�NR�
�&�
��
��
�
�*
�I�(
��������9
�v
�	��"�K����� rr)r�rurFrzrxrr%rr
�<module>r�s"��*��	��
�V �V r

Zerion Mini Shell 1.0