%PDF- %PDF-
Direktori : /lib/python3/dist-packages/aptdaemon/worker/__pycache__/ |
Current File : //lib/python3/dist-packages/aptdaemon/worker/__pycache__/aptworker.cpython-312.pyc |
� ��kd� � � � d Z dZdZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZ ddlmZmZ ddlmZ ddlZddlZddlZddlZddlZddlZddlZddlmZ ddl m!Z!m"Z" d d l#m$Z$ ddl%� ddl&� dd l#m'Z' ddl(m)Z) ddl*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2 ejf d� Z4d� Z5dZ6dZ7 e8� fd�Z9d� Z:d� Z; G d� de$� Z<y# e$ r ddlmZmZ Y ��w xY w# e$ r ddlmZ Y ��w xY w)z0Provides AptWorker which processes transactions.z%Sebastian Heinlein <devel@glatzor.de>� AptWorker� N)�urlsplit� urlunsplit)�ConfigParser)�SourcesList)�GObject�GLib� )� BaseWorker� )�*)�lock)� set_euid_egid)�DaemonOpenProgress�DaemonInstallProgress�DaemonAcquireProgress�DaemonAcquireRepoProgress�DaemonDpkgInstallProgress�DaemonDpkgReconfigureProgress�DaemonDpkgRecoverProgress�DaemonForkProgresszAptDaemon.Workerc � � | S �N� )�ss �</usr/lib/python3/dist-packages/aptdaemon/worker/aptworker.py�<lambda>r L s � �a� � z/etc/popularity-contest.confaN # Config file for Debian's popularity-contest package. # # To change this file, use: # dpkg-reconfigure popularity-contest # # You can also edit it by hand, if you so choose. # # See /usr/share/popularity-contest/default.conf for more info # on the options. MY_HOSTID="%(host_id)s" PARTICIPATE="%(participate)s" USE_HTTP="yes" c � � | j sy| j ry| j t t fvryt t t t t fD ] }| j | s� y | j t sy| j t D �cg c] }|j d� d �� }}t |� t | j � k( S c c}w )zzReturn True if this transaction only touches packages in the aptdaemon repoisotry high trust repository whitelist F�=r )� simulated�unauthenticated�role�ROLE_INSTALL_PACKAGES�ROLE_COMMIT_PACKAGES�PKGS_REINSTALL�PKGS_REMOVE� PKGS_PURGE�PKGS_DOWNGRADE�PKGS_UPGRADE�packages�PKGS_INSTALL�split�set�high_trust_packages)�trans� whitelist�enum�pkg�pkgss r �.trans_only_installs_pkgs_from_high_trust_reposr5 ^ s� � � �?�?�������z�z�/�1E�F�F����j�.��� ���>�>�$���� �>�>�,�'��).����)E�F�#�C�I�I�c�N�1��F�D�F��t�9��E�5�5�6�6�6�� Gs �Cc � � t � }t j t j j | d� � D ] }|t |� z }� |S )zoReturn a set of (origin, component, pkgname-regexp) from a high-trust-repository-whitelist.d directory z*.cfg)r. �glob�os�path�join�*_read_high_trust_repository_whitelist_file)�whitelist_cfg_dr1 r9 s r �read_high_trust_repository_dirr= z sJ � � ��I�� � �"�'�'�,�,���@�A� F���?��E�E� �F��r c �x � t � }t � } |j | � |j � D ]L }|j |d� }|j |d� }|j |d� }|j |||f� �N |S # t $ r(}t j d| �d|�d�� |cY d}~S d}~ww xY w)z�Read a individual high-trust-repository whitelist file and return a set of tuples (origin, component, pkgname-regexp) z%Failed to read repository whitelist 'z' (�)N�origin� component�pkgnames) r r. �read� Exception�log�error�sections�get�add)r9 �parserr1 �e�sectionr@ rA rB s r r; r; � s� � � �^�F���I�����D�� �?�?�$� 5�����G�X�.���J�J�w��4� ��:�:�g�z�2��� � �v�y�(�3�4� 5� ��� � �� � �T�1�M�N�����s �B � B9�B4�.B9�4B9c � � e Zd ZdZ ej � d ZdZd3d�Zd4d�Z d� Z d5d�Zd � Zd � Z d� Z d5d�Zd � Zd� Zd4d�Zd� Zd� Zd� Zd5d�Zd5d�Zd4d�Zd4d�Zd� Zd� Zed� � Zd� Zd6d�Zd� Z d� Z!d5d�Z"d7d�Z#d � Z$ d8d!�Z%e&jN d"� � Z(d#� Z)d$� Z*d%� Z+d&� Z,d'� Z-d(� Z.d)� Z/d9d*�Z0d:d+�Z1d,� Z2d4d-�Z3d.� Z4d/� Z5d0� Z6d1� Z7d2� Z8y);r z3Worker which processes transactions from the queue.r z/opt/Nc � � t j | ||� d| _ | j �r�t j j |d� }t j j |� r$t j t j |� t j j |d� }t j j |� r$t j t j |� |t j d<