__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

`�g�����SrSrSrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
r
SSKrSSKrSSKJrJr SSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSKJr SSKJ r J!r! S	S
K"J#r# SSK$7 SSK%7 SS
K"J&r& SSK'J(r( SSK)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1 \Rd"S5r3Sr4Sr5Sr6\7"54Sjr8Sr9Sr:"SS\#5r;g!\a SSKJrJr N�f=f!\a	 SSKJr N�f=f)z0Provides AptWorker which processes transactions.z%Sebastian Heinlein <[email protected]>�	AptWorker�N)�urlsplit�
urlunsplit)�ConfigParser)�SourcesList)�GObject�GLib�)�
BaseWorker�)�*)�lock)�
set_euid_egid)�DaemonOpenProgress�DaemonInstallProgress�DaemonAcquireProgress�DaemonAcquireRepoProgress�DaemonDpkgInstallProgress�DaemonDpkgReconfigureProgress�DaemonDpkgRecoverProgress�DaemonForkProgresszAptDaemon.Workerc��U$�N�)�ss �</usr/lib/python3/dist-packages/aptdaemon/worker/aptworker.py�<lambda>rKs��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���UR(dgUR(agUR[[4;ag[
[[[[4HnURU(dM g UR[(dgUR[Vs/sHo3RS5SPM nn[U5[UR5:H$s snf)zrReturn 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�)E�#�I�I�c�N�1��)E�D�F��t�9��E�5�5�6�6�6��Gs�&C&c��[5n[R"[RR	US55HnU[U5-nM U$)zgReturn 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_dr1r9s   r�read_high_trust_repository_dirr=ysD����I��	�	�"�'�'�,�,���@�A���?��E�E�	�B��rc��[5n[5nURU5 UR
5HLnURUS5nURUS5nURUS5nURXVU45 MN U$![a*n[RSU<SU<S35 UsSnA$SnAff=f)zvRead 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)	rr.�read�	Exception�log�error�sections�get�add)r9�parserr1�e�sectionr@rArBs        rr;r;�s����^�F���I�����D���?�?�$�����G�X�.���J�J�w��4�	��:�:�g�z�2���
�
�v�(�3�4�	%�
������	�	�T�1�M�N�����s�B	�	
B=�B8�2B=�8B=c��\rSrSrSr\R"5SrSrS0Sjr	S1Sjr
SrS2S	jrS
r
SrSrS2S
jrSrSrS1SjrS2SjrS2SjrS1SjrS1SjrSrSr\S5rSrS3SjrSrSrS2Sjr S4Sjr!Sr"S5Sjr#\$RJS 5r&S!r'S"r(S#r)S$r*S%r+S&r,S'r-S6S(jr.S7S)jr/S*r0S1S+jr1S,r2S-r3S.r4S/r5g)8r�z3Worker which processes transactions from the queue.rz/opt/Nc��[R"XU5 SUlUR(Ga�[R
R
US5n[R
RU5(a%[R"[RU5 [R
R
US5n[R
RU5(a%[R"[RU5 U[RS'[R
R
US5[RS'[RRS5 [RRS5 S	U-[RS
'SU-[RS
'[RRS5n[R
R
[R
RU5S
5[ R"l[R
R
[R
RU5S5[ R$l[RR'S5n[R
R
US5[ R(l[RR'S5n[R
R
US5[ R*l[R,"5 [/[R
R
[RR'S5S55Ul[2R5SUR0-5 [RRS5UlSUlU(aUR;/SQ5 gg)z$Initialize a new AptWorker instance.Nzetc/apt/apt.confzetc/apt/apt.conf.d�Dirzvar/lib/dpkg/statuszDir::State::StatuszDPkg::Post-Invokez
DPkg::Optionsz	--root=%szDPkg::Options::z--log=%s/var/log/dpkg.log�Dir::State::statusz
lock-frontendrzDir::Cache::ArchiveszDir::State::listsz/etc/aptdaemon/high-trust-repository-whitelist.dz using high-trust whitelist: '%s')�modify_cache_after�modify_cache_before�get_license_key)r�__init__�_cache�chrootr8r9r:�exists�apt_pkg�read_config_file�config�isdir�read_config_dir�clear�	find_file�dirnamer�
frontend_lock�status_lock�find_dir�archive_lock�
lists_lock�init_systemr=�_high_trust_repositoriesrE�debug�_status_orig�_status_frozen�
_load_plugins)�selfrW�load_plugins�
apt_conf_file�apt_conf_dir�status_file�archives_dir�	lists_dirs        rrU�AptWorker.__init__�s������D�,�7�����;�;�;��G�G�L�L��1C�D�M��w�w�~�~�m�,�,��(�(�����G��7�7�<�<��0D�E�L��w�w�}�}�\�*�*��'�'�����E�$*�G�N�N�5�!�35�7�7�<�<��-�4/�G�N�N�/�0��N�N� � �!4�5��N�N� � ��1�0;�f�0D�G�N�N�,�-�1L�17�28�G�N�N�,�-�!�.�.�2�2�3G�H�K�&(�g�g�l�l�2�7�7�?�?�;�3O�1@�'B�D���#�$&�G�G�L�L�������1M�17�%9�D���!�"�>�>�2�2�3I�J�L�%'�W�W�\�\�,��%G�D���"����/�/�0C�D�I�#%�7�7�<�<�	�6�#B�D�O�O� ����!�)G��G�G�L�L����0�0��7�J�
L�)M��%�	�	�	�.��1N�1N�N�	P�$�N�N�4�4�5I�J���"������� 3�
4�rc�j�U(d�[RRUR5nURR	5HInURU5 UR
U5 UR(dM8URU5 MK XR;a[RSU-5 gURUH,n[RSX5 U"X R5 M. g![a(n[RSU<SU<35 SnAM^SnAff=f)z!Call all plugins of a given type.z$There isn't any registered %s pluginFzCalling %s plugin: %szFailed to call z	 plugin:
NT)�apt�cache�ProblemResolverrV�get_changesr^�protect�
marked_delete�remove�pluginsrErhrD�critical)rl�name�resolverr3�pluginrFs      r�
_call_plugins�AptWorker._call_plugins�s�����y�y�0�0����=�H��{�{�.�.�0�����s�#�� � ��%��$�$�$��O�O�C�(�	1�
�|�|�#��I�I�<�t�C�D���l�l�4�(�F��I�I�-�t�<�
P��x���-�)����
P������N�O�O��
P�s�)D�
D2�
D-�-D2c��[R"U5 UR[:XdUR	5(dURU5 GOZUR[:XaUR"U40URD6 GO'UR[:XaUR"U40URD6 O�UR[:Xa/UR"XR[40URD6 O�UR[:XaUR!U5 O�UR["[$[&[([*[,4;aMUR.UR0:Xa3UR3U5 [4Ul[R8"5 gUR;U5 UR[,:XaUR=U5 O�UR[>:XaUR@"U40URD6 O}UR[B:XaURD"U40URD6 OKURF(a:URFRH(a[K[LUROU55eUR[P:XaURSU5 O�UR[T:XaURV"U40URD6 OsUR["[$[&[(4;aURX"U/URQ76 O1UR[*:XaURZ"U40URD6 [R8"5 g![R8"5 f=f)zRun the workerFN).r�
wait_for_lockr#�ROLE_FIX_INCOMPLETE_INSTALL�is_dpkg_journal_clean�fix_incomplete_install�ROLE_ADD_REPOSITORY�add_repository�kwargs�ROLE_ENABLE_DISTRO_COMP�enable_distro_comp�ROLE_RECONFIGURE�reconfigurer+r&�
ROLE_CLEAN�clean�ROLE_REMOVE_PACKAGESr$�ROLE_UPGRADE_PACKAGESr%�ROLE_UPGRADE_SYSTEM�ROLE_FIX_BROKEN_DEPENDS�
marked_tid�tid�_apply_changes�EXIT_SUCCESS�exit�release�_open_cache�fix_broken_depends�ROLE_UPDATE_CACHE�update_cache�ROLE_ADD_LICENSE_KEY�add_license_keyrV�broken_count�TransactionFailed�ERROR_CACHE_BROKEN�_get_broken_details�
ROLE_PK_QUERY�query�ROLE_INSTALL_FILE�install_file�commit_packages�upgrade_system�rlr0s  r�_run_transaction�AptWorker._run_transaction�sz��1	����u�%��
�
�9�9��2�2�4�4��+�+�E�2����2�2��#�#�E�:�U�\�\�:����6�6��'�'��>����>����/�/�� � ����~�(F�1�#(�<�<�1����z�)��
�
�5�!��*�*�!5�7L�!6�8L�!4�!8�!:�:��/�/�U�Y�Y�.��#�#�E�*�)��
��0
�L�L�N�-� � ��'��z�z�4�4��'�'��.����0�0��!�!�%�8�5�<�<�8����3�3��$�$�U�;�e�l�l�;�������!9�!9�'�(:�(,�(@�(@��(G�I�I��z�z�]�*��
�
�5�!����0�0��!�!�%�8�5�<�<�8���� 4�6K� 5�7K� M�M��$�$�U�<�U�^�^�<����2�2��#�#�E�:�U�\�\�:��L�L�N��D�L�L�N�s�FM$�F1M$�$M;c		�.�[RSX#XEXg5 URR5 [R
R
UR5n	URX)5 URX9SS9 URXI5 URXYSS9 URXi5 URXy5 URX5 SSS5 URUW	5 U(dURU5 gg!,(df   N:=f)a�Perform a complex package operation.

Keyword arguments:
trans - the transaction
install - list of package names to install
reinstall - list of package names to reinstall
remove - list of package names to remove
purge - list of package names to purge including configuration files
upgrade - list of package names to upgrade
downgrade - list of package names to upgrade
simulate -- if True the changes won't be applied
z+Committing packages: %s, %s, %s, %s, %s, %sT)�	reinstall)�purgeN)rE�inforV�actiongrouprurvrw�_mark_packages_for_installation�_mark_packages_for_removal�_mark_packages_for_upgrade�_mark_packages_for_downgrade�_resolve_depends�_check_obsoleted_dependenciesr�)
rlr0�installr�r{r��upgrade�	downgrade�simulaters
          rr��AptWorker.commit_packagess���	���>��V�G�	H�
�[�[�
$�
$�
&��y�y�0�0����=�H��0�0��C��0�0��;?�
1�
A��+�+�F�=��+�+�E�4�+�H��+�+�G�>��-�-�i�B��!�!�%�2�'�	
�*�*�5�(�;������&��'�
&�s�BD�
Dc	�P�URSU5 UR5 URSU5(aUR5 gg![a [[URUSS95ef=f![a! URUSS9n[[U5ef=f)z9Resolve the dependencies using the given ProblemResolver.rSF)�nowrRN)r��resolve�SystemErrorr��ERROR_DEP_RESOLUTION_FAILEDr�)rlr0r�detailss    rr��AptWorker._resolve_depends8s������0�(�;�	P��������2�H�=�=�
N�� � �"�>���	P�#�$?�$(�$<�$<�U��$<�$N�P�
P�	P���
N��2�2�5�e�2�D��'�(C�W�M�M�
N�s�A�A:�)A7�:+B%c�&^�U4Sjn/nTRR5HinUR(dMURRH9nU"UR
U5(dMUR
UR
5  Mg Mk U$)z;Return a list of packages that come from a high-trust repo c�>�TRHEup#nX!R:XdMX1R:XdM([R"X@5(dME g g)NTF)rgr@rA�re�match)�pkgname�	pkgoriginr@rA�regexprls     �r�_in_high_trust_repository�EAptWorker._get_high_trust_packages.<locals>._in_high_trust_repositoryIsH���-1�-J�-J�)��6��.�.�.�!�%8�%8�8�����1�1��	.K�
r)rVrx�marked_install�	candidate�originsr~�append)rlr��from_high_trust_repor3r@s`    r�_get_high_trust_packages�"AptWorker._get_high_trust_packagesGsu���	� "���;�;�*�*�,�C��!�!�!�!�m�m�3�3�F�0����6�B�B�,�3�3�C�H�H�=��4�-�$�#rc�z�/nURR5H�nUR(d5UR(d$UR(dUR
(dMISnURRHnX4R-nM U(aMURUR5 M� U$)z/Return a list of unauthenticated package names F)rVrxr��marked_downgrade�marked_upgrade�marked_reinstallr�r��trustedr�r~)rlr"r3r�r@s     r�_get_unauthenticated�AptWorker._get_unauthenticatedZs������;�;�*�*�,�C��"�"��(�(��&�&��(�(�(���!�m�m�3�3�F��~�~�-�G�4��w�#�*�*�3�8�8�4�-��rc�8�UVs/sHnURU5PM snGH�upVnURS5upXn	U	S:gn
URUnU(aqUR(d$[	[[
S5UR5eU(a4URRU:wa[	[[
S5Xe5eO�UR(avU(aoXdRR:XaVU(a5UURRVs/sHnURPM sn;a[	[[
S5U5eU(aURUUlOU(aUR#XG5 UR%SSU
5 UR'U5 UR)U5 GM� g	s snf![a [	[
[
S5U5ef=fs snf![a [	[
[
S5Xe5ef=f)
�Mark packages for installation.�#�auto�Package %s isn't available�Package %s isn't installedz$The version %s of %s isn't installedzPackage %s is already installed�%The version %s of %s isn't available.FN)�_split_package_id�	partitionrV�KeyErrorr��ERROR_NO_PACKAGE�_�is_installed�ERROR_PACKAGE_NOT_INSTALLEDr~�	installed�versionr��archive�ERROR_PACKAGE_ALREADY_INSTALLED�versionsr��_set_candidate_release�mark_installr^ry)rlr+rr�r3�pkg_name�pkg_ver�pkg_rel�sep�auto_marker�	from_userr@s            rr��)AptWorker._mark_packages_for_installationis	��7?�+@�6>�s�,0�+A�+A�#�+F�6>�+@�&�H�w�)1�);�);�C�)@�&�H�;�$��.�I�
2��k�k�(�+��
��'�'�+�,G�,-�.J�,K�,/�H�H�6�6��s�}�}�4�4��?�+�,G�,-�/:�-;�,3�?�?���$�$���=�=�+@�+@� @� ��+.�=�=�+@�+@�!B�+@��"(���+@�!B�B�/�;��?�@�(�L�L��P�$'�L�L��$9�C�M�
��+�+�C�9����U�E�9�5��N�N�3�����S�!�]+@��+@���
2�'�(8�()�*F�(G�(0�2�2�
2��,!B�� �P�+�,<�,-�/;�-<�=D�P�P�P�s#�G�G�G/�G4�%G,�4%Hc�l�SUl[Ul[R"S5n[5n[RR5nURU5 URU5 UR5 [R"U5 g![R"U5 f=f)z�Enable given component in the sources list.

Keyword arguments:
trans -- the corresponding transaction
component -- a component, e.g. main or universe
�e�N)�progress�STATUS_COMMITTING�statusr8�umaskr�
aptsources�distro�
get_distro�get_sources�enable_component�save)rlr0rA�	old_umask�sourceslistrs      rr��AptWorker.enable_distro_comp�s������(����H�H�U�O�	�	 �%�-�K��&�&�1�1�3�F����{�+��#�#�I�.������H�H�Y���B�H�H�Y��s�AB�B3c	��SUl[UlU(axURS5(dUS-
n[R
R
S5n[RRU[RRU55nOSn[R"SU5(aEURU5n[R
RS5n	U(dSU	-nOUSU	--
n[5n
U
R!X#XEUUS	9nUR"(a
[%5eU
R'5 g! [(R+S
5 e=f)a�Add given repository to the sources list.

Keyword arguments:
trans -- the corresponding transaction
src_type -- the type of the entry (deb, deb-src)
uri -- the main repository uri (e.g. http://archive.ubuntu.com/ubuntu)
dist -- the distribution to use (e.g. karmic, "/")
comps -- a (possible empty) list of components (main, restricted)
comment -- an (optional) comment
sourcesfile -- an (optinal) filename in sources.list.d
r�z.list�Dir::Etc::sourcepartsNz (http|https|ftp)://\S+?:\S+?@\S+�Dir::etc::netrczcredentials stored in %sz; credentials stored in %s)�filezadding repository)r�r�r��endswithrYr[rcr8r9r:�basenamer�r��"_store_and_strip_password_from_urir_rrI�invalid�RepositoryInvalidErrorrrE�	exception)rlr0�src_type�uri�dist�comps�comment�sourcesfile�dir�auth_conf_path�sources�entrys            rr��AptWorker.add_repository�s �����(�����'�'��0�0��w�&���.�.�)�)�*A�B�C��'�'�,�,�s�B�G�G�,<�,<�[�,I�J�K��K�
�8�8�7��=�=��9�9�#�>�C�$�^�^�5�5�6G�H�N��4�~�E���7�.�H�H��	�!�m�G��K�K��t�G�%0� �2�E��}�}�,�.�.��
�L�L�N��		��M�M�-�.��s�67D?�?Ec	�F�[U5nURRUR<SUR<S3S5nXSR-nUc[RRS5n0nSn[RRU5(aT[R"U5Rn[!US5n	U	R#5R%S5nSSS5 S	U<S
UR<SUR<S3n
Xg;a�S
[&R("U5<S[&R("XvS5<S[&R("XvS5<3nSU<S
UR<SUR<3n[&R*"X�5(d[RSU-5 X�-nO[&R,"X�U5nOX�-
nSn
[R."U5[.R0n
[8R:"[RR=U5[RR?U5SS9nURAURCS55 URE5 [RF"URHU5 [RJ"X-5 [MURNXSRURPURR45$![a"n[RSU5 UsSnA$SnAff=f!,(df   GNI=f![2a*nUR4[4R6:waeSnAGN_SnAff=f![2a"n[RSU-5 SnAN�SnAff=f)zzExtract the credentials from an URI. Store the password in
auth.conf and return the URI without any password information.
zFailed to urlsplit '%s'N�:�@�r
�rbzUTF-8z	
machine z login z
 password �
z
machine\s+z\s+login\s+rz\s+password\s+rzmachine zCcan not replace existing netrc entry for '%s' prepending it insteadi�F)r�prefix�deletezFailed to write auth.conf: '%s')*r�
ValueErrorrE�warning�netloc�replace�username�passwordr9rYr[r_r8rX�netrc�hosts�openrC�decoder��escape�search�sub�stat�ST_MODE�OSError�errno�ENOENT�tempfile�NamedTemporaryFiler`r
�write�encode�close�renamer~�chmodr�schemer��fragment)rlrr�resrF�
netloc_public�machine�netrc_hosts�netrc_hosts_as_text�f�new_netrc_entry�
sub_regexp�replacement�moderK�
auth_conf_tmps                rr�,AptWorker._store_and_strip_password_from_uri�s���	��3�-�C��
�
�*�*�s�|�|�7:�|�|�,E�+-�/�
� �(�(�*���!�$�^�^�5�5�6G�H�N��� ��
�7�7�>�>�.�)�)�#�k�k�.�9�?�?���.�$�/�1�*+�&�&�(�/�/�'�*B�'�0��

�S�\�\�3�<�<�1���!��	�	�'�"��	�	�+�.�q�1�2��	�	�+�.�q�1�2�4�J�
����s�|�|�5�K��9�9�Z�=�=����4�6=�>�?�&5�&K�#�&(�f�f��-@�'B�#�
 �2����	��7�7�>�*�4�<�<�8�D�
	C�$�7�7��G�G�O�O�N�3��w�w�'�'��7���M�
��� 3� :� :�7� C�D����!��I�I�m�(�(�.�9��H�H�^�*�
�3�:�:�}�h�h��	�	��<�<�)�*�	*��A�	��K�K�1�5�9��J��	�� 0�/��<�	��w�w�%�,�,�&��'��	���	C��K�K�9�E�A�B�B��	C�sZ�K<�	 L+�&'L=�B7M4�<
L(�L#�L(�#L(�+
L:�=
M1�M,�,M1�4
N �>N�N c�(�[RSU5 [UlUR	XU5nUR
upgnUR
S5 U(aU$UR5 [U5S:�d[U5S:�aURUSSS9 [USSS	9n	URU	5n
U=RU	R-
slU
(a[[UR5eS
S
S
5 g
!,(df   g
=f)aInstall local package file.

Keyword argument:
trans -- the corresponding transaction
path -- absolute path to the package file
force -- if installing an invalid package is allowed
simulate -- if True the changes won't be committed but the debfile
            instance will be returned
z!Installing local package file: %srRr)��!)�"�?)�fetch_range�
install_range�@�_��begin�endN)rEr��STATUS_RESOLVING_DEPr��_check_deb_file�required_changesr��_frozen_status�lenr�rr��outputr��ERROR_PACKAGE_MANAGER_FAILED)rlr0r9�forcer��debr�r{�unauth�deb_progressr@s           rr��AptWorker.install_file$s���	���4�d�;�+����"�"�5��6��$'�$8�$8�!��&����/�0���J�
�
 �
 �
"��7�|�a��3�v�;��?��#�#�E�x�2:�$�<�5�U�"�"�M�L��+�+�l�+�C��L�L�L�/�/�/�L��'�(D�(-���6�6��#�
"�
"�s
�-BD�
Dc��UVs/sHnURU5PM snH�upVnURUnUR(d+UR(d[[[S5U5eURSLa[[[S5U5eU(a*URU:wa[[[S5Xe5eURSU5 URU5 URU5 URU5 M� gs snf![a [[[S5U5ef=f)r�r�r�TzPackage %s cannot be removed.z%The version %s of %s is not installedFN)r�rVr�r�r�r�r��installed_filesr��	essential�"ERROR_NOT_REMOVE_ESSENTIAL_PACKAGEr��mark_deleter^ryr{)rlr+rr�r3r�r�r�s        rr��$AptWorker._mark_packages_for_removalCs@��7?�+@�6>�s�,0�+A�+A�#�+F�6>�+@�&�H�w�
2��k�k�(�+��
�#�#�C�,?�,?�'�(C�()�*F�(G�(0�2�2��}�}��$�'�(J�()�*I�(J�(0�2�2��3�=�=�G�3�'�(C�()�+6�)7�8?�K�K�
�O�O�E�5�)��N�N�3�����S�!��O�O�C� �/+@��+@���
2�'�(8�()�*F�(G�(0�2�2�
2�s�D�D�%Ec��UR(dgU(d)[RRUR5n[5nURR
5 URR5H2nUR(dMURURU5nM4 UHZnXPR;dMURUnUR(dM6UR(dMIURS5 M\ URX5 SSS5 g!,(df   g=f)zCMark obsoleted dependencies of to be removed packages
for removal.
NF)�remove_obsoleted_dependsrurvrwrVr.r�rxrz�_installed_dependenciesr~r��is_auto_removablerhr�)rlr0r�installed_depsr3�dep_names      rr��'AptWorker._check_obsoleted_dependencies^s����-�-����y�y�0�0����=�H����
�[�[�
$�
$�
&��{�{�.�.�0���$�$�$�%)�%A�%A����.�&2�N�1�+���{�{�*��+�+�h�/�C��'�'�'�C�,A�,A�,A�����.�	+�
�!�!�%�2�'�
&�
&�s$�'-D2�2D2�D2�0D2�&D2�2
Ec��U(d
[5nXR;aU$URURRnU(dU$SH_nURUHHnUSR
RnXb;dM#URU5 X RUU5-nMJ Ma U$![a Mrf=f)zARecursively return all installed dependencies of a given package.)�
PreDepends�Depends�
Recommendsr)
r.rV�_pkg�current_ver�depends_list�
target_pkgr~rIrlr�)rlr��all_deps�cur�sec�depros       rrl�!AptWorker._installed_dependenciesxs���
��u�H��;�;�&��O��k�k�(�#�(�(�4�4����O�:�C�
��+�+�C�0�C�"�1�v�0�0�5�5�H��/� ���X�.� �$@�$@��AI�%K�K��	1�;�����
��
�s�.B6�)B6�6
C�Cc�"�UVs/sHnURU5PM snGH�upEnURUnUR(d[[[S5U5eURnU(a�UR(aSURRU:a9[[[S5URRUR5eUR(aSURRU:Xa9[[[S5URRUR5eURUUlO[[[S5U5eURSSS5 UR!U5 UR#U5 UR%U5 GM� g	s snf![a [[[S5U5ef=f![a [[[S5XT5ef=f)
zMark packages for downgrade.r�r�z0The former version %s of %s is already installed�)The version %s of %s is already installedz$The version %s of %s isn't availablez0You need to specify a version to downgrade %s toFTN)r�rVr�r�r�r�r�r��is_auto_installedr�r�r~r�r�r�r��	mark_autor^ry�rlr+rr3r�r�r�r�s        rr��&AptWorker._mark_packages_for_downgrade�s���7?�+@�6>�s�,0�+A�+A�#�+F�6>�+@�&�H�w�
2��k�k�(�+��
�#�#�'�(C�()�*F�(G�(0�2�2��(�(�D���=�=�S�]�]�%:�%:�W�%D�+�,<�,-�/E�-F�,/�M�M�,A�,A�3�8�8�M�M��]�]�s�}�}�'<�'<��'G�+�,K�,-�/E�-F�,/�M�M�,A�,A�3�8�8�M�M�O�$'�L�L��$9�C�M�(�(8�()�+<�)=�(0�2�2�

���U�E�4�0��M�M�$���N�N�3�����S�!�S+@��+@���
2�'�(8�()�*F�(G�(0�2�2�
2��0 �O�+�,<�,-�/:�-;�<C�O�O�O�s�F<�G�G)�%G&�)%Hc�t�UVs/sHnURU5PM snGH�upEnURUnUR(d[[[S5U5eURnU(GaUR(ah[R"URRU5S:Xa9[[[S5URRUR5eUR(ah[R"URRU5S:Xa9[[[S5URRUR5eURUUlOU(aUR#X65 UR%SSS	5 UR'U5 UR)U5 UR+U5 GM� g
s snf![a [[[S5U5ef=f![a [[[S5XT5ef=f)zMark packages for upgrade.r�r�r
z/The later version %s of %s is already installedrrr�FTN)r�rVr�r�r�r�r�r�r�r�rY�version_comparer��ERROR_PACKAGE_UPTODATEr~r�r�r�r�r�r^ryr�s        rr��$AptWorker._mark_packages_for_upgrade�s��7?�+@�6>�s�,0�+A�+A�#�+F�6>�+@�&�H�w�
2��k�k�(�+��
�#�#�'�(C�()�*F�(G�(0�2�2��(�(�D���M�M��+�+�C�M�M�,A�,A�,3�5�89�:�+�,B�,-�/E�-F�,/�M�M�,A�,A�3�8�8�M�M��m�m��-�-�c�m�m�.C�.C�.5�7�:;�<�+�,B�,-�/E�-F�,/�M�M�,A�,A�3�8�8�M�M�P�$'�L�L��$9�C�M���+�+�C�9����U�E�4�0��M�M�$���N�N�3�����S�!�U+@��+@���
2�'�(8�()�*F�(G�(0�2�2�
2��6 �P�+�,<�,-�/;�-<�=D�P�P�P�s�G%�G*�,H�*%H�%H7c���URH9nURVs/sHnURU:XdMUPM sn(dM9 O' [[[S5URU5eURR5 URRRURURU5 URR5 gs snf)zASet the candidate of a package to the one from the given release.z1The package %s isn't available in the %s release.N)r�r�r�r�r�r�r~�_pcache�cache_pre_change�	_depcache�set_candidate_releaseru�_cand�cache_post_change)r3r�r�r@s    rr�� AptWorker._set_candidate_release�s���
�|�|�G�%,�_�_�2�_�6��~�~��0��_�2�2��$�
$�$4�$%�'8�%9�:=�(�(�G�M�
M�	���$�$�&������3�3�C�H�H�g�m�m�4;�	=����%�%�'��2s
�C�Cc�`�Sn[RS5 [USSS9nU(aTURS5(d>[R
R
S5n[RRXR5nU(a�[R
R
S5n[R
RS5nSU;an[RRU5n[RRX&/5nU"X�5(d!U"X'5(d[S	U<S
U<S35eO[RRXb5nURRXBS9 UR7USSS9 g
![ R"R$a9n	UR&(a
[)5e[+[,[/U	55eS
n	A	f[ R"R0a [)5e[ R"R2a [+[45ef=f)z�Update the cache.

Keyword arguments:
trans -- the corresponding transaction
sources_list -- only update the repositories found in the sources.list
                snippet by the given file name.
c��[RRU5[RRU5:H$)z#Small helper to compare two pathes.)r8r9�normpath)�first�seconds  r�compare_pathes�.AptWorker.update_cache.<locals>.compare_pathess+���7�7�#�#�E�*�b�g�g�.>�.>�v�.F�F�FrzUpdating cache�
�ZrU�/r	zDir::Etc::sourcelistz,Only alternative sources.list files inside 'z' are allowed (not 'z'))�sources_listN�[rT)rEr�r�
startswithrYr[rcr8r9r:r_�abspath�commonprefix�AptDaemonErrorrV�updaterurv�FetchFailedException�	cancelled�TransactionCancelledr��ERROR_REPO_DOWNLOAD_FAILED�str�FetchCancelledException�LockFailedException�
ERROR_NO_LOCKr�)
rlr0r�r�r�r�basedir�system_sources�
common_prefixrFs
          rr��AptWorker.update_cache�s���	G�	���!�"�,�U�"�"�E���� 7� 7�� <� <��.�.�)�)�*A�B�C��7�7�<�<��:�L���n�n�-�-�.E�F�G�$�^�^�5�5�6L�M�N��l�"�!�w�w���|�<��!#��� 4� 4�l�5L� M�
�&�}�>�>�&�|�D�D�(�*1�<�*A�B�B�� "�w�w�|�|�G�B��
	3��K�K���x��C�	
����b�b��1���y�y�-�-�	4����*�,�,�'�(B�(+�E�
�4�4���y�y�0�0�	)�&�(�(��y�y�,�,�	3�#�M�2�2�	3�s�F�H-�!4G�AH-c�v�[RSU-5 [UlUR	S5 UR
R
U(+S9 UR	S5 URU5 U(dURU5 gg![an[[[U55eSnAff=f)z�Upgrade the system.

Keyword argument:
trans -- the corresponding transaction
safe_mode -- if additional software should be installed or removed to
             satisfy the dependencies the an updates
simulate -- if the changes should not be applied
z!Upgrade system with safe mode: %srS)�dist_upgradeNrR)
rEr�rXr�r�rVr�r�r�r�r�r�r�)rlr0�	safe_moder��exceps     rr��AptWorker.upgrade_system1s���	���4�y�@�A�+������0�1�	M��K�K����]��;�	
���/�0��*�*�5�1������&���	�	M�#�$?��U��L�L��	M�s�B�
B8�B3�3B8c��[RS5 [UlUR	5 [U5nUR
5 SSS5 SSS5 U=RWR-
slURS:wa[[UR5eg!,(df   N`=f!,(df   Ni=f)zzRun dpkg --configure -a to recover from a failed installation.

Keyword arguments:
trans -- the corresponding transaction
zFixing incomplete installsNr)rEr��STATUS_CLEANING_UPr�r[r�runr]�_child_exitr�r^)rlr0r�s   rr�� AptWorker.fix_incomplete_installGs���	���-�.�)���
�
 �
 �
"�*�5�1�X�����2�#�	������'�����1�$�#�$@�$)�L�L�2�
2�%�2�1��#�
"�s"�B9�B(�B9�(
B6	�2B9�9
Cc��[RS5 UR5 [U5nUR	X#5 SSS5 SSS5 U=R
WR
-
slURS:wa[[UR
5eg!,(df   N`=f!,(df   Ni=f)z�Run dpkg-reconfigure to reconfigure installed packages.

Keyword arguments:
trans -- the corresponding transaction
packages -- list of packages to reconfigure
priority -- the lowest priority of question which should be asked
zReconfiguring packagesNr)	rEr�r[rr�r]r�r�r^)rlr0r+�priorityr�s     rr��AptWorker.reconfigureWs���	���)�*�
�
 �
 �
"�.�u�5�����X�0�6�#�	������'�����1�$�#�$@�$)�L�L�2�
2�%�6�5��#�
"�s"�B/�B�B/�
B,	�(B/�/
B=c��[RS5 [UlURR
R
5 U(dURU5 gg![a  [[URU55ef=f)z�Try to fix broken dependencies.

Keyword arguments:
trans -- the corresponding transaction
simualte -- if the changes should not be applied
zFixing broken dependsN)rEr�rXr�rVr��
fix_brokenr�r�r�r�r�)rlr0r�s   rr��AptWorker.fix_broken_dependshs��	���(�)�+���	E��K�K�!�!�,�,�.������&����	E�#�$?�$(�$<�$<�U�$C�E�
E�	E�s�$A � *B
c��SUl[UlU(dURn[R
R
SU5 [R"5 [XUUS9n[UR[RR5(d%[RRU5Ul
gURRU5 g![an[!["[%U55eSnAff=f)z�Open the APT cache.

Keyword arguments:
trans -- the corresponding transaction
start -- the begin of the progress range
end -- the end of the the progress range
quiet -- if True do no report any progress
status -- an alternative dpkg status file
NrQ)rVrW�quiet)r��STATUS_LOADING_CACHEr�rirYr[r.rfr�
isinstancerVrurv�Cacher-r�r��ERROR_NO_CACHEr�)rlr0rVrWr�r�r�r�s        rr��AptWorker._open_cacheys������+�����&�&�F������/��8�����%�e�c�,1�3��	@��d�k�k�3�9�9�?�?�;�;�!�i�i�o�o�h�7������ � ��*���	@�#�N�C��J�?�?��	@�s�'AC�?C�
D�%C>�>Dc��[RR[RRUR5S5n[R
"U5HnUR
5(dM g g)zCReturn False if there are traces of incomplete dpkg status
updates.zupdates/FT)r8r9r:r`ri�listdir�isdigit)rl�status_updates�dentrys   rr��AptWorker.is_dpkg_journal_clean�sV�������b�g�g�o�o�d�6G�6G�&H�&0�2���j�j��0�F��~�~����1�rc���URR5nU(dgUH�nUR(dMURSLd=UR(aURR
S:XdURS:XdMb[[[S5UR5e UR(dCUR(a2[[SR[UR555eUR(a
[!5eSUl[%XSUS	S
9n['XSUS	S
9nUR)5 S[*R,R.R0;a%URR/XgURS9 OURR/Xg5 U=R2UR2-
slSSS5 g![*R4R6an[[8[;U55eSnAf[*R4R<a [!5e[>a�n	[@Ul![EUS
SS
9n
U
RG5 SSS5 O!,(df   O=fUR2W
R2-nU=R2U-
sl[[HU	<SUR2<35eSn	A	ff=f!,(df   g=f)a-Apply previously marked changes to the system.

Keyword arguments:
trans -- the corresponding transaction
fetch_range -- tuple containing the start and end point of the
               download progress
install_range -- tuple containing the start and end point of the
                 install progress
NT�required�	aptdaemonzPackage %s cannot be removed� Frr
rU�allow_unauthenticated)r�r�rT�: )%rVrxrzrfr�r�r~r�rgr�r�r"�ERROR_PACKAGE_UNAUTHENTICATEDr:�sortedr�r��cancellablerrr[rur��commit�__doc__r]rvr��ERROR_PACKAGE_DOWNLOAD_FAILEDr�r�r�r�r�rr�r^)rlr0rQrR�changesr3�fetch_progress�
inst_progressrFr��pror]s            rr��AptWorker._apply_changes�sS���+�+�)�)�+�����C�� � � �c�m�m�t�&;�'*�}�}�'*�}�}�'=�'=��'K�&)�h�h�+�&=�'�(J�()�*H�(I�(+���2�2���*�*�u�/D�/D�#�$A�$'�H�H�V�E�4I�4I�-J�$K�M�
M��?�?�&�(�(�!���.�u��N�3>�q�>�C��-�e��;K�2?��2B�D�
�
�
 �
 �
"�
5�*�c�i�i�.>�.>�.F�.F�F��K�K�&�&�~�=B�=X�=X�'�Z��K�K�&�&�~�E� ���
� 4� 4�4��/#�
"���9�9�1�1�
4�'�(E�(+�E�
�4�4���9�9�4�4�
-�*�,�,��
J�1���.�u�B�B�G�3��G�G�I�H�G�G��&�-�-��
�
�:������&��'�(D�49�5�<�<�(H�J�J��
J��#�
"�sV�K)�A(G&�=K)�&K&�H�4K&�K!�'J�8	K!�
J�AK!�!K&�&K)�)
K7c#�H# �[R"SS9n[R"URU5 [
RRUS5UlSv� [R"U5 SUlg![R"U5 SUlf=f7f)zGFreeze the status file to allow simulate operations during
a dpkg call.zaptdaemon-frozen-status)r#r�N)
r7�mkdtemp�shutil�copyrir8r9r:rj�rmtree)rl�
frozen_dirs  rr[�AptWorker._frozen_status�sv����%�%�-F�G�
����D�%�%�z�2� �g�g�l�l�:�x�@���	'���M�M�*�%�"&�D���
�M�M�*�%�"&�D��s�AB"�B�"B"�B�B"c��[e)z'Process a PackageKit query transaction.)�NotImplementedErrorr�s  rr��AptWorker.query�s��!�!rc��////////n/n/n/nSn/=n=n=n	=n
=n=nn
UR[[[[[
[[4;aUSS//4$UR(a
URnOURnURUSUS9 UR[:XaURUSS9 GO%URR(a[[UR!U55eUR[:Xa\UR#5H'nUR$(dMUR'U5 M) UR("U4SS0UR*D6 GO{UR[:Xa�UR,"U4SS0UR*D6nUR'UR.5 [1USR3SS55S	-nU[4R6:�a[9S
U-5eURUR.nURD(a7US:waXoRFRH-n/UR.//////Ul%O�UR.///////Ul%OmURJVVs/sH/nUVs/sHn[LRN"S
US5SPM  snPM1 snnupxp�p�URP"U/URJQ7SS06 URRS5n/nUGHnURT(abURD(aQURVU;aAURV<SURXRZ<3nU[\R'U5 GO�UR^(aQURVU;aAURV<SURXRZ<3nU[`R'U5 GO"URb(aPURVU
;a@URV<SURXRZ<3nU[dR'U5 O�URf(aPURVU;a@URV<SURXRZ<3nU[hR'U5 O`URj(aOURVU	;a?URV<SURFRZ<3nU[lR'U5 UR'URV5 GM URo5nURq5nUHUnURr(dMURV<SURXRZ<3nU[tR'U5 MW URRvnX`RR~-nUUUUU4$![:[<[>[84a9 UR*S(d!URAS5n[[BU5eGN$f=f![:a UR.///////Ul%GNef=fs snfs snnf![xan[[z[}U55eSnAff=f)NrT)r�r�)r�r�zInstalled-Size�,r �zSize is too large: %s Bytesr_z[The package doesn't provide a valid Installed-Size control field. See Debian Policy 5.6.20.z(=|/)r
r )@r#r$r�r�r�r%r�r�rjrir�r�rVr�r�r�r��_iterate_packages�
is_upgradabler�r�r�r�r��intr(�sys�maxsize�
OverflowErrorr��AttributeErrorr%�gettext�ERROR_INVALID_PACKAGE_FILEr�r��installed_sizer+r�r-r�rxr�r~r�r�r*r�r&r�r)r�r,rzr'r�r��marked_keep�	PKGS_KEEP�required_downloadr��ERROR_INCOMPLETE_INSTALLr��required_space)rlr0�dependsr"r/�	skip_pkgs�size�installs�
reinstalls�removals�purges�upgrades�upgradables�
downgrades�status_pathr3r`�msg�lstrr��
changes_names�pkg_strr�rFr�s                          r�_simulate_transaction�AptWorker._simulate_transaction�s����r�2�r�2�r�2�.���� ���	����	��	�:�	��	�6�	�H�	�{���:�:�3�5J�1�3G�2�4E�5�7�7��A�q�"�b�(�(�����-�-�K��+�+�K�����d�;��?��:�:�0�0��#�#�E�D�#�9�
�[�[�
%�
%�#�$6�$(�$<�$<�U�$C�E�
E�
�Z�Z�.�
.��-�-�/���$�$�$��&�&�s�+�0�
����E��E����E�
�Z�Z�,�
,��#�#�E�I�D�I�E�L�L�I�C����S�[�[�)�

M��3�/�0�8�8��b�A�B�T�I���#�+�+�%�'�(E��(L�M�M�&�
I��k�k�#�+�+�.���#�#��q�y��
�
� <� <�<��&(�3�;�;�-��R��R�%H�E�N�'*�{�{�m�R��R��R�%H�E�N�27���&A�1?�#�58�'9�47�5�(*�x�x����'B�1�'E�47�'9�1?�&A�
#�X�8�
�
� � ��G����G�$�G��+�+�)�)�+���
��C��"�"�s�'7�'7��H�H�H�,�%(�X�X�s�}�}�/D�/D�E����%�,�,�W�5��%�%�#�(�(�*�*D�%(�X�X�s�}�}�/D�/D�E����'�.�.�w�7��%�%�#�(�(�*�*D�%(�X�X�s�}�}�/D�/D�E����'�.�.�w�7��#�#�����(@�%(�X�X�s�}�}�/D�/D�E����%�,�,�W�5��"�"�s�x�x�x�'?�%(�X�X�s�}�}�/D�/D�E����$�+�+�G�4�� � ����*�%�(�3�3�5��"�;�;�=���C�����%(�X�X�s�}�}�/D�/D�E���	�"�)�)�'�2��	J� $��� =� =����� :� :�:���*�N�O�#�%�	%��K�n�j�-�H�
M��|�|�G�,��-�-�)K�L�C�,�,F��L�L�	-�
M���
E�#&�;�;�-��R��R��!D���
E��'9��&A��T�	J�#�$<�c�%�j�I�I��	J�sV�4AW
�9X �
Y�%Y	�1Y�Y�
AX�X� "Y�Y�	Y�
Y<�Y7�7Y<c�z�[URUR5 [RRU5(d[
[U5eSSS5 [RRX R5nUR!5nU(d[
["UR$5eU$!,(df   Nl=f![a [
[U5e[an[
[[U55eSnAff=f![an[
["[U55eSnAff=f)z�Perform some basic checks for the Debian package.

:param trans: The transaction instance.

:returns: An apt.debfile.Debfile instance.
N)r�uid�gidr8r9�isfiler��ERROR_UNREADABLE_PACKAGE_FILEru�debfile�
DebPackagerV�IOErrorrDr�r��checkr��_failure_string)rlr0r9r_r`rF�rets       rrY�AptWorker._check_deb_file^s����5�9�9�e�i�i�
0��7�7�>�>�$�'�'�'�(E�t�L�L�(�1�	L��+�+�(�(��{�{�;�C�
	M��)�)�+�C��#�$?�$'�$7�$7�9�
9��
�#1�
0���	I�#�$A�4�H�H��	L�#�$>��E�
�K�K��	L���	M�#�$?��U��L�L��	M�s;�5B=� )C�
D�=
C�#D�1D
�
D�
D:�D5�5D:c���[Ul[RR	S5nU[
RRUS54H�n[
R"U5H|nUS:XaM[
RRX45n[
RRU5(dMP[RSU5 [
R"U5 M~ M� g)z[Clean the download directories.

Keyword arguments:
trans -- the corresponding transaction
zDir::Cache::archives�partialrzRemoving file %sN)
r�r�rYr[rcr8r9r:r�rrErhr{)rlr0�archive_pathr�filenamer9s      rr��AptWorker.clean{s���*����~�~�.�.�/E�F�� �"�'�'�,�,�|�Y�"G�H�C��J�J�s�O���v�%���w�w�|�|�C�2���7�7�>�>�$�'�'��I�I�0�$�7��I�I�d�O�
,�Irc�\�[UlURSS"URUX45upVU(aU(d[[[S55eURX%U5 g![a4n[
R"S5 [[[U55eSnAff=f)aAdd a license key data to the given package.

Keyword arguemnts:
trans -- the coresponding transaction
pkg_name -- the name of the corresponding package
json_token -- the oauth token as json
server_name -- the server to use (ubuntu-production, ubuntu-staging)
rTrzget_license_key plugin failedNzThe license key is empty)�STATUS_DOWNLOADINGr�r|r	rD�loggingrr��!ERROR_LICENSE_KEY_DOWNLOAD_FAILEDr�r��_add_license_key_to_system)rlr0r��
json_token�server_name�license_key�license_key_pathrFs        rr��AptWorker.add_license_key�s���*���	0����.�/��2�5�9�9�h�3=�L�
*�K� �{�#�$E�$%�&@�$A�C�
C�	
�'�'��(8�	:���	0����=�>�#�$E�$'��J�0�
0��	0�s�&A-�-
B+�7/B&�&B+c���[RR[RRS5UR
S55nUR5RS5(dURS5(a[[[S55e[RRU5n[RR[RSURR
S5U5nURU5(d[[[S5U5e[RRU5(a[[[S5U5e[RRU5U:wa8[[[S5U[RRU55e[RR![RR#U55(d[[[S	5U5e[$R'S
U-5 [R("S5n[+US5nUR-U5 SSS5 [R("U5 g!,(df   N%=f![.a [[[S
5U5ef=f![R("U5 f=f)NrPr�z#!zELFz:The license key is not allowed to contain executable code.z"The license key path %s is invalidz"The license key already exists: %szdThe location of the license key is unsecure since it contains symbolic links. The path %s maps to %sz?The directory where to install the key to doesn't exist yet: %szWriting license key to '%s'r��wzFailed to write key file to: %s)r8r9r:rYr[rc�lstrip�stripr�r�� ERROR_LICENSE_KEY_INSTALL_FAILEDr�r��LICENSE_KEY_ROOTDIR�lexists�realpathr\r`rEr�r�r-r9r)rlr�r r!�license_key_path_rootdirr�license_files       rr�$AptWorker._add_license_key_to_system�sd���7�7�<�<����(?�(?��(F�(8�(?�(?��(D�F��
����*�*�4�0�0��&�&�y�1�1�#�$D�$%�'A�%B�C�
C��7�7�+�+�,<�=��#%�7�7�<�<��N�N�5�!�4�#;�#;�#B�#B�3�#G��$� � �*�*�+C�D�D�#�$D�$%�&J�$K�$4�6�
6��7�7�?�?�+�,�,�#�$D�$%�&J�$K�$4�6�
6��7�7���,�-�1A�A�#�$D�$%�'F�%G�%5�$&�G�G�$4�$4�5E�$F�H�
H��w�w�}�}�R�W�W�_�_�-=�>�?�?�#�$D�$%�'A�%B�$4�6�
6�
	���.�1A�A�B��H�H�R�L�	�	 ��&��,���"�"�;�/�-�
�H�H�Y��-�,���	6�#�$D�$%�&G�$H�$4�6�
6�	6��

�H�H�Y��s<�J+�)J�;J+�
J(�$J+�'K�(J+�+%K�K�K+c���[R"5R5(aN[R"5R5 [R"5R5(aMMgg)z)Process pending actions on the main loop.N)r	�main_context_default�pending�	iteration�rls r�_iterate_mainloop�AptWorker._iterate_mainloop�sI���'�'�)�1�1�3�3��%�%�'�1�1�3��'�'�)�1�1�3�3rc#�# �[UR5H"up#X!-(dUR5 Uv� M$ g7f)z�Itarte von the packages of the cache and iterate on the
GObject main loop time for more responsiveness.

Keyword arguments:
interval - the number of packages after which we iterate on the
    mainloop
N)�	enumeraterVr3)rl�intervalr2r3s    rr��AptWorker._iterate_packages�s2���#�4�;�;�/�I�D��?��&�&�(��I�0�s�=?c	�P�URS5nUS-
nURGH�nU(aUR(dU(dUR(dM6USUR--
nU(a
UR
nOURnS[UR5S--nSnURGHQnSn	URGH&n
U	(a	U	S-
n	X�-
n	U
RS;dl[RRS	S
5(aU
RS:Xd7[RRSS
5(aU
RS
:XdM�URU
RnU(a
UR
nO
URnU(a?[R"U
R U
R"UR 5(d GM#U
R<SU
R<S3n	U
R (a"U	SU
R"<SU
R <S3-
n	URR%U
R5(aX�RS5-
n	GM�U(d3U(aX�RS5-
n	GM�X�RS5-
n	GM�U(a#X�RS5UR --
n	GMX�RS5UR --
n	GM) U(aXv-
nXy-
nUS-
nGMT X7-
nGM� U$![a SnGN�f=f)a+Return a message which provides debugging information about
broken packages.

This method is basically a Python implementation of apt-get.cc's
ShowBroken.

Keyword arguments:
trans -- the corresponding transaction
now -- if we check currently broken dependecies or the installation
       candidate
z/The following packages have unmet dependencies:z

z%s: r�rr zor
)rsrr�	Obsoletes�
DpkgBreaks�	ConflictszAPT::Install-RecommendsFrtzAPT::Install-Suggests�SuggestsNr��(z) zbut it is a virtual packagezbut it is not installedz#but it is not going to be installedzbut %s is installedzbut %s is to be installedr")r�rV�
is_now_broken�is_inst_brokenr~r�r�r\�dependencies�or_dependencies�rawtyperYr[�find_br��	check_depr��relation�is_virtual_package)
rlr0r�rr3r��indent�dep_msgr|�or_msg�base_dep�pkg_dep�dep_versions
             rr��AptWorker._get_broken_details�s����m�m�M�N���v�
���;�;�C��S�.�.���!3�!3���6�C�H�H�$�$�C���-�-���-�-���C����M�A�-�.�F��G��+�+���� #� 3� 3�H���&�(���(��%�,�,�1>�>�%�^�^�2�2�3L�38�:�:�$�,�,��<�$�^�^�2�2�3J�38�:�:�%�-�-��;� �<�"&�+�+�h�m�m�"<���*1�*;�*;�K�*1�*;�*;�K�#�7�+<�+<�X�=M�=M�=E�=N�=N�=D�_�_�,N�,N��*2�*:�*:�H�M�M�J�F��'�'���0A�0A�08�0@�0@�#B�B���{�{�5�5�h�m�m�D�D��-�-�0M�"N�N��(��"�m�m�4M�&N�N�F�"�m�m�5C�'D�D�F���=�=�1F�#G�#.�#6�#6�$7�8���=�=�1L�#M�#.�#6�#6�$7�8��g!4�p��)���%�G��t�O�G�{,�|
�N�C�S�T�
��S$�+�&*��+�s�L�L%	�$L%	c��[RR[RR[R
R
S5S55$)z7If a reboot is required to get all changes into effect.rPzvar/run/reboot-required)r8r9rXr:rYr[rcr2s r�is_reboot_required�AptWorker.is_reboot_requiredIs=���w�w�~�~�b�g�g�l�l�7�>�>�+B�+B�5�+I�+D�F�G�	Grc�4�US:XaURU5 gg)z$Write a configuration value to file.�PopConParticipationN)�_set_popcon_pariticipation)rl�option�valuers    r�
set_config�AptWorker.set_configNs���*�*��+�+�E�2�+rc�&�US;aSnOSn[RR[5(aD[	[5nUR5nSSS5 [R"SSU-W5nON[5nUR[	SS5RS55 [UR5US	.-n[	[S
5nURU5 SSS5 g!,(df   N�=f!,(df   g=f)N)Tr
�yesrZ�noz(PARTICIPATE=*)(".+?")z\1"%s"z/dev/urandom�rr�)�host_id�participater$)
r8r9rX�_POPCON_PATHr-rCr�r1�md5r��_POPCON_DEFAULT�	hexdigestr9)rlr^rV�	conf_file�
old_configr[�ms       r�_set_popcon_participation�#AptWorker._set_popcon_participationSs����*�*��E��E�
�7�7�>�>�,�'�'��l�#�y�&�^�^�-�
�$��V�V�5�%��-�&�(�F�
��A�
�H�H�T�.�#�.�3�3�D�9�:�$�1�;�;�=�7<�(>�>�F��,��
$�	��O�O�F�#�%�
$�$�#��%�
$�s�C1�D�1
C?�
Dc�p�US:Xa"Sn[RRUS5$US:Xa"Sn[RRUS5$US:Xa"Sn[RRUS5$US	:Xa"S
n[RRUS5$US:XaUR	5$g)
zReturn a configuration value.�AutoUpdateIntervalz#APT::Periodic::Update-Package-Listsr�AutoDownloadz,APT::Periodic::Download-Upgradeable-PackagesF�AutoCleanIntervalz APT::Periodic::AutocleanInterval�UnattendedUpgradez!APT::Periodic::Unattended-Upgrade�GetPopconParticipationN)rYr[�find_irD�_get_popcon_pariticipation)rlrU�keys   r�
get_config�AptWorker.get_configks����)�)�7�C��>�>�(�(��a�0�0�
�~�
%�@�C��>�>�(�(��e�4�4�
�*�
*�4�C��>�>�(�(��a�0�0�
�*�
*�5�C��>�>�(�(��e�4�4�
�/�
/��2�2�4�4�0rc��[RR[5(aP[	[5nUR5nSSS5 [R"SW5nU(a
USS:Xagg!,(df   N7=f)Nz
PARTICIPATE="(yes|no)"rrZTF)r8r9rXr_r-rCr�r�)rlrcr[r�s    r�_get_popcon_participation�#AptWorker._get_popcon_participation|s`���7�7�>�>�,�'�'��l�#�y�"���)��$��H�H�9�6�B�E���q��U�*���$�#�s�A:�:
B)rVrgrjrir�)NTr)F)TF)r
�FN))rM�2)rwr�)i�)T)6�__name__�
__module__�__qualname__�__firstlineno__r�rY�get_architectures�NATIVE_ARCHr(rUr�r�r�r�r�r�r�r�r�rr�r�r�rlr�r��staticmethodr�r�r�r�r�r�r�r�r��
contextlib�contextmanagerr[r�rrYr�r�rr3r�r�rPrWrfrqrt�__static_attributes__rrrrr�s5��=��+�+�-�a�0�K�"��.4�`�,3�l6;�'�<
N�$�&
� 38�1"�f �&*�XG*�R6�>!�63�4�0+"�Z,"�\�(��(�"22�h'�,2� 2�"'�"@�4�19�%-�:5�x���
'��
'�"�r%�h�:$�$:�82 �h4�
�X�tG�
3�
$�05�"r)<r��
__author__�__all__rr5r7rr+r8r�r�r2r�r7�time�	traceback�urllib.parserr�ImportError�urlparse�configparserrru�	apt.cache�apt.debfilerYr��aptsources.distro�aptsources.sourceslistr�
gi.repositoryrr	r r�enums�errorsr�utilsrr�rrrrrrrr�	getLoggerrEr�r_rar.r5r=r;rrrr�<module>r�s���7�"5�
��������	�	�
��
����.�1�*�)�������.�'�����!�������*�+����-���� >A�U�7�8��&r�
�r��_�.�-�-�.��
�*�)�*�s#�C�C+�C(�'C(�+C:�9C:

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 16.11 KB 0644
aptworker.cpython-313.pyc File 68.82 KB 0644
Filemanager