Ë
    ÖÓ­h€f ã                   ó*  — d Z dZdZddlZddlmZ ddlZddlmZ ddl	Z	ddl
Z
ddlZ
ddlmZ ddlZddlZddlZddlZddlZddlZddlmZmZ ddlZddlZddlZd	d
lmZ d	dlmZ d	dlmZ ddl m!Z!m"Z"m#Z# ddl$m%Z% d	dlm&Z& d	dl'm(Z(m)Z) d	dl*m+Z+ d	dl,m-Z-m.Z. d	dl/m0Z0 d	dl1m2Z2 d„ Z3ejh                  dk\  rdZ5dZ6ndZ5dZ6dZ7dZ8dZ9dZ:dZ;dZ<d Z=d!Z>d"Z?d#Z@d$ZAej`                  j„                  j‡                  d%¬&«        ejˆ                  d'd(«        e
jŠ                  d)«      ZF	 e
jŽ                  j‘                  d*e
jŽ                  j�                  j’                  ¬+«      ZJeJj—                  e
j˜                  «        e
jš                  d,«      ZNeJjŸ                  eN«       eFj¡                  eJ«        e
j¢                  «       ZR e2d-d.«      ZSeRjŸ                  eS«       eFj¡                  eR«        e
jŠ                  d/«      ZT	  e	jª                  e	j¬                  d0«        G d2„ d3ej²                  j´                  «      Z[ G d4„ d5e[«      Z\ G d6„ d7ej*                  «      Z] G d8„ d)e[«      Z^d;d9„Z_d:„ Z`y#  Y ŒÂxY w# e	j®                  $ r eFj±                  d1«       Y Œ{w xY w)<aB  
Core components of aptkit.

This module provides the following core classes of the aptkit:
AptKit - complete daemon for managing software via DBus interface
Transaction - represents a software management operation
TransactionQueue - queue for aptkit transactions

The main function allows to run the daemon as a command.
z%Sebastian Heinlein <devel@glatzor.de>)
ÚTransactionÚTransactionQueueÚAptKitÚ!APTKIT_TRANSACTION_DBUS_INTERFACEÚ%APTKIT_DBUS_INTERFACEAPTKIT_DBUS_PATHÚAPTKIT_DBUS_SERVICEÚAPTKIT_IDLE_CHECK_INTERVALÚAPTKIT_IDLE_TIMEOUTÚTRANSACTION_IDLE_TIMEOUTÚTRANSACTION_DEL_TIMEOUTé    N)ÚElementTree)Úmd5)ÚOptionParser)ÚGObjectÚGLibé   )ÚConfigWriter)Úerrors)Úenums)Úinline_callbacksÚreturn_valueÚDeferred)Údbus_deferred_method)Ú
policykit1)Úsplit_package_idÚset_euid_egid)ÚDummyWorker)Ú	AptWorkerÚ.trans_only_installs_pkgs_from_high_trust_repos)Úmainloop)ÚColoredFormatterc                 ó.   — t        j                  d| «      S )NÚaptkit)ÚgettextÚdgettext)Úmsgs    ú-/usr/lib/python3/dist-packages/aptkit/core.pyú<lambda>r(   G   s   € ”× Ñ  ¨3Ó/€ ó    Ú3r$   ÚngettextÚugettextÚ	ungettextz
org.aptkitz/org/aptkitzorg.aptkit.transactioné<   iX  é,  é   z$^[a-z0-9][a-z0-9\-+.]+(:[a-z0-9]+)?$z^[0-9][0-9.+\-A-Za-z:~]*$z^[a-zA-Z0-9_\-\.]+$T)Úset_as_defaultÚPATHz</usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binr   z/dev/log)ÚaddressÚfacilityz$%(name)s: %(levelname)s: %(message)sz1%(asctime)s %(name)s [%(levelname)s]: %(message)sz%TzAptKit.TransÚ z7Failed to unset LC_ALL. Translations are not available.c                   óÊ  — e Zd ZdZdZej                  j                  ej                  d¬«      d„ «       Z	ej                  j                  ej                  dddd	¬
«      d„ «       Z eej                  ddd¬«      d„ «       Zej                  j                  ej                  dd¬«      d„ «       Zej                  j                  ej                  dd¬«      d„ «       Zd„ Zd„ Zy)Ú
DBusObjectz6Enhanced D-Bus object class which supports properties.© zsa{sv}as©Údbus_interfaceÚ	signaturec                 ó@   — t         j                  d|›d|›d|›�«       y)aÓ  The signal gets emitted if a property of the object's
        interfaces changed.

        :param property: The name of the interface.
        :param changed_properties: A dictrionary of changed
            property/value pairs
        :param invalidated_properties: An array of property names which
            changed but the value isn't conveyed.

        :type interface: s
        :type changed_properties: a{sv}
        :type invalidated_properties: as
        zEmitting PropertiesChanged: ú, N©ÚlogÚdebug)ÚselfÚ	interfaceÚchanged_propertiesÚinvalidated_propertiess       r'   ÚPropertiesChangedzDBusObject.PropertiesChanged“   s    € ô" 	�	Š	ÚÒ0Ñ2HðJõ 	Kr)   r5   ÚsÚobject_pathÚ
connection)Úin_signatureÚout_signatureÚpath_keywordÚconnection_keywordc           	      ó¢  — t         j                  j                  j                  | ||«      }t	        j
                  |«      }|j                  d«      D �]â  }| j                  |j                  d   «      }|j                  «       D �]­  \  }}d|i}	|| j                  v rd|	d<   nd|	d<   t        |t         j                  «      rd|	d<   �nDt        |t         j                  «      rd|	d<   �n#t        |t         j                  «      rd	|	d<   �nt        |t         j                  «      rd
|	d<   nât        |t         j                   «      rd|	d<   nÂt        |t         j"                  «      rd|	d<   n¢t        |t         j$                  «      rd|j&                  z  |	d<   nut        |t         j(                  «      rd|j&                  z  |	d<   nHt        |t         j*                  «      rd|j&                  z  |	d<   nt-        dt/        |«      ›d|›d�«      ‚|j1                  t	        j2                  d|	«      «       �Œ° �Œå t	        j4                  |d¬«      }
|
S )NrB   ÚnameÚ	readwriteÚaccessÚreadrF   ÚtypeÚuÚiÚtÚxÚbz(%s)za{%s}za%szType z of property z isn't convertableÚpropertyúUTF-8)Úencoding)ÚdbusÚserviceÚObjectÚ
Introspectr   Ú
fromstringÚfindallÚ_get_propertiesÚattribÚitemsÚWRITABLE_PROPERTIESÚ
isinstanceÚStringÚUInt32ÚInt32ÚUInt64ÚInt64ÚBooleanÚStructr;   Ú
DictionaryÚArrayÚ	ExceptionrR   ÚappendÚElementÚtostring)rA   rG   rH   ÚdataÚxmlÚifaceÚpropsÚkeyÚvaluerb   Únew_datas              r'   r^   zDBusObject.Introspect¨   så  € ô �|‰|×"Ñ"×-Ñ-¨d°KÀÓLˆÜ×$Ñ$ TÓ*ˆØ—[‘[ Ó-ó 	FˆEØ×(Ñ(¨¯©°fÑ)=Ó>ˆEØ#Ÿk™k›mó F‘
��UØ  #˜�Ø˜$×2Ñ2Ñ2Ø'2�F˜8Ò$à'-�F˜8Ñ$Ü˜e¤T§[¡[Ô1Ø%(�F˜6“NÜ ¤t§{¡{Ô3Ø%(�F˜6“NÜ ¤t§z¡zÔ2Ø%(�F˜6“NÜ ¤t§{¡{Ô3Ø%(�F˜6’NÜ ¤t§z¡zÔ2Ø%(�F˜6’NÜ ¤t§|¡|Ô4Ø%(�F˜6’NÜ ¤t§{¡{Ô3Ø%+¨e¯o©oÑ%=�F˜6’NÜ ¤t§¡Ô7Ø%,¨u¯©Ñ%>�F˜6’NÜ ¤t§z¡zÔ2Ø%*¨U¯_©_Ñ%<�F˜6’Nå#Ü59¸%µ[Â#ð%Gó Hð Hà—‘œ[×0Ñ0°¸VÓDÖEò7Fð	Fô< ×'Ñ'¨°gÔ>ˆØˆr)   ÚssvÚsender©rI   rJ   Úsender_keywordc                 ó`   — t         j                  d|›d|›�«       | j                  ||||«      S )ar  Set a property.

        Only the user who intiaited the transaction is
        allowed to modify it.

        :param iface: The interface which provides the property.
        :param name: The name of the property which should be modified.
        :param value: The new value of the property.

        :type iface: s
        :type name: s
        :type value: v
        zSet() was called: r=   )r?   r@   Ú_set_property©rA   ru   rN   rx   r{   s        r'   ÚSetzDBusObject.SetÒ   s,   € ô" 	�	Š	²±eÐ<Ô=Ø×!Ñ! %¨¨u°fÓ=Ð=r)   za{sv}©rI   rJ   c                 óT   — t         j                  d|z  «       | j                  |«      S )z4Get all available properties of the given interface.zGetAll() was called: %s©r?   r@   ra   ©rA   ru   s     r'   ÚGetAllzDBusObject.GetAllç   s'   € ô 	�	‰	Ð+¨eÑ3Ô4Ø×#Ñ# EÓ*Ð*r)   ÚssÚvc                 ó`   — t         j                  d|›d|›�«       | j                  |«      |   S )zXReturn the value of the given property provided by the given
        interface.
        zGet() was called: r=   r„   )rA   ru   rX   s      r'   ÚGetzDBusObject.Getï   s+   € ô 	�	Š	²±xÐ@ÔAØ×#Ñ# EÓ*¨8Ñ4Ð4r)   c                 óF   — t         j                  j                  d|z  «      ‚)ú;Helper to set a property on the properties D-Bus interface.ú!Unknown or read only property: %s)r[   Ú
exceptionsÚDBusExceptionr€   s        r'   r   zDBusObject._set_propertyø   s)   € ä�o‰o×+Ñ+ð -;Ø=Añ-Bó Cð 	Cr)   c                 ó   — i S )ú2Helper to get the properties of a D-Bus interface.r8   r…   s     r'   ra   zDBusObject._get_propertiesý   s   € àˆ	r)   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rd   r[   r\   ÚsignalÚPROPERTIES_IFACErE   ÚmethodÚINTROSPECTABLE_IFACEr^   r   r�   r†   rŠ   r   ra   r8   r)   r'   r7   r7   Œ   s  „ á@àÐð 
‡\�\×Ñ¨×(=Ñ(=Ø#-ð ó /ñKó/ðKð& 
‡\�\×Ñ˜×2Ñ2Ø&(¸Ø&3Ø,8ð ó :ñ#ó	:ð#ñL ˜$×/Ñ/Ø',¸BØ)1ô3ñ>ó3ð>ð$ 
‡\�\×Ñ˜×.Ñ.Ø&)¸ð ó Bñ+óBð+ð 
‡\�\×Ñ˜×.Ñ.Ø&*¸#ð ó ?ñ5ó?ð5òCó
r)   r7   c                   ó	  — e Zd ZdZi ej
                  d“ej                  ej                  “ej                  ej                  “ej                  ej                  “ej                  ej                  “ej                  ej                  “ej                  ej                   “ej"                  ej                  “ej$                  ej&                  “ej(                  ej&                  “ej*                  ej&                  “ej,                  ej                  “ej.                  ej                  “ej0                  ej&                  “ej2                  ej                  “ej4                  ej6                  “ej8                  ej&                  “ej:                  ej                  i¥ZdZ	 dmd„Z d„ Z!d„ Z"d„ Z#d„ Z$d	„ Z% e&e%e$d
¬«      Z'd„ Z(d„ Z) e&e)e(d¬«      Z*d„ Z+d„ Z, e&e,e+d¬«      Z-d„ Z.d„ Z/ e&e/e.d¬«      Z0d„ Z1d„ Z2 e&e2e1d¬«      Z3d„ Z4d„ Z5 e&e4e5d¬«      Z6d„ Z7d„ Z8 e&e7e8d¬«      Z9d„ Z:d„ Z; e&e;e:d ¬«      Z<d!„ Z=d"„ Z> e&e=e>d#¬«      Z?d$„ Z@d%„ ZA e&e@eAd&¬«      ZBd'„ ZCd(„ ZD e&eCeDd)¬«      ZEd*„ ZFd+„ ZG e&eFeGd,¬«      ZHd-„ ZId.„ ZJ e&eIeJd/¬«      ZKd0„ ZLd1„ ZM e&eLeMd2«      ZNd3„ ZOd4„ ZP e&eOePd5¬«      ZQd6„ ZRd7„ ZS e&eReSd8¬«      ZTd9„ ZUd:„ ZV e&eUeVd;¬«      ZWd<„ ZXd=„ ZY e&eXeYd>¬«      ZZd?„ Z[d@„ Z\ e&e[e\dA¬«      Z]dB„ Z^dC„ Z_ e&e^e_dD¬«      Z`eajÄ                  jÇ                  eddE¬F«      dG„ «       ZeeajÄ                  jÇ                  eddH¬F«      dI„ «       ZfeajÄ                  jÇ                  eddJ¬F«      dK„ «       ZgeajÄ                  jÇ                  eddJ¬F«      dL„ «       ZhdM„ ZiejdN„ «       ZkdO„ ZldP„ ZmeajÄ                  jÝ                  eddHdQdR¬S«      dT„ «       Zo epeddQdQdR¬S«      dU„ «       ZqejdV„ «       ZrejdW„ «       ZsejdX„ «       ZtejdY„ «       Zu epeddQdQdR¬S«      dZ„ «       Zvejd[„ «       Zw epeddQdQdR¬S«      d\„ «       Zxejd]„ «       Zyejd^„ «       Zzd_„ Z{d`„ Z|da„ Z} epeddHdQdR¬S«      db„ «       Z~ejdc„ «       Z epeddJdQdR¬S«      dd„ «       Z€ejde„ «       Z�ejdf„ «       Z‚dg„ Zƒejdh„ «       Z„di„ Z…dj„ Z†dk„ Z‡dl„ Zˆy)nr   a  Represents a transaction on the D-Bus.

    A transaction represents a single package management task, e.g.
    installation or removal of packages. This class allows to expose
    information and to controll the transaction via DBus using PolicyKit
    for managing privileges.
    N)Ú	HttpProxyÚTerminalÚAllowUnauthenticatedÚDebconfSocketÚMetaDataÚLocaleÚRemoveObsoleteDependsc           	      óŒ
  — |€t        j                  «       j                  }d|z  | _        |	du r]|
| _        |
€t        j                  «       | _        t
        j                  j                  t        | j                  «      }| j                  }nd}
d}d}t        j                  | ||«       |sg g g g g g f}|si }|| _        || _        || _        t        j                  d«      | _        t        j"                  d«      | _        t        j"                  d«      | _        || _        || _        t        j                  d«      | _        t        j                  d«      | _        d| j                  z  }t0        j2                  j5                  |«      rt        j                  |«      | _        nt        j                  d«      | _        || _        d| _        d| _        t        j                  |«      | _        t        j@                  d«      | _!        t        jD                  dd	¬
«      | _#        t        jD                  dd¬
«      | _$        t        jD                  dd¬
«      | _%        t        j                  tL        jN                  «      | _(        t        j                  tL        jR                  «      | _*        t        j                  d«      | _+        d| _,        t        jD                  dd¬
«      | _-        t        j"                  d«      | _.        t        j"                  d«      | _/        t        jD                  dd¬
«      | _0        t        jD                  dd¬
«      | _1        d| _2        t        j"                  d«      | _3        t        j"                  d«      | _4        t        jj                  d¬
«      | _6        t        jn                  d«      | _8        t        jn                  d«      | _9        t        jD                  tu        d«      D �cg c]  }t        jv                  g d¬
«      ‘Œ c}d¬
«      | _<        t        jD                  |D �cg c]  }t        jv                  |d¬
«      ‘Œ c}d¬
«      | _=        t        jv                  g t        j|                  d«      ¬
«      | _?        t        jv                  g t        j|                  d«      ¬
«      | _@        tƒ        j„                  t†        | jˆ                  «      | _E        d| _F        |
r"|
j�                  || j�                  «      | _I        nd| _I        || _J        d| _K        d| _L        d| _M        yc c}w c c}w )aˆ  Initialize a new Transaction instance.

        Keyword arguments:
        tid -- The unique identifier
        role -- The role enum of the transaction
        queue -- TransactionQueue instance of the daemon
        pid -- the id of the process which created the transaction
        uid -- the uid of the user who created the transaction
        cmdline -- the cmdline of the calling process
        sender -- the DBus name of the sender who created the transaction
        connect -- if the Transaction should connect to DBus (default is True)
        bus -- the DBus connection which should be used
            (defaults to system bus)
        Nz/org/aptkit/transaction/%sTr5   Fz/run/user/%d/pk-debconf-socketr   )r   r   r   r   g        r   Úiixxdx©r;   )r5   r5   r5   r   r   r5   Ússsxxs©r5   r5   r‡   Úsvé   rF   ÚasasasasasasasÚasasasasasas)NÚuuidÚuuid4ÚhexÚtidÚbusr[   Ú	SystemBusr\   ÚBusNamer   r7   Ú__init__ÚqueueÚuidÚgidrf   Úlocalerk   Úallow_unauthenticatedÚremove_obsoleted_dependsÚcmdlineÚpidÚ
http_proxyÚterminalÚosÚpathÚexistsÚdebconfÚkwargsÚ_translationÚafterÚ_rolerh   Ú	_progressrl   Ú_progress_detailsÚ_progress_downloadÚ_progress_packager   ÚEXIT_UNFINISHEDÚ_exitÚSTATUS_SETTING_UPÚ_statusÚ_status_detailsÚ_errorÚ_error_propertyÚ_cancellableÚ_term_attachedÚ_required_mediumÚ_config_file_conflictÚ _config_file_conflict_resolutionÚ	cancelledÚpausedrm   Ú
_meta_datarj   Ú	_downloadÚ_spaceÚrangern   Ú_dependsÚ	_packagesÚ	SignatureÚ_unauthenticatedÚ_high_trust_packagesr   Útimeout_add_secondsr
   Ú _remove_from_connection_no_raiseÚ_idle_watchÚsender_aliveÚwatch_name_ownerÚ_sender_owner_changedÚ_sender_watchr{   ÚoutputÚ	simulatedÚ_simulated_cb)rA   r®   Úroler³   rº   r´   rµ   r¹   r{   Úconnectr¯   ÚpackagesrÁ   Úbus_nameÚ	dbus_pathÚ	pk_socketrT   Úpkgss                     r'   r²   zTransaction.__init__5  sî  € ð  ˆ;Ü—*‘*“,×"Ñ"ˆCØ/°#Ñ5ˆŒØ�d‰?ØˆDŒHØˆ{ÜŸ>™>Ó+�”Ü—|‘|×+Ñ+Ô,?ÀÇÁÓJˆHØŸ™‰IàˆCØˆHØˆIÜ×Ñ˜D (¨IÔ6ÙØ˜B  B¨¨BÐ/ˆHÙØˆFØˆŒ
ØˆŒØˆŒÜ—k‘k "“oˆŒÜ%)§\¡\°%Ó%8ˆÔ"Ü(,¯©°UÓ(;ˆÔ%ØˆŒØˆŒÜŸ+™+ b›/ˆŒÜŸ™ B›ˆŒØ4°t·x±xÑ?ˆ	Ü�7‰7�>‰>˜)Ô$ÜŸ;™; yÓ1ˆD�LäŸ;™; r›?ˆDŒLØˆŒØ ˆÔàˆŒ
Ü—[‘[ Ó&ˆŒ
ÜŸ™ A›ˆŒä!%§¡Ð-AØ7?ô"AˆÔä"&§+¡+Ð.DØ8@ô#BˆÔä!%§¡¨XÀÔ!FˆÔÜ—[‘[¤×!6Ñ!6Ó7ˆŒ
Ü—{‘{¤5×#:Ñ#:Ó;ˆŒÜ#Ÿ{™{¨2›ˆÔØˆŒÜ#Ÿ{™{¨8¸tÔDˆÔÜ ŸL™L¨Ó.ˆÔÜ"Ÿl™l¨5Ó1ˆÔÜ $§¡¨HÀÔ EˆÔÜ%)§[¡[°ÀTÔ%JˆÔ"Ø02ˆÔ-ÜŸ™ eÓ,ˆŒÜ—l‘l 5Ó)ˆŒÜŸ/™/°DÔ9ˆŒÜŸ™ A›ˆŒÜ—j‘j “mˆŒÜŸ™Ü.3°A«hö%8Ø)*ô &*§Z¡Z°¸cÖ%Bò %8à.>ô@ˆŒô Ÿ™Ø2:ö&<Ø*.ô '+§j¡j°ÀÖ&Eò &<à/=ô?ˆŒô !%§
¡
¨2¼¿¹ÈÓ9LÔ MˆÔÜ$(§J¡J¨rÜ9=¿¹ÈÓ9Lô%NˆÔ!ô  ×3Ñ3Ü$ d×&KÑ&KóMˆÔð !ˆÔÙØ!$×!5Ñ!5Ø˜×2Ñ2ó"4ˆDÕð "&ˆDÔØˆŒØˆŒØˆŒØ!ˆÕùò/%8ùò&<s   Ï;T<Ð:Uc                 ó   — |sd| _         yy)zPCallback if the owner of the original sender changed, e.g.
        disconnected.FN)rã   )rA   rH   s     r'   rå   z!Transaction._sender_owner_changedš  s   € ñ Ø %ˆDÕð r)   c                 ó*  — t         j                  d«       	 | j                  «        	 | j                  j
                  j                  | j                  «       y# t        $ r"}t         j                  d|z  «       Y d}~ŒWd}~ww xY w# t        $ r Y yw xY w)zdVersion of remove_from_connection that does not raise if the
        object isn't exported.
        zRemoving transactionz1remove_from_connection() raised LookupError: '%s'NF)	Ú	log_transr@   Úremove_from_connectionÚLookupErrorr³   ÚlimboÚpopr®   ÚKeyError)rA   Úerrors     r'   rá   z,Transaction._remove_from_connection_no_raise   sŽ   € ô 	�‰Ð.Ô/ð	,Ø×'Ñ'Ô)ð
	Ø�J‰J×Ñ× Ñ  §¡Ô*ð øô ò 	,Ü�O‰Oð #Ø%*ñ+÷ ,ñ ,ûð	,ûô ò 	ØØð	ús(   —A ¨/B Á	BÁ!A>Á>BÂ	BÂBc                 ó$  — g }t        |«      D �]  \  }}	 ||   dk(  r%|j                  t        j                  |«      «       në||   dk(  r%|j                  t        j                  |«      «       n¾||   dk(  r%|j                  t        j
                  |«      «       n‘||   dk(  r%|j                  t        j                  |«      «       nd||   dk(  r%|j                  t        j                  |«      «       n7||   dk(  r|j                  t        |«      «       nt        d|›d||   ›�«      ‚�Œ" t        j                  |t        j                  |«      ¬«      S # t        $ r+}|j                  d	|›d
|›d|›dt        |«      ›�«      ‚d}~ww xY w)z­Convert a list to a DBus struct with the given signature. Currently
        integer, long, unsigned long, double, string and boolean are
        supported (ixtdsb).
        rT   rV   rU   ÚdrW   rF   zValue z with unknown signature zFailed to convert item z of z with signature z: Nr¤   )Ú	enumeraterp   r[   rh   rj   ri   ÚDoublerk   Úget_dbus_stringro   Ú	__class__Ústrrl   rÝ   )rA   Úlstr;   ÚstructÚnumÚitemrù   s          r'   Ú_convert_structzTransaction._convert_struct±  s^  € ð
 ˆÜ" 3›ó 	I‰IˆC�ðIØ˜S‘> SÒ(Ø—M‘M¤$§*¡*¨TÓ"2Õ3Ø˜s‘^ sÒ*Ø—M‘M¤$§*¡*¨TÓ"2Õ3Ø˜s‘^ sÒ*Ø—M‘M¤$§+¡+¨dÓ"3Õ4Ø˜s‘^ sÒ*Ø—M‘M¤$§+¡+¨dÓ"3Õ4Ø˜s‘^ sÒ*Ø—M‘M¤$§,¡,¨tÓ"4Õ5Ø˜s‘^ sÒ*Ø—M‘M¤/°$Ó"7Õ8å#Ú%)¨9°Sª>ð%;ó <ð <ùð	Iô, �{‰{˜6¬T¯^©^¸IÓ-FÔGÐGøô ò IØ—o’oÚ<?ÂÚ<EÜ<?À¼Jð'Hó Ið IûðIús   –DEÅ	FÅ$&F
Æ
Fc                 óÜ  — | j                   t        j                  k7  rt        j                  «       ‚t        |t        j                  «      st        j                  d|z  «      ‚|j                  j                  d«      st        j                  d«      ‚|j                  «       D ]�  \  }}|| j                  v rt        j                  d|z  «      ‚t        |j                  d«      «      dkD  st        j                  d«      ‚t        |t        j                  «      rŒyt        j                  d|z  «      ‚ | j                  j!                  |«       | j#                  d	| j                  «       y )
Nz)The data value has to be a dictionary: %srF   z"Only strings are accepted as keys.zHThe key %s already exists. It is not allowed to overwrite existing data.Ú_r   z5The key %s has to be of the format IDENTIFIER-KEYNAMEz The value has to be a string: %srŸ   )Ústatusr   rË   r   ÚTransactionAlreadyRunningre   r[   rm   ÚInvalidMetaDataErrorr;   Ú
startswithrc   r×   ÚlenÚsplitrf   ÚupdateÚPropertyChanged)rA   rs   rw   rx   s       r'   Ú_set_meta_datazTransaction._set_meta_dataÏ  sX  € à�;‰;œ%×1Ñ1Ò1Ü×2Ñ2Ó4Ð4Ü˜$¤§¡Ô0Ü×-Ñ-ð /?ØAEñ/Fó Gð Gà�~‰~×(Ñ(¨Ô-Ü×-Ñ-ð /9ó :ð :àŸ*™*›,ò 	H‰JˆC�Ø�d—o‘oÑ%Ü×1Ñ1ð 3:ð =@ñ3@ó Að Aô �s—y‘y “~Ó&¨Ò*Ü×1Ñ1ð 3Gó Hð Hô ˜e¤T§[¡[Õ1Ü×1Ñ1ð 3?ØAFñ3Gó Hð Hð	Hð 	�‰×Ñ˜tÔ$Ø×Ñ˜Z¨¯©Õ9r)   c                 ó   — | j                   S ©N)r×   ©rA   s    r'   Ú_get_meta_datazTransaction._get_meta_dataê  s   € Ø�‰Ðr)   zRAllows client applications to store meta data for the transaction in a dictionary.)Údocc                 óÒ   — | j                   t        j                  k7  rt        j                  «       ‚t        j                  |«      | _         | j                  d| j                   «       y )NÚRole)rÄ   r   Ú
ROLE_UNSETr   ÚTransactionRoleAlreadySetr[   rf   r  ©rA   Úenums     r'   Ú	_set_rolezTransaction._set_roleñ  sG   € Ø�:‰:œ×)Ñ)Ò)Ü×2Ñ2Ó4Ð4Ü—[‘[ Ó&ˆŒ
Ø×Ñ˜V T§Z¡ZÕ0r)   c                 ó   — | j                   S r  )rÄ   r  s    r'   Ú	_get_rolezTransaction._get_role÷  ó   € Ø�z‰zÐr)   zOperation type of transaction.c                 ój   — | j                  |d«      | _        | j                  d| j                  «       y )Nr£   ÚProgressDetails)r  rÆ   r  )rA   Údetailss     r'   Ú_set_progress_detailsz!Transaction._set_progress_detailsü  s.   € à!%×!5Ñ!5°g¸xÓ!HˆÔØ×ÑÐ.°×0FÑ0FÕGr)   c                 ó   — | j                   S r  )rÆ   r  s    r'   Ú_get_progress_detailsz!Transaction._get_progress_details  ó   € Ø×%Ñ%Ð%r)   zzTuple containing detailed progress information: items done, total items, bytes done, total bytes, speed and remaining timec                 óà   — || _         | j                  |j                  «      |j                  z  }| j	                  |j
                  |fd«      | _        | j                  d| j                  «       y )Nr‡   ÚError)rÎ   r$   r"  Údetails_argsr  ÚcoderÏ   r  )rA   Úexcepr&   s      r'   Ú
_set_errorzTransaction._set_error
  sZ   € ØˆŒØ�l‰l˜5Ÿ=™=Ó)¨E×,>Ñ,>Ñ>ˆØ#×3Ñ3°U·Z±ZÀÐ4EÀtÓLˆÔØ×Ñ˜W d×&:Ñ&:Õ;r)   c                 ó   — | j                   S r  )rÎ   r  s    r'   Ú
_get_errorzTransaction._get_error  ó   € Ø�{‰{Ðr)   zRaised exception.c                 ód  — t         j                  | _        t        j                  |«      | _        | j                  d| j
                  «       | j                  | j
                  «       | j                  r| j                  j                  «        t        j                  t        | j                  «       y )NÚ	ExitState)r   ÚSTATUS_FINISHEDr  r[   rf   rÊ   r  ÚFinishedræ   Úcancelr   rà   r   rá   r  s     r'   Ú	_set_exitzTransaction._set_exit  s{   € Ü×+Ñ+ˆŒÜ—[‘[ Ó&ˆŒ
Ø×Ñ˜[¨$¯*©*Ô5Ø�‰�d—j‘jÔ!Ø×ÒØ×Ñ×%Ñ%Ô'ô 	× Ñ Ô!8Ø!%×!FÑ!Fõ	Hr)   c                 ó   — | j                   S r  )rÊ   r  s    r'   Ú	_get_exitzTransaction._get_exit!  r  r)   z"The exit state of the transaction.c                 ó   — | j                   S r  )rØ   r  s    r'   Ú_get_downloadzTransaction._get_download'  ó   € Ø�~‰~Ðr)   c                 óp   — t        j                  |«      | _        | j                  d| j                  «       y )NÚDownload)r[   rj   rØ   r  ©rA   Úsizes     r'   Ú_set_downloadzTransaction._set_download*  s&   € ÜŸ™ DÓ)ˆŒØ×Ñ˜Z¨¯©Õ8r)   z%The download size of the transaction.c                 ó   — | j                   S r  )rÙ   r  s    r'   Ú
_get_spacezTransaction._get_space1  r/  r)   c                 óp   — t        j                  |«      | _        | j                  d| j                  «       y )NÚSpace)r[   rj   rÙ   r  r=  s     r'   Ú
_set_spacezTransaction._set_space4  s&   € Ü—j‘j Ó&ˆŒØ×Ñ˜W d§k¡kÕ2r)   z+The required disk space of the transaction.c           	      óÄ   — t        j                  |D �cg c]  }t        j                  |d¬«      ‘Œ c}d¬«      | _        | j	                  d| j                  «       y c c}w )NrF   r¤   ÚasÚPackages)r[   rl   rn   rÜ   r  )rA   rì   rð   s      r'   Ú_set_packageszTransaction._set_packages;  sQ   € ÜŸ™Ø2:ö&<Ø*.ô '+§j¡j°ÀÖ&Eò &<à/3ô5ˆŒð 	×Ñ˜Z¨¯©Õ8ùò&<ó   ”Ac                 ó   — | j                   S r  )rÜ   r  s    r'   Ú_get_packageszTransaction._get_packagesA  r:  r)   zaPackages which will be explictly installed, reinstalled, removed, purged, upgraded or downgraded.c                 ó   — | j                   S r  )rÞ   r  s    r'   Ú_get_unauthenticatedz Transaction._get_unauthenticatedI  ó   € Ø×$Ñ$Ð$r)   c                 ót   — t        j                  |d¬«      | _        | j                  d| j                  «       y )NrF   r¤   ÚUnauthenticated)r[   rn   rÞ   r  )rA   Úunauthenticateds     r'   Ú_set_unauthenticatedz Transaction._set_unauthenticatedL  s,   € Ü $§
¡
¨?ÀcÔ JˆÔØ×ÑÐ.°×0EÑ0EÕFr)   z,Unauthenticated packages in this transactionc                 ó   — | j                   S r  )rß   r  s    r'   Ú_get_high_trust_packagesz$Transaction._get_high_trust_packagesW  s   € Ø×(Ñ(Ð(r)   c                 ót   — t        j                  |d¬«      | _        | j                  d| j                  «       y )NrF   r¤   ÚHighTrustWhitelistedPackages)r[   rn   rß   r  )rA   Úwhitelisted_packagess     r'   Ú_set_high_trust_packagesz$Transaction._set_high_trust_packagesZ  s3   € Ü$(§J¡JÐ/CØ9<ô%>ˆÔ!à×ÑÐ;Ø!×6Ñ6õ	8r)   z'High trust packages in this transactionc                 ó   — | j                   S r  )rÛ   r  s    r'   Ú_get_dependszTransaction._get_dependse  s   € Ø�}‰}Ðr)   c           	      óÄ   — t        j                  |D �cg c]  }t        j                  |d¬«      ‘Œ c}d¬«      | _        | j	                  d| j                  «       y c c}w )NrF   r¤   rF  ÚDependencies)r[   rl   rn   rÛ   r  )rA   ÚdependsÚdepss      r'   Ú_set_dependszTransaction._set_dependsh  sQ   € ÜŸ™Ø18ö%:Ø)-ô &*§Z¡Z°ÀÖ%Dò %:à.2ô4ˆŒð 	×Ñ˜^¨T¯]©]Õ;ùò%:rI  zIThe additional dependencies: installs, removals, upgrades and downgrades.c                 ó   — | j                   S r  )rÌ   r  s    r'   Ú_get_statuszTransaction._get_statusr  s   € Ø�|‰|Ðr)   c                 óp   — t        j                  |«      | _        | j                  d| j                  «       y )NÚStatus)r[   rf   rÌ   r  r  s     r'   Ú_set_statuszTransaction._set_statusu  s&   € Ü—{‘{ 4Ó(ˆŒØ×Ñ˜X t§|¡|Õ4r)   zThe status of the transaction.c                 ó   — | j                   S r  )rÍ   r  s    r'   Ú_get_status_detailszTransaction._get_status_details|  s   € Ø×#Ñ#Ð#r)   c                 ó\   — t        |«      | _        | j                  d| j                  «       y )NÚStatusDetails)rþ   rÍ   r  )rA   Útexts     r'   Ú_set_status_detailszTransaction._set_status_details  s%   € Ü.¨tÓ4ˆÔØ×Ñ˜_¨d×.BÑ.BÕCr)   zThe status message from apt.c                 ó   — | j                   S r  )rÅ   r  s    r'   Ú_get_progresszTransaction._get_progress†  r:  r)   c                 óp   — t        j                  |«      | _        | j                  d| j                  «       y )NÚProgress)r[   rh   rÅ   r  )rA   Úpercents     r'   Ú_set_progresszTransaction._set_progress‰  s&   € ÜŸ™ GÓ,ˆŒØ×Ñ˜Z¨¯©Õ8r)   z+The progress of the transaction in percent.c                 ó   — | j                   S r  )rÈ   r  s    r'   Ú_get_progress_packagez!Transaction._get_progress_package�  r&  r)   c                 ó2   — | j                  |d«      | _        y )Nr‡   )r  rÈ   )rA   Úprogress_packages     r'   Ú_set_progress_packagez!Transaction._set_progress_package“  s   € Ø!%×!5Ñ!5Ð6FÈÓ!MˆÕr)   zbThe last progress update of a currentlyprocessed package. A tuple of package name and status enum.c                 ó   — | j                   S r  )rÇ   r  s    r'   Ú_get_progress_downloadz"Transaction._get_progress_downloadœ  s   € Ø×&Ñ&Ð&r)   c                 ój   — | j                  |d«      | _        | j                  d| j                  «       y )Nr¥   ÚProgressDownload)r  rÇ   r  )rA   Úprogress_downloads     r'   Ú_set_progress_downloadz"Transaction._set_progress_downloadŸ  s3   € Ø"&×"6Ñ"6Ð7HØ7?ó#AˆÔà×ÑÐ/°×1HÑ1HÕIr)   zžThe last progress update of a currentlyrunning download. A tuple of URI, status, short description, full size, partially downloaded size and a status message.c                 ó   — | j                   S r  )rÐ   r  s    r'   Ú_get_cancellablezTransaction._get_cancellable¬  s   € Ø× Ñ Ð r)   c                 óp   — t        j                  |«      | _        | j                  d| j                  «       y )NÚCancellable)r[   rk   rÐ   r  )rA   Úcancellables     r'   Ú_set_cancellablezTransaction._set_cancellable¯  s)   € Ü ŸL™L¨Ó5ˆÔØ×Ñ˜]¨D×,=Ñ,=Õ>r)   z4If it's currently allowed to cancel the transaction.c                 ó   — | j                   S r  )rÑ   r  s    r'   Ú_get_term_attachedzTransaction._get_term_attached·  s   € Ø×"Ñ"Ð"r)   c                 óp   — t        j                  |«      | _        | j                  d| j                  «       y )NÚTerminalAttached)r[   rk   rÑ   r  )rA   Úattacheds     r'   Ú_set_term_attachedzTransaction._set_term_attachedº  s*   € Ü"Ÿl™l¨8Ó4ˆÔØ×ÑÐ/°×1DÑ1DÕEr)   zVIf the controlling terminal is currently attached to the dpkg call of the transaction.c                 ó   — | j                   S r  )rÒ   r  s    r'   Ú_get_required_mediumz Transaction._get_required_mediumÃ  rN  r)   c                 óœ   — | j                  |d«      | _        | j                  d| j                  «        | j                  | j                  Ž  y )Nr‡   ÚRequiredMedium)r  rÒ   r  ÚMediumRequired)rA   Úmediums     r'   Ú_set_required_mediumz Transaction._set_required_mediumÆ  sD   € Ø $× 4Ñ 4°V¸TÓ BˆÔØ×ÑÐ-¨t×/DÑ/DÔEØˆ×Ñ˜T×2Ñ2Ò3r)   zWTuple containing the label and the drive of a required CD/DVD to install packages from.c                 ó   — | j                   S r  )rÓ   r  s    r'   Ú_get_config_file_conflictz%Transaction._get_config_file_conflictÐ  s   € Ø×)Ñ)Ð)r)   c                 óÚ   — |€t        j                  dd¬«      | _        y | j                  |d«      | _        | j	                  d| j                  «        | j
                  | j                  Ž  y )Nr¦   r‡   r¤   ÚConfigFileConflict)r[   rl   rÓ   r  r  r’  )rA   Úprompts     r'   Ú_set_config_file_conflictz%Transaction._set_config_file_conflictÓ  s_   € Øˆ>Ü)-¯©°XÈÔ)NˆDÔ&ØØ%)×%9Ñ%9¸&À$Ó%GˆÔ"Ø×ÑÐ1°4×3MÑ3MÔNØˆ×Ñ ×!;Ñ!;Ò<r)   zCTuple containing the old and the new path of the configuration filer§   r9   c                 ó:   — t         j                  d|›d|›�«       y©zåThe signal gets emitted if a property of the transaction changed.

        :param property: The name of the property.
        :param value: The new value of the property.

        :type property: s
        :type value: v
        zEmitting PropertyChanged: r=   N©ró   r@   ©rA   rX   rx   s      r'   r  zTransaction.PropertyChangedã  s   € ô 	�ŠºhÉÐNÕOr)   rF   c                 óZ   — t         j                  dt        j                  |«      z  «       y)zÃThe signal gets emitted if the transaction has been finished.

        :param exit_state: The exit state of the transaction, e.g.
            ``exit-failed``.
        :type exit_state: s
        zEmitting Finished: %sN)ró   r@   r   Úget_exit_string_from_enum)rA   Ú
exit_states     r'   r3  zTransaction.Finishedñ  s(   € ô 	�‰Ð/Ü×7Ñ7¸
ÓCñDõ 	Er)   r‡   c                 ó:   — t         j                  d|›d|›�«       y)a  Set and emit the required medium change.

        This method/signal should be used to inform the user to
        insert the installation CD/DVD:

        Keyword arguments:
        medium -- the CD/DVD label
        drive -- mount point of the drive
        zEmitting MediumRequired: r=   Nr—  )rA   r�  Údrives      r'   rŒ  zTransaction.MediumRequiredþ  s   € ô 	�ŠºVÁUÐKÕLr)   c                 ó:   — t         j                  d|›d|›�«       y)a(  Set and emit the ConfigFileConflict signal.

        This method/signal should be used to inform the user to
        answer a config file prompt.

        Keyword arguments:
        old -- current version of the configuration prompt
        new -- new version of the configuration prompt
        zEmitting ConfigFileConflict: r=   Nr—  )rA   ÚoldÚnews      r'   r’  zTransaction.ConfigFileConflict  s   € ô 	�ŠÂÁcÐJÕKr)   c                 óæ  — | j                   t        j                  k7  rt        j                  «       ‚dt        |«      v rt        d«      ‚	 t        j                  t        |«      «      \  }}|€d}t        j                  |«      | _        nt        j                  |›d|›�«      | _        t        j                  dd|g¬«      | _        | j                  d	| j                  «       y# t        $ r ‚ w xY w)
z½Set the language and encoding.

        Keyword arguments:
        locale -- specifies language, territory and encoding according
                  to RFC 1766,  e.g. "de_DE.UTF-8"
        ú/z,Security exception: Absolute path for localeNÚCú.r#   T)ÚfallbackÚ	languagesr¶   )r  r   rË   r   r	  r   Ú
ValueErrorr¶   Ú_parse_localenamer[   rf   r$   ÚtranslationrÂ   r  )rA   Ú
locale_strÚlangrZ   s       r'   Ú_set_localezTransaction._set_locale  sÔ   € ð �;‰;œ%×1Ñ1Ò1Ü×2Ñ2Ó4Ð4Ø”#�j“/Ñ!ÜÐKÓLÐLð	8ä%×7Ñ7¼¸J»ÓHÑˆT�8ð ˆ|Ø�Ü"Ÿk™k¨$Ó/�•ä"Ÿk™k²T¹8Ð*DÓE�”Ü '× 3Ñ 3°HØ=AØ?C¸fô!FˆDÔð × Ñ  ¨4¯;©;Õ7øô ò 	Øð	ús   Á!C% Ã%C0c              #   ó>  K  — |dk7  r*|j                  d«      rd|vrt        j                  |«      ‚t        j                  }t        j
                  ||| j                  ¬«      –— t        j                  |«      | _	        | j                  d| j                  «       y­w)z‚Set an http network proxy.

        Keyword arguments:
        url -- the URL of the proxy server, e.g. http://proxy:8080
        r5   zhttp://ú:©r¯   r›   N)r  r   ÚInvalidProxyErrorr   ÚPK_ACTION_SET_PROXYÚcheck_authorization_by_namer¯   r[   rf   r»   r  )rA   Úurlr{   Úactions       r'   Ú_set_http_proxyzTransaction._set_http_proxy8  s€   è ø€ ð �"Š9˜cŸn™n¨YÔ7¸3Àc¹>Ü×*Ñ*¨3Ó/Ð/Ü×/Ñ/ˆÜ×4Ñ4°V¸VØ9=¿¹ôCò 	CäŸ+™+ cÓ*ˆŒØ×Ñ˜[¨$¯/©/Õ:ùs   ‚BBc                 óp   — t        j                  |«      | _        | j                  d| j                  «       y)a  Set the handling of the removal of automatically installed
        dependencies which are now obsoleted.

        Keyword arguments:
        remove_obsoleted_depends -- If True also remove automatically installed
            dependencies of to removed packages
        ÚRemoveObsoletedDependsN)r[   rk   r¸   r  )rA   r¸   s     r'   Ú_set_remove_obsoleted_dependsz)Transaction._set_remove_obsoleted_dependsG  s0   € ô )-¯©Ð5MÓ(NˆÔ%Ø×ÑÐ5Ø!×:Ñ:õ	<r)   c                 óp   — t        j                  |«      | _        | j                  d| j                  «       y)zÚSet the handling of unauthenticated packages

        Keyword arguments:
        allow_unauthenticated -- True to allow packages that come from a
            repository without a valid authentication signature
        r�   N)r[   rk   r·   r  )rA   r·   s     r'   Ú_set_allow_unauthenticatedz&Transaction._set_allow_unauthenticatedS  s0   € ô &*§\¡\Ð2GÓ%HˆÔ"Ø×ÑÐ3Ø!×7Ñ7õ	9r)   r5   r{   r|   c                 óä   — t         j                  d| j                  «       	 | j                  j                  |   }|j                  rt        d«      ‚| |_        y# t
        $ r t        d«      ‚w xY w)a0  Queue the transaction for processing after the given transaction.

        The transaction will also fail if the previous one failed. Several
        transactions can be chained up.

        :param tid: The id of the transaction which should be executed
            before.

        :type tid: s
        úQueuing transaction %sz9The given transaction doesn't exist or is already queued!z&There is already an after transaction!N)ró   Úinfor®   r³   rö   rø   ro   rÃ   )rA   r®   r{   Útrans_befores       r'   ÚRunAfterzTransaction.RunAfter_  sr   € ô 	�‰Ð/°·±Ô:ð	/ØŸ:™:×+Ñ+¨CÑ0ˆLð ×ÒÜÐDÓEÐEØ!ˆÕøô ò 	/Üð .ó /ð /ð	/ús   ¢A ÁA/c                 ód   — t         j                  d| j                  «       | j                  |«      S )zTCheck the authentication, simulate and queue the transaction for
        processing.r¼  )ró   r½  r®   Ú_run©rA   r{   s     r'   ÚRunzTransaction.Runx  s&   € ô 	�‰Ð/°·±Ô:Ø�y‰y˜Ó Ð r)   c              #   óæ  K  — | j                  |«      –— | j                  «       –— | j                  «       –— | j                  j	                  | j
                  «       t        j                  | _        | j                  }|rn| j                  «       –— |j                  «       –— | j                  j	                  |j
                  «       t        j                  |_        |j                  }|rŒmy y ­wr  )
Ú_check_foreign_userÚ_check_simulatedÚ_check_authr³   Úputr®   r   ÚSTATUS_WAITINGr  rÃ   )rA   r{   Ú
next_transs      r'   rÁ  zTransaction._run�  s²   è ø€ à×&Ñ& vÓ.Ò.Ø×#Ñ#Ó%Ò%Ø×ÑÓ Ò Ø�
‰
�‰�t—x‘xÔ Ü×*Ñ*ˆŒØ—Z‘Zˆ
ÙØ×'Ñ'Ó)Ò)Ø×(Ñ(Ó*Ò*Ø�J‰J�N‰N˜:Ÿ>™>Ô*Ü %× 4Ñ 4ˆJÔØ#×)Ñ)ˆJô ùs   ‚C,C1Ã/C1c              #   ó˜   K  — | j                   €:| j                  j                  j                  sd| _        | j                  «       –— y y ­w)Né	   )rè   r³   ÚworkerÚtransÚprogressÚ_simulate_realr  s    r'   rÆ  zTransaction._check_simulated�  s@   è ø€ ð
 �>‰>Ð!ð
 —:‘:×$Ñ$×*Ò*Ø !�”Ø×%Ñ%Ó'Ó'àùs   ‚AA
c              #   ó†  K  — t         j                  | _        | j                  | j                     }|€y| j                  t         j
                  t         j                  fv rt        | «      rt        j                  }| j                  t         j                  k(  r¡| j                  t         j                     s„| j                  t         j                     sg| j                  t         j                     sJ| j                  t         j                     s-| j                  t         j                     st        j                   }	 | j#                  «       –—}|s/t        j$                  | j&                  || j(                  ¬«      –— yy# t*        j,                  $ rN}t+        j.                  t         j0                  t3        |«      «      | _        t         j6                  | _        |‚d}~wt*        j:                  $ rN}t+        j.                  t         j<                  t3        |«      «      | _        t         j6                  | _        |‚d}~ww xY w­w)zÖCheck silently if one of the high level privileges has been granted
        before to reduce clicks to install packages from third party
        epositories: AddRepository -> UpdateCache -> InstallPackages
        Nr¯  )r   ÚSTATUS_AUTHENTICATINGr  ÚROLE_ACTION_MAPrê   ÚROLE_INSTALL_PACKAGESÚROLE_COMMIT_PACKAGESr   r   Ú/PK_ACTION_INSTALL_PACKAGES_FROM_HIGH_TRUST_REPOrì   ÚPKGS_INSTALLÚPKGS_REINSTALLÚPKGS_REMOVEÚ
PKGS_PURGEÚPKGS_DOWNGRADEÚPK_ACTION_UPGRADE_PACKAGESÚ_check_alternative_authr²  r{   r¯   r   ÚNotAuthorizedErrorÚTransactionFailedÚERROR_NOT_AUTHORIZEDr   rù   ÚEXIT_FAILEDÚexitÚAuthorizationFailedÚERROR_AUTH_FAILED)rA   r´  Ú
authorizedrù   s       r'   rÇ  zTransaction._check_auth   s®  è ø€ ô ×1Ñ1ˆŒØ×%Ñ% d§i¡iÑ0ˆØˆ>Øð �I‰Iœ%×5Ñ5Ü×4Ñ4ð6ñ 6ä>¸tÔDÜ×OÑOˆFà�I‰Iœ×3Ñ3Ò3Ø—M‘M¤%×"4Ñ"4Ò5Ø—M‘M¤%×"6Ñ"6Ò7Ø—M‘M¤%×"3Ñ"3Ò4Ø—M‘M¤%×"2Ñ"2Ò3Ø—M‘M¤%×"6Ñ"6Ò7Ü×:Ñ:ˆFð	Ø#×;Ñ;Ó=Ñ=ˆJÙÜ ×<Ñ<¸T¿[¹[Ø=CØAEÇÁôKó Kð øô ×(Ñ(ò 	Ü×1Ñ1´%×2LÑ2LÜ25°e³*ó>ˆDŒJä×)Ñ)ˆDŒIØˆLûÜ×)Ñ)ò 	Ü×1Ñ1´%×2IÑ2IÜ25°e³*ó>ˆDŒJä×)Ñ)ˆDŒIØˆLûð		üs9   ‚D7IÄ:AE> Å<IÅ>H>ÆA	GÇH>Ç0A	H9È9H>È>Ic              #   óü  K  — | j                   t        j                  t        j                  t        j                  t        j
                  t        j                  fvrt        d«       t        j                  }t        j                  t        j                  fD ]=  }	 t        j                  | j                  || j                  |¬«      –— t        d«       Œ? t        d«       y# t        j                   $ r Y Œaw xY w­w)z^Check non-interactively if one of the high level privileges
        has been granted.
        F)r¯   ÚflagsTN)rê   r   ÚROLE_ADD_REPOSITORYÚ"ROLE_ADD_VENDOR_KEY_FROM_KEYSERVERÚROLE_UPDATE_CACHErÔ  ÚROLE_ADD_LICENSE_KEYr   r   ÚCHECK_AUTH_NONEÚ(PK_ACTION_INSTALL_PACKAGES_FROM_NEW_REPOÚ$PK_ACTION_INSTALL_PURCHASED_PACKAGESr²  r{   r¯   r   rÞ  )rA   rç  r´  s      r'   rÝ  z#Transaction._check_alternative_authÉ  sØ   è ø€ ð
 �9‰9œU×6Ñ6Ü"×EÑEÜ"×4Ñ4Ü"×8Ñ8Ü"×7Ñ7ð	9ñ 9ô
 ˜ÔÜ×*Ñ*ˆÜ!×JÑJÜ!×FÑFðHò 
	#ˆFð#Ü ×<Ñ<¸T¿[¹[Ø=CØAEÇÁØCHôJò Jô ˜TÕ"ð
	#ô 	�UÕøô	 ×,Ñ,ò Ùðüs*   ‚BC<Â/C#Ã
C<Ã#C9Ã6C<Ã8C9Ã9C<c                 ód   — t         j                  d| j                  «       | j                  |«      S )zCancel the transaction.zCancelling transaction %s)ró   r½  r®   Ú_cancelrÂ  s     r'   ÚCancelzTransaction.Cancelã  s&   € ô
 	�‰Ð2°D·H±HÔ=Ø�|‰|˜FÓ#Ð#r)   c              #   óÆ  K  — 	 | j                  |«      –— 	 | j                  j                  | «       t        j                  d«       t        j                  | _        t        j                  | _        y # t        j                  $ r7 t        j                  }t        j
                  ||| j                  ¬«      –— Y Œ¥w xY w# t         $ r Y nw xY w| j"                  | j                  j$                  v rt        j                  | _        y | j&                  r9t        j                  d«       d| _        t        j                  | _        d| _        y t        j,                  d«      ‚­w)Nr¯  zRemoved transaction from queuezSetting cancel eventTFzCould not cancel transaction)rÅ  r   ÚForeignTransactionr   ÚPK_ACTION_CANCEL_FOREIGNr²  r¯   r³   Úremoveró   r@   r   ÚSTATUS_CANCELLINGr  ÚEXIT_CANCELLEDrâ  r§  r®   rö   r€  rÕ   rÖ   ÚAptKitError)rA   r{   r´  s      r'   rð  zTransaction._cancelë  s%  è ø€ ð	GØ×*Ñ*¨6Ó2Ò2ð
	Ø�J‰J×Ñ˜dÔ#Ü�O‰OÐ<Ô=ô  ×1Ñ1ˆDŒKÜ×,Ñ,ˆDŒIØøô ×(Ñ(ò 	GÜ×8Ñ8ˆFÜ×8Ñ8¸ÀØ=A¿X¹XôGô Gð	Gûô ò 	Ùð	úð �8‰8�t—z‘z×'Ñ'Ñ'Ü×,Ñ,ˆDŒIØØ×ÒÜ�O‰OÐ2Ô3Ø!ˆDŒNÜ×1Ñ1ˆDŒKØˆDŒKØÜ× Ñ Ð!?Ó@Ð@ùsG   ‚E!„A3 ˜0C  Á+E!Á3AB=Â:E!Â<B=Â=E!Ã 	CÃ	E!ÃCÃBE!c                 óN   — t         j                  d«       | j                  |«      S )zÈSimulate a transaction to update its dependencies, download size
        and required disk space.

        Call this method if you want to show changes before queuing the
        transaction.
        zSimulate was called)ró   r½  Ú	_simulaterÂ  s     r'   ÚSimulatezTransaction.Simulate  s    € ô 	�‰Ð,Ô-Ø�~‰~˜fÓ%Ð%r)   c              #   óø   K  — | j                   rt        j                  «       ‚| j                  t        j
                  k7  rt        j                  «       ‚| j                  |«      –— | j                  «       –— y ­wr  )	ré   r   ÚTransactionAlreadySimulatingr  r   rË   r	  rÅ  rÐ  rÂ  s     r'   rú  zTransaction._simulate  s_   è ø€ à×ÒÜ×5Ñ5Ó7Ð7Ø�;‰;œ%×1Ñ1Ò1Ü×2Ñ2Ó4Ð4Ø×&Ñ& vÓ.Ò.Ø×!Ñ!Ó#Ó#ùs   ‚A8A:c              #   óà  K  — | j                   rt        j                  «       ‚| j                  t        j
                  k(  r| j                  «       –— | j                  j                  j                  | «       t        «       }| j                  �t        j                  | j                  «       d | _        | j                  j                  j                  d| j                  |«      | _         |–— y ­w)Nztransaction-simulated)ré   r   rý  rê   r   ÚROLE_INSTALL_FILErÇ  r³   rÍ  Úsimulater   râ   r   Úsource_removerë   Ú_on_transaction_simulated)rA   Údeferreds     r'   rÐ  zTransaction._simulate_real  s¹   è ø€ à×ÒÜ×5Ñ5Ó7Ð7Ø�9‰9œ×/Ñ/Ò/Ø×"Ñ"Ó$Ò$Ø�
‰
×Ñ×"Ñ" 4Ô(Ü“:ˆØ×ÑÐ'Ü×Ñ˜t×/Ñ/Ô0ØˆÔØ!ŸZ™Z×.Ñ.×6Ñ6Ø#Ø×*Ñ*ØóˆÔð ‹ùs   ‚C,C.c                 óê   — || ury | j                   j                  j                  | j                  «       d | _        |j
                  r|j                  |j
                  «       y |j                  «        y r  )r³   rÍ  Ú
disconnectré   Ú_simualted_cbrù   ÚerrbackÚcallback)rA   rÍ  rÎ  r  s       r'   r  z%Transaction._on_transaction_simulated/  sX   € Ø˜ÑØØ�
‰
×Ñ×$Ñ$ T×%7Ñ%7Ô8Ø!ˆÔØ�;Š;Ø×Ñ˜UŸ[™[Õ)à×ÑÕr)   c                 óÖ  — | j                   t        j                  k7  rt        j                  «       ‚t        | j                  | j                  «      5  t        j                  j                  |«      dk7  rt        j                  d|z  «      ‚d}	 t        j                  |t        j                  t        j                  z  «      }t        j                  |«      j                   | j                  k7  r&t        j                  d|›d| j                  ›d�«      ‚t        j"                  |«      r7t%        j&                  |«      | _        | j+                  d| j(                  «       nt        j                  d|z  «      ‚	 |�t        j.                  |«       	 ddd«       y# t,        $ r t        j                  d|z  «      ‚w xY w# |�t        j.                  |«       w w xY w# 1 sw Y   yxY w)	aA  Set the controlling terminal.

        The worker will be attached to the specified slave end of a pty
        master/slave pair. This allows to interact with the

        Can only be changed before the transaction is started.

        Keyword arguments:
        ttyname -- file path to the slave file descriptor
        z/dev/ptsz%s isn't a ttyNzPty device 'z6' has to be owned bythe owner of the transaction (uid z) rœ   zCould not open %s)r  r   rË   r   r	  r   r´   rµ   r½   r¾   Údirnamerø  ÚopenÚO_RDWRÚO_NOCTTYÚfstatÚst_uidÚisattyr[   rf   r¼   r  ro   Úclose)rA   ÚttynameÚslave_fds      r'   Ú_set_terminalzTransaction._set_terminal9  sŒ  € ð �;‰;œ%×1Ñ1Ò1Ü×2Ñ2Ó4Ð4Ü˜4Ÿ8™8 T§X¡XÓ.ñ 	'Ü�w‰w�‰˜wÓ'¨:Ò5Ü×(Ñ(Ð)9¸GÑ)CÓDÐDàˆHð'ÜŸ7™7 7¬B¯I©I¼¿¹Ñ,CÓD�ô —8‘8˜HÓ%×,Ñ,°·±Ò8Ü ×,Ò,â?FÈÏËð.Ró Sð Sô —9‘9˜XÔ&Ü$(§K¡K°Ó$8�D”MØ×(Ñ(¨°T·]±]ÕCä ×,Ñ,Ð-=ÀÑ-GÓHÐHð Dð Ð'Ü—H‘H˜XÕ&÷+	'ð 	'øô ò HÜ×(Ñ(Ð)<¸wÑ)FÓGÐGðHûð Ð'Ü—H‘H˜XÕ&ð (ú÷)	'ð 	'ús7   Á=GÂ5FÃB6GÅ<GÆ"F?Æ?GÇGÇGÇG(c                 ó  — | j                   t        j                  k7  rt        j                  «       ‚t        | j                  | j                  «      5  	 t        j                  |«      }|j                  | j                  k7  rt        j                  d|z  «      ‚	 ddd«       t        j                  |«      | _        | j!                  d| j                  «       y# t        $ r t        j                  d|z  «      ‚w xY w# 1 sw Y   ŒexY w)aˆ  Set the socket of the debconf proxy.

        The worker process forwards all debconf commands through this
        socket by using the passthrough frontend. On the client side
        debconf-communicate should be connected to the socket.

        Can only be changed before the transaction is started.

        Keyword arguments:
        debconf_socket: absolute path to the socket
        z;socket '%s' has to be owned by the owner of the transactionz#socket status could not be read: %sNrž   )r  r   rË   r   r	  r   r´   rµ   r½   Ústatr  rø  ro   r[   rf   rÀ   r  )rA   Údebconf_socketr  s      r'   Ú_set_debconfzTransaction._set_debconf]  sú   € ð �;‰;œ%×1Ñ1Ò1Ü×2Ñ2Ó4Ð4Ü˜4Ÿ8™8 T§X¡XÓ.ñ 
	Pð	PÜ—w‘w˜~Ó.�ð
 —;‘; $§(¡(Ò*Ü ×,Ñ,ð .>à@Nñ.Oó Pð Pð +÷
	Pô —{‘{ >Ó2ˆŒØ×Ñ˜_¨d¯l©lÕ;øô ò CÜ×(Ñ(ð *1Ø3Añ*Bó Cð CðCú÷
	Pð 
	Pús$   ÁC?ÁCÁ)1C?Ã"C<Ã<C?Ã?Dc                 óR   — t         j                  d|«       | j                  ||«      S )a$  Continue paused transaction with the inserted medium.

        If a media change is required to install packages from CD/DVD
        the transaction will be paused and could be resumed with this
        method.

        :param medium: The label of the CD/DVD.
        :type medium: s
        zMedium %s was provided)ró   r½  Ú_provide_medium©rA   r�  r{   s      r'   ÚProvideMediumzTransaction.ProvideMediumz  s&   € ô 	�‰Ð/°Ô8Ø×#Ñ# F¨FÓ3Ð3r)   c              #   óÖ   K  — | j                  |«      –— | j                  st        j                  d«      ‚| j                  d   |k(  st        j                  d|z  «      ‚d| _        y ­w)Nz There isn't any required medium.r   z The medium '%s' isn't requested.F)rÅ  Úrequired_mediumr   rø  rÖ   r  s      r'   r  zTransaction._provide_mediumŠ  sl   è ø€ à×&Ñ& vÓ.Ò.Ø×#Ò#Ü×$Ñ$Ð%GÓHÐHØ×#Ñ# AÑ&¨&Ò0Ü×$Ñ$ð &5Ø7=ñ&>ó ?ð ?àˆ�ùs   ‚A'A)c                 óV   — t         j                  d||«       | j                  |||«      S )a£  Resolve a configuration file conflict and continue the transaction.

        If a config file prompt is detected the transaction will be
        paused and could be resumed with this method.

        :param config: The path to the original config file.
        :param answer: The answer to the configuration file question, can be
            "keep" or "replace"

        :type config: s
        :type answer: s
        zResolved conflict of %s with %s)ró   r½  Ú_resolve_config_file_conflict©rA   ÚconfigÚanswerr{   s       r'   ÚResolveConfigFileConflictz%Transaction.ResolveConfigFileConflict•  s*   € ô  	�‰Ð8¸&À&ÔIØ×1Ñ1°&¸&À&ÓIÐIr)   c              #   ó  K  — | j                  |«      –— | j                  st        j                  d«      ‚|dvrt        j                  d|z  «      ‚| j                  d   |k(  st        j                  d|z  «      ‚|| _        d| _        y ­w)Nz+There isn't any config file prompt required)ÚkeepÚreplacezInvalid value: %sr   zInvalid config file: %sF)rÅ  Úconfig_file_conflictr   rø  Úconfig_file_conflict_resolutionrÖ   r!  s       r'   r   z)Transaction._resolve_config_file_conflict¨  s“   è ø€ à×&Ñ& vÓ.Ò.Ø×(Ò(Ü×$Ñ$ð &3ó 4ð 4àÐ,Ñ,ô ×$Ñ$Ð%8¸6Ñ%AÓBÐBØ×(Ñ(¨Ñ+¨vÒ5Ü×$Ñ$Ð%>ÀÑ%GÓHÐHØ/5ˆÔ,Øˆ�ùs   ‚B
Bc              #   ó  K  — | j                  |«      –— |t        k(  rÄ|dk(  r| j                  |«       y
|dk(  r| j                  |«       y
|dk(  r| j	                  |«       y
|dk(  r| j                  |«       y
|dk(  r| j                  |«       y
|dk(  r| j                  |«       y
|dk(  r| j                  ||«       y
t        j                  j                  d|z  «      ‚t        j                  j                  d	|z  «      ‚­w)z7Helper to set a name on the properties D-Bus interface.rŸ   rœ   rž   r    r·  r�   r›   r�   úUnknown interface: %sN)rÅ  r   r  r  r  r¬  r¸  rº  rµ  r[   rŽ   r�   r€   s        r'   r   zTransaction._set_property¸  s  è ø€ ð ×&Ñ& vÓ.Ò.ØÔ5Ò5Ø�zÒ!Ø×#Ñ# EÕ*Ø˜Ò#Ø×"Ñ" 5Õ)Ø˜Ò(Ø×!Ñ! %Õ(Ø˜Ò!Ø× Ñ  Õ'ØÐ1Ò1Ø×2Ñ2°5Õ9ØÐ/Ò/Ø×/Ñ/°Õ6Ø˜Ò$Ø×$Ñ$ U¨FÕ3ä—o‘o×3Ñ3ð 5CØEIñ5Jó Kð Kô —/‘/×/Ñ/Ð0GØ05ñ16ó 7ð 7ùs   ‚DDc           
      ó´  — |t         k(  �rMi d| j                  “d| j                  “d| j                  “d| j                  “d| j
                  “d| j                  “d| j                  “d| j                  “d	| j                  “d
| j                  “d| j                  “d| j                  “d| j                  “d| j                  “d| j                  “dt!        j"                  | j$                  «      “d| j&                  “| j(                  | j*                  | j,                  | j.                  | j0                  | j2                  | j4                  | j6                  dœ¥S i S )r‘   r  rn  r!  ry  rc  rh  r  r…  r‹  r’  r1  r(  r    rœ   rž   ÚPausedr�   )r·  r›   rG  rŸ   r\  r<  rC  rP  )r   rê   rÏ  Úprogress_detailsrz  r  Ústatus_detailsr€  Úterm_attachedr  r(  râ  rÏ   r¶   r¼   rÀ   r[   rk   rÖ   r·   r¸   r»   rì   Ú	meta_datar]  ÚdownloadÚspacerQ  r…   s     r'   ra   zTransaction._get_propertiesÒ  sƒ  € àÔ5Ó5ð�F˜DŸI™Ið Ø §¡ðà% t×'<Ñ'<ðð '¨×(>Ñ(>ðð ˜dŸk™kð	ð
 $ T×%8Ñ%8ðð " 4×#3Ñ#3ðð '¨×(:Ñ(:ðð % d×&:Ñ&:ðð )¨$×*CÑ*Cðð   §¡ðð ˜T×1Ñ1ðð ˜dŸk™kðð  §¡ðð $ T§\¡\ðð œdŸl™l¨4¯;©;Ó7ðð  +¨D×,FÑ,Fð!ð" /3×.KÑ.KØ!%§¡Ø $§¡Ø $§¡Ø$(§L¡LØ $§¡Ø!ŸZ™ZØ'+×';Ñ';ò1ð ð6 ˆIr)   c              #   ó–   K  — t        j                  || j                  «      –—}| j                  |k7  rt	        j
                  «       ‚y­w)z6Check if the transaction is owned by the given caller.N)r   Úget_uid_from_dbus_namer¯   r´   r   ró  )rA   Ú	dbus_namer´   s      r'   rÅ  zTransaction._check_foreign_userò  s@   è ø€ ô ×5Ñ5°iÀÇÁÓJÑJˆØ�8‰8�sŠ?Ü×+Ñ+Ó-Ð-ð ùs   ‚AA	c                 ó   — || _         y)z3Set the kwargs which will be send to the AptWorker.N©rÁ   )rA   rÁ   s     r'   Ú_set_kwargszTransaction._set_kwargsù  s	   € àˆ�r)   c                 óŒ   — | j                   r| j                   S d}t        j                  |t        j                  |«      d¬«      S )z1Get a usable translations object, no matter what.r#   T)r¥  )rÂ   r$   r©  Úbindtextdomain)rA   Údomains     r'   Ú_get_translationszTransaction._get_translationsý  sA   € à×ÒØ×$Ñ$Ð$àˆFÜ×&Ñ& v¬w×/EÑ/EÀfÓ/MØ04ô6ð 6r)   c                 óT   — |sy| j                  «       } t        |t        «      |«      S )zpTranslate the given message to the language of the transaction.
        Fallback to the system default.
        r5   )r=  ÚgetattrÚ_gettext_method)rA   r&   r©  s      r'   r$   zTransaction.gettext  s,   € ñ
 ØØ×,Ñ,Ó.ˆØ4Œw�{¤OÓ4°SÓ9Ð9r)   c                 óR   — | j                  «       } t        |t        «      |||«      S )zwTranslate the given plural message to the language of the
        transaction. Fallback to the system default.
        )r=  r?  Ú_ngettext_method)rA   ÚsingularÚpluralÚcountr©  s        r'   r+   zTransaction.ngettext  s+   € ð ×,Ñ,Ó.ˆØ5Œw�{Ô$4Ó5°hÀÈÓNÐNr)   )TNNN)‰r’   r“   r”   r•   r   ÚROLE_PK_QUERYrÔ  r   Ú$PK_ACTION_INSTALL_OR_REMOVE_PACKAGESÚROLE_REMOVE_PACKAGESrÿ  ÚPK_ACTION_INSTALL_FILEÚROLE_UPGRADE_PACKAGESrÜ  ÚROLE_UPGRADE_SYSTEMrê  ÚPK_ACTION_UPDATE_CACHErÕ  ÚROLE_ADD_VENDOR_KEY_FILEÚPK_ACTION_CHANGE_REPOSITORYré  ÚROLE_REMOVE_VENDOR_KEYÚROLE_FIX_INCOMPLETE_INSTALLÚROLE_FIX_BROKEN_DEPENDSrè  ÚROLE_RECONFIGUREÚ
ROLE_CLEANÚPK_ACTION_CLEANÚROLE_ENABLE_DISTRO_COMPrë  rÓ  rd   r²   rå   rá   r  r  r  rX   r1  r  r  rê   r#  r%  r.  r,  r.  rù   r5  r7  râ  r9  r?  r2  rA  rD  r3  rH  rK  rì   rM  rR  rQ  rT  rX  Úhigh_trust_packagesrZ  r_  r]  ra  rd  r  rf  rj  r/  rl  rp  rÏ  rr  ru  rt  rw  r{  rz  r}  r�  r€  rƒ  r‡  r0  r‰  rŽ  r  r�  r”  r(  r[   r\   r–   r   r  r3  rŒ  r’  r¬  r   rµ  r¸  rº  r˜   r¿  r   rÃ  rÁ  rÆ  rÇ  rÝ  rñ  rð  rû  rú  rÐ  r  r  r  r  r  r$  r   r   ra   rÅ  r9  r=  r$   r+   r8   r)   r'   r   r     sF  „ ñð#>Ø×Ñ˜Tð#>à×#Ñ#Ø×;Ñ;ð#>ð 	×"Ñ"Ø×;Ñ;ð#>ð 	×ÑØ×-Ñ-ð#>ð 	×#Ñ#Ø×1Ñ1ð#>ð 	×!Ñ!Ø×1Ñ1ð#>ð 	×ÑØ×-Ñ-ð#>ð 	×"Ñ"Ø×;Ñ;ð#>ð  	×&Ñ&Ø×2Ñ2ð##>ð$ 	×0Ñ0Ø×2Ñ2ð'#>ð( 	×$Ñ$Ø×2Ñ2ð+#>ð, 	×)Ñ)Ø×;Ñ;ð/#>ð0 	×%Ñ%Ø×;Ñ;ð3#>ð4 	×!Ñ!Ø×2Ñ2ð7#>ð8 	×ÑØ×;Ñ;ð;#>ð< 	×ÑØ×&Ñ&ð?#>ð@ 	×%Ñ%Ø×2Ñ2ðC#>ðD 	×"Ñ"Ø×;Ñ;ñG#>€OðJ4Ðð
 @Dóc"òJ&òò"Hò<:ò6ñ ˜¨ðDôE€Iò1òñ �I˜yÐ.NÔO€DòHò
&ñ  Ð 5Ð7Lð%5ô6Ðò<òñ �Z Ð1DÔE€Eò
Hòñ �I˜yØ<ô>€Dòò9ñ ˜ }ØCôE€Hòò3ñ �Z ØFôH€Eò9òñ ˜ }ð*ô+€Hò
%òGñ Ð3Ð5Ið$1ô2€Oò)ò8ñ #Ð#;Ø#;ð(5ô6Ðò
ò<ñ �| \ð6ô7€Gòò5ñ �k ;Ø:ô<€Fò$òDñ Ð1Ð3FØ"@ôB€Nòò9ñ ˜ }ØEóG€Hò&òNñ  Ð 5Ø 5ð%<ô=Ðò'òJñ
 !Ð!7Ø!7ð&0ô1Ðò!ò?ñ Ð+Ð-=ð .ô/€Kò#òFñ Ð/Ð1Cð"0ô1€Mò
%ò4ñ
 Ð3Ð5Ið$+ô,€Oò
*ò=ñ $Ð$=Ø$=ð)IôJÐð 
‡\�\×ÑÐ(IØ#'ð ó )ñ	Pó)ð	Pð 
‡\�\×ÑÐ(IØ#&ð ó (ñEó(ðEð 
‡\�\×ÑÐ(IØ#'ð ó )ñ
Mó)ð
Mð 
‡\�\×ÑÐ(IØ#'ð ó )ñ
Ló)ð
Lò8ð6 ñ;ó ð;ò
<ò	9ð 
‡\�\×ÑÐ:Ø&)¸Ø(0ð ó 2ñ"ó2ð"ñ, Ð;Ø')¸Ø)1ô3ñ!ó3ð!ð ñ*ó ð*ð ñó ðð ñ&ó ð&ðP ñó ðñ2 Ð;Ø')¸Ø)1ô3ñ$ó3ð$ð
 ñAó ðAñ8 Ð;Ø')¸Ø)1ô3ñ&ó3ð&ð ñ$ó ð$ð ñó ðò  ò"'òH<ñ: Ð;Ø'*¸"Ø)1ô3ñ4ó3ð4ð ñó ðñ Ð;Ø'+¸2Ø)1ô3ñJó3ðJð  ñó ðð ñ7ó ð7ò2ð@ ñ.ó ð.òò6ò:óOr)   r   c                   ó€   — e Zd ZdZdej
                  j                  ddfiZd„ Zd„ Z	d„ Z
d„ Zd	„ Zd
„ Zd„ Zed„ «       Zy)r   zQueue for transactions.úqueue-changedNr8   c                 óê   — t         j                   j                  | «       t        j                  «       | _        d| _        || _        i | _        | j                  j                  d| j                  «       y)z*Intialize a new TransactionQueue instance.r   ztransaction-doneN)
r   r²   ÚcollectionsÚdequeÚ_queueÚ_proc_countrÍ  rö   rë   Ú_on_transaction_done)rA   rÍ  s     r'   r²   zTransactionQueue.__init__   sU   € ä�‰× Ñ  Ô&Ü!×'Ñ'Ó)ˆŒØˆÔØˆŒàˆŒ
Ø�‰×ÑÐ.°×0IÑ0IÕJr)   c                 ó,   — t        | j                  «      S r  )r  r\  r  s    r'   Ú__len__zTransactionQueue.__len__*  s   € Ü�4—;‘;ÓÐr)   c                 óP   — t         j                  d«       | j                  d«       y)zEmit the queued-changed signal.zemitting queue changedrX  N)r?   r@   Úemitr  s    r'   Ú_emit_queue_changedz$TransactionQueue._emit_queue_changed-  s   € ä�	‰	Ð*Ô+Ø�	‰	�/Õ"r)   c                 ót  — | j                   j                  |«      }|j                  �t        j                  |j                  «       | j
                  j                  r1t        j                  |_	        | j                  j                  |«       n| j
                  j                  |«       | j                  «        y)zAdd an item to the queue.N)rö   r÷   râ   r   r  rÍ  rÎ  r   rÉ  r  r\  rp   Úrunrc  )rA   r®   rÎ  s      r'   rÈ  zTransactionQueue.put2  s|   € à—
‘
—‘˜sÓ#ˆØ×ÑÐ(Ü×Ñ˜u×0Ñ0Ô1Ø�;‰;×ÒÜ ×/Ñ/ˆEŒLØ�K‰K×Ñ˜uÕ%à�K‰K�O‰O˜EÔ"Ø× Ñ Õ"r)   c                 ób  — |j                   t        j                  t        j                  fv r™|j                   t        j                  k(  rt        j                  }nt        j                  }|j
                  }|rM| j                  |«       ||_         t        j                  |j                  «      }||_	        |j
                  }|rŒM	 | j                  j                  «       }| j                  j                  |«       | j#                  «        y# t        $ r t        j!                  d«       Y Œ1w xY w)z2Mark the last item as done and request a new item.z"There isn't any queued transactionN)râ  r   rá  r÷  ÚEXIT_PREVIOUS_FAILEDrÃ   rõ  Úget_role_error_from_enumrê   r/  r\  ÚpopleftrÍ  re  Ú
IndexErrorr?   r@   rc  )rA   rÍ  rÎ  râ  Ú_transr&   rÊ  s          r'   r^  z%TransactionQueue._on_transaction_done>  så   € ð
 �:‰:œ%×+Ñ+¬U×-AÑ-AÐBÑBØ�z‰zœU×.Ñ.Ò.Ü×1Ñ1‘ä×+Ñ+�Ø—[‘[ˆFÙØ—‘˜FÔ#Ø"�”Ü×4Ñ4°U·Z±ZÓ@�Ø(+�Ô%ØŸ™�ò ð	(ØŸ™×,Ñ,Ó.ˆJð �K‰K�O‰O˜JÔ'Ø× Ñ Õ"øô	 ò 	<Ü�I‰IÐ:Ö;ð	<ús   ÃD ÄD.Ä-D.c                 óZ   — | j                   j                  |«       | j                  «        y)z)Remove the specified item from the queue.N)r\  rõ  rc  ©rA   Útransactions     r'   rõ  zTransactionQueue.removeW  s    € à�‰×Ñ˜;Ô'Ø× Ñ Õ"r)   c                 óz   — | j                   D ]  }|j                  «        Œ | j                   j                  «        y)z Remove all items from the queue.N)r\  rá   Úclearrm  s     r'   rp  zTransactionQueue.clear\  s1   € àŸ;™;ò 	;ˆKØ×8Ñ8Õ:ð	;à�‰×ÑÕr)   c                 ó,   — t        | j                  «      S )z*Return a list containing all queued items.)Úlistr\  r  s    r'   rc   zTransactionQueue.itemsb  s   € ô �D—K‘KÓ Ð r)   )r’   r“   r”   r•   r   ÚSignalFlagsÚ	RUN_FIRSTÚ__gsignals__r²   r`  rc  rÈ  r^  rõ  rp  rX   rc   r8   r)   r'   r   r     s`   „ á!à# g×&9Ñ&9×&CÑ&CØ&*Ø&(ð&*ð +€LòKò ò#ò

#ò#ò2#ò
ð ñ!ó ñ!r)   r   c                   ó8  — e Zd ZdZd5d„Zd„ Zej                  j                  e	d¬«      d„ «       Z
ej                  j                  e	d¬«      d	„ «       Zd
„ Zed6d„«       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	ddd¬«      d„ «       Z ee	d dd¬«      d!„ «       Z ee	ddd¬«      d"„ «       Z ee	d#dd¬«      d$„ «       Z ee	d%dd¬«      d&„ «       Z ee	ddd¬«      d'„ «       Z  ee	ddd¬«      d(„ «       Z!ed)„ «       Z"ej                  jG                  e	dd¬*«      d+„ «       Z$ej                  jG                  e	ddd,¬«      d-„ «       Z% ee	d.dd¬«      d/„ «       Z&ed0„ «       Z'd1„ Z(d2„ Z)d3„ Z*d4„ Z+y)7r   zþProvides a system daemon to process package management tasks.

    The daemon is transaction based. Each package management tasks runs
    in a separate transaction. The transactions can be created,
    monitored and managed via the D-Bus interface.
    Nc                 óP  — t         j                  d«       t        j                  t        j                  t
        j                  | j                  d«       t        j                  d«       || _
        d| _        |du rK|€t        j                  «       }|| _        t        }	 t        j                   j#                  t$        |d¬«      }nd}d}t>        jA                  | ||«       |jB                  rtE        «       | _#        n,|jH                   }	 ddl%m&}  ||jN                  |«      | _#        tS        | jF                  «      | _*        | jT                  jW                  d| jX                  «       | jF                  j[                  «       | _.        t         j_                  d«       y# t        j&                  j(                  $ rÇ | j                  j*                  du r*t         j-                  d«       t/        j0                  d«       t         j3                  d	«       |j5                  t$        t        «      }|j7                  t8        d
¬«       t;        j<                  d«       t        j                   j#                  t$        |d¬«      }Y �Œ·w xY w#  tQ        |jN                  |«      | _#        Y �Œ|xY w)a  Initialize a new AptKit instance.

        Keyword arguments:
        options -- command line options of the type optparse.Values
        connect -- if the daemon should connect to the D-Bus (default is True)
        bus -- the D-Bus to connect to (defaults to the system bus)
        zInitializing daemonNé   T)Údo_not_queueFz!Another daemon is already runningr   z Replacing already running daemonr/   )r:   Útimeout)ÚAptPackageKitWorkerrX  zDaemon was initialized)0r?   r½  r   Úunix_signal_addÚPRIORITY_HIGHr–   ÚSIGTERMÚ_sigquitr½   ÚniceÚoptionsÚ
packagekitr[   r°   r¯   ÚAPTKIT_DBUS_PATHr\   r±   r   rŽ   ÚNameExistsExceptionr'  ÚcriticalÚsysrâ  ÚwarningÚ
get_objectÚQuitÚAPTKIT_DBUS_INTERFACEÚtimeÚsleepr7   r²   Údummyr   rÍ  Údisable_pluginsÚworker.pkworkerr{  Úchrootr   r   r³   rë   Ú_on_queue_changedÚis_reboot_requiredÚ_reboot_requiredr@   )	rA   r�  rë   r¯   Úbus_pathrí   Úthe_other_guyÚload_pluginsr{  s	            r'   r²   zAptKit.__init__q  s  € ô 	�‰Ð&Ô'ô 	×ÑœT×/Ñ/´·±Ø!Ÿ]™]¨Dô	2ô 	�‰�Œ
ØˆŒØˆŒØ�d‰?Øˆ{Ü—n‘nÓ&�ØˆDŒHÜ'ˆHðCÜŸ<™<×/Ñ/Ô0CØ03Ø=Að 0ó C‘ð" ˆHØˆHÜ×Ñ˜D (¨HÔ5Ø�=Š=Ü%›-ˆD�Kà&×6Ñ6Ð6ˆLðFÝ@Ù1°'·.±.Ø2>ó@�”ô & d§k¡kÓ2ˆŒ
Ø�
‰
×Ñ˜?¨D×,BÑ,BÔCà $§¡× >Ñ >Ó @ˆÔÜ�	‰	Ð*Õ+øô? —?‘?×6Ñ6ò CØ—<‘<×'Ñ'¨5Ñ0Ü—L‘LÐ!DÔEÜ—H‘H˜Q”KÜ—‘Ð>Ô?Ø #§¡Ô/BÜ/?ó!A�à×"Ñ"Ô2GØ+.ð #ô 0ä—
‘
˜1”ÜŸ<™<×/Ñ/Ô0CØ03Ø=Að 0ó C“ðCûð2FÜ'¨¯©¸ÓE�—ús   Â&F ÄJ ÆC JÊJÊJ%c                 óê  — | j                   j                  «       | j                  k7  r;| j                   j                  «       | _        | j                  d| j                  «       | j                  j                   j
                  r+| j                  j                   j
                  j                  }nd}| j                  j                  D �cg c]  }|j                  ‘Œ }}| j                  ||«       yc c}w )z)Callback for a changed transaction queue.ÚRebootRequiredr5   N)	rÍ  r’  r“  r  r³   rÎ  r®   rc   ÚActiveTransactionsChanged)rA   r³   ÚcurrentrÎ  Úqueueds        r'   r‘  zAptKit._on_queue_changed¯  s´   € ð �;‰;×)Ñ)Ó+¨t×/DÑ/DÒDØ$(§K¡K×$BÑ$BÓ$DˆDÔ!Ø× Ñ Ð!1°4×3HÑ3HÔIà�:‰:×Ñ×"Ò"Ø—j‘j×'Ñ'×-Ñ-×1Ñ1‰GàˆGØ)-¯©×)9Ñ)9Ö: �%—)“)Ð:ˆÐ:Ø×&Ñ& w°Õ7ùò ;s   ÃC0r§   r9   c                 ó:   — t         j                  d|›d|›�«       yr–  r>   r˜  s      r'   r  zAptKit.PropertyChanged¾  s   € ô 	�	Š	ºÁ%ÐHÕIr)   Úsasc                 ó2   — t         j                  d||«       y)a!  The currently processed or the queued transactions changed.

        :param current: The path of the currently running transaction or
            an empty string.
        :param queued: List of the ids of the queued transactions.

        :type current: s
        :type queued: as
        z1Emitting ActiveTransactionsChanged signal: %s, %sNr>   )rA   rš  r›  s      r'   r™  z AptKit.ActiveTransactionsChangedÌ  s   € ô 	�	‰	ÐEØ˜6õ	#r)   c                 ó:  — | j                   j                  du r9t        j                  d«       t	        j
                  t        | j                  «       t        j                  d«       	 t        j                  «        y# t        $ r | j                  d«       Y yw xY w)z&Start the daemon and listen for calls.FzUsing inactivity checkzWaiting for callsN)r�  Údisable_timeoutr?   r@   r   rà   r   Ú_check_for_inactivityr    re  ÚKeyboardInterruptr‰  r  s    r'   re  z
AptKit.runÛ  sq   € à�<‰<×'Ñ'¨5Ñ0Ü�I‰IÐ.Ô/Ü×$Ñ$Ô%?Ø%)×%?Ñ%?ôAä�	‰	Ð%Ô&ð	Ü�L‰L�NøÜ ò 	Ø�I‰I�dŽOð	ús   Á(A= Á=BÂBc              #   óZ  K  — t        j                  || j                  «      –—\  }}}}t        j                  «       j
                  }	t        |	|| j                  |||||||| j                  ¬«      }
|
| j                  j                  |
j                  <   t        |
j                  «       y­w)z9Helper method which returns the tid of a new transaction.)rì   rÁ   r¯   N)r   Úget_proc_info_from_dbus_namer¯   r«   r¬   r­   r   r³   rö   r®   r   )rA   rê   r{   rì   rÁ   rº   r´   rµ   r¹   r®   rÎ  s              r'   Ú_create_transzAptKit._create_transç  s�   è ø€ ô ×9Ñ9¸&À$Ç(Á(ÓKÑKñ 	ˆˆS�#�wä�j‰j‹l×ÑˆÜØ��t—z‘z 3¨¨S°'¸6Ø f°$·(±(ô<ˆð ',ˆ�
‰
×Ñ˜Ÿ™Ñ#Ü�U—Y‘YÕùs   ‚B)B+r5   rF   r{   r|   c                 ól   — t         j                  d«       | j                  t        j                  |«      S )aJ  Try to complete cancelled installations. This is equivalent to a
        call of ``dpkg --configure -a``.

        Requires the ``org.aptkit.install-or-remove-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zFixIncompleteInstall() called)r?   r½  r¥  r   rP  rÂ  s     r'   ÚFixIncompleteInstallzAptKit.FixIncompleteInstallô  s*   € ô 	�‰Ð0Ô1Ø×!Ñ!¤%×"CÑ"CÀVÓLÐLr)   c                 ól   — t         j                  d«       | j                  t        j                  |«      S )a  Try to resolve unsatisfied dependencies of installed packages.

        Requires the ``org.aptkit.install-or-remove-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zFixBrokenDepends() called)r?   r½  r¥  r   rQ  rÂ  s     r'   ÚFixBrokenDependszAptKit.FixBrokenDepends  s*   € ô 	�‰Ð,Ô-Ø×!Ñ!¤%×"?Ñ"?ÀÓHÐHr)   c                 óx   — t         j                  d«       ddi}| j                  t        j                  ||¬«      S )aH  Download the latest information about available packages from the
        repositories and rebuild the package cache.

        Requires the ``org.aptkit.update-cache``
        :ref:`PolicyKit privilege <policykit>`.

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zUpdateCache() was calledÚsources_listNr8  ©r?   r½  r¥  r   rê  )rA   r{   rÁ   s      r'   ÚUpdateCachezAptKit.UpdateCache  s@   € ô 	�‰Ð+Ô,Ø  $Ð'ˆØ×!Ñ!¤%×"9Ñ"9¸6Ø)/ð "ó 1ð 	1r)   c                 óx   — t         j                  d«       d|i}| j                  t        j                  ||¬«      S )aB  Update the cache from the repositories defined in the given
        sources.list only.

        Requires the ``org.aptkit.update-cache``
        :ref:`PolicyKit privilege <policykit>`.

        :param sources_list: The absolute path to a sources.list, e.g.
            :file:`/etc/apt/sources.list.d/ppa-aptkit.list` or the name
            of the snippet in :file:`/etc/apt/sources.list.d/`, e.g.
            :file:`ppa-aptkit.list`.
        :type sources_list: s

        :returns: The D-Bus path of the new transaction object which
            performs this action.
         z!UpdateCachePartially() was calledr«  r8  r¬  )rA   r«  r{   rÁ   s       r'   ÚUpdateCachePartiallyzAptKit.UpdateCachePartially(  s@   € ô& 	�‰Ð4Ô5Ø  ,Ð/ˆØ×!Ñ!¤%×"9Ñ"9¸6Ø)/ð "ó 1ð 	1r)   rF  c           
      ó    — t         j                  d|«       | j                  |«       | j                  t        j
                  |g g |g g g f¬«      S )aß  Remove the given packages from the system. The configuration files
        will be kept by default. Use :func:`CommitPackages()` to also purge the
        configuration files.

        Requires the ``org.aptkit.install-or-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :param package_names: packages to be removed
        :type package_names: as

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z!RemovePackages() was called: '%s'©rì   )r?   r½  Ú_check_package_namesr¥  r   rH  ©rA   Úpackage_namesr{   s      r'   ÚRemovePackageszAptKit.RemovePackagesA  sU   € ô" 	�‰Ð4°mÔDØ×!Ñ! -Ô0Ø×!Ñ!¤%×"<Ñ"<¸fØ,.°°MÀ2ÀrÈ2Ð+Nð "ó Pð 	Pr)   rW   c                 óz   — t         j                  d|z  «       | j                  t        j                  |d|i¬«      S )aã  Apply all available upgrades and try to resolve conflicts.

        Requires the ``org.aptkit.upgrade-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :param safe_mode: If True only already installed packages will be
            updated. Updates which require to remove installed packages or to
            install additional packages will be skipped.

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z-UpgradeSystem() was called with safe mode: %sÚ	safe_moder8  )r?   r½  r¥  r   rK  )rA   r·  r{   s      r'   ÚUpgradeSystemzAptKit.UpgradeSystemX  sI   € ô  	�‰ð Ø!ñ"ô 	#à×!Ñ!¤%×";Ñ";¸VØ*5°yÐ)Að "ó Cð 	Cr)   rª   c           	      óò   — t         j                  d||||||«       d„ }||||||fD �	cg c]
  }	 ||	«      ‘Œ }
}	|
D ]  }| j                  |«       Œ | j                  t        j
                  ||
¬«      S c c}	w )a�  Perform several package changes at the same time.

        The version number and target release of the packages can be specified
        using the traditional apt-get syntax, e.g. "xterm=281.1" to force
        installing the version 281.1 of xterm or "xterm/experimental" to
        force installing xterm from the experimental release.

        Requires the ``org.aptkit.install-or-remove-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :param install: Packages to be installed.
        :param reinstall: Packages to be re-installed
        :param remove: Packages to be removed
        :param purge: Package to be removed including theirs configuration
            files.
        :param upgrade: Packages to be upgraded.
        :param downgrade: Packages to be downgraded. You
            have to append the target version to the package name separated
            by "="

        :type install: as
        :type reinstall: as
        :type remove: as
        :type purge: as
        :type upgrade: as
        :type downgrade: as

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z3CommitPackages() was called: %s, %s, %s, %s, %s, %sc                 ó   — | dgk(  rg S | S )Nr5   r8   )r  s    r'   Úcheck_empty_listz/AptKit.CommitPackages.<locals>.check_empty_list–  s   € Ø�r�dŠ{Ø�	à�
r)   r±  )r?   r½  r²  r¥  r   rÕ  )rA   ÚinstallÚ	reinstallrõ  ÚpurgeÚupgradeÚ	downgrader{   r»  r  Úpackages_lstrì   s               r'   ÚCommitPackageszAptKit.CommitPackagesn  s©   € ôJ 	�‰ÐFØ˜) V¨U°G¸Yô	Hò	ð
 ;BÀ9Ø:@À%Ø:AØ:Cð:Eö F°#Ñ(¨Õ-ð Fˆð Fð %ò 	0ˆHØ×%Ñ% hÕ/ð	0à×!Ñ!¤%×"<Ñ"<¸fØ+7ð "ó 9ð 	9ùòFs   ©A4c           
      ó¤   — t         j                  d|z  «       | j                  |«       | j                  t        j
                  ||g g g g g f¬«      S )a”  Fetch and install the given packages from the repositories.

        The version number and target release of the packages can be specified
        using the traditional apt-get syntax, e.g. "xterm=281.1" to force
        installing the version 281.1 of xterm or "xterm/experimental" to
        force installing xterm from the experimental release.

        Requires the ``org.aptkit.install-or-remove-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :param package_names: Packages to be upgraded
        :type package_names: as

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z InstallPackages() was called: %sr±  )r?   r½  r²  r¥  r   rÔ  r³  s      r'   ÚInstallPackageszAptKit.InstallPackages¥  sX   € ô( 	�‰Ð3°mÑCÔDØ×!Ñ! -Ô0Ø×!Ñ!¤%×"=Ñ"=¸vØ,9¸2¸rÀ2ÀrÈ2Ð+Nð "ó Pð 	Pr)   c           
      ó¤   — t         j                  d|z  «       | j                  |«       | j                  t        j
                  |g g g g |g f¬«      S )a‚  Upgrade the given packages to their latest version.

        The version number and target release of the packages can be specified
        using the traditional apt-get syntax, e.g. "xterm=281.1" to force
        installing the version 281.1 of xterm or "xterm/experimental" to
        force installing xterm from the experimental release.

        Requires the ``org.aptkit.upgrade-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :param package_names: Packages to be upgraded
        :type package_names: as

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z UpgradePackages() was called: %sr±  )r?   r½  r²  r¥  r   rJ  r³  s      r'   ÚUpgradePackageszAptKit.UpgradePackages¿  sX   € ô( 	�‰Ð3°mÑCÔDØ×!Ñ! -Ô0Ø×!Ñ!¤%×"=Ñ"=¸vØ,.°°B¸¸MÈ2Ð+Nð "ó Pð 	Pr)   r‡   c                 óz   — t         j                  d||«       | j                  t        j                  |||dœ¬«      S )a!  Download and install the key of a software vendor. The key is
        used to authenticate packages of the vendor.

        Requires the ``org.aptkit.change-repositories``
        :ref:`PolicyKit privilege <policykit>`.

        :param keyid: The id of the GnuPG key (e.g. 0x0EB12F05)
        :param keyserver: The server to get the key from (e.g.
            keyserver.ubuntu.com)

        :type keyid: s
        :type keyserver: s

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z1InstallVendorKeyFromKeyserver() was called: %s %s)ÚkeyidÚ	keyserverr8  )r?   r½  r¥  r   ré  )rA   rÈ  rÉ  r{   s       r'   ÚAddVendorKeyFromKeyserverz AptKit.AddVendorKeyFromKeyserverÙ  sH   € ô( 	�‰ÐDØ˜	ô	#à×!Ñ!¤%×"JÑ"JØ"(¸5Ø?Hñ2Jð "ó Kð 	Kr)   c                 óz   — t         j                  d|z  «       | j                  t        j                  |d|i¬«      S )a“  Install the key file of a software vendor. The key is
        used to authenticate packages of the vendor.

        Requires the ``org.aptkit.change-repositories``
        :ref:`PolicyKit privilege <policykit>`.

        :param path: The absolute path to the key file.
        :type path: s

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z%InstallVendorKeyFile() was called: %sr¾   r8  )r?   r½  r¥  r   rM  )rA   r¾   r{   s      r'   ÚAddVendorKeyFromFilezAptKit.AddVendorKeyFromFileô  sA   € ô  	�‰Ð8¸4Ñ?Ô@Ø×!Ñ!¤%×"@Ñ"@Ø"(°&¸$°ð "ó Að 	Ar)   c                 óz   — t         j                  d|z  «       | j                  t        j                  |d|i¬«      S )aš  Remove the given key of a software vendor. The key is used to
        authenticate packages of the vendor.

        Requires the ``org.aptkit.change-repositories``
        :ref:`PolicyKit privilege <policykit>`.

        :param fingerprint: The fingerprint of the key.
        :type fingerprint: s

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z RemoveVendorKey() was called: %sÚfingerprintr8  )r?   r½  r¥  r   rO  )rA   rÎ  r{   s      r'   ÚRemoveVendorKeyzAptKit.RemoveVendorKey	  sB   € ô  	�‰Ð3°kÑAÔBØ×!Ñ!¤%×">Ñ">Ø"(°-ÀÐ1Mð "ó Oð 	Or)   Úsbc                 ó|   — t         j                  d|z  «       | j                  t        j                  |||dœ¬«      S )aà  Install the given local package file.

        Requires the ``org.aptkit.install-file``
        :ref:`PolicyKit privilege <policykit>`.

        :param path: The absolute path to the package file.
        :param force: If the installation of a package which violates the
            Debian/Ubuntu policy should be forced.

        :type path: s
        :type force: b

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zInstallFile() was called: %s)r¾   Úforcer8  )r?   r½  r¥  r   rÿ  )rA   r¾   rÒ  r{   s       r'   ÚInstallFilezAptKit.InstallFile  sH   € ô& 	�‰Ð/°$Ñ6Ô7ð ×!Ñ!¤%×"9Ñ"9Ø"(¸$Ø;@ñ2Bð "ó Cð 	Cr)   c                 ól   — t         j                  d«       | j                  t        j                  |«      S )zìRemove downloaded package files.

        Requires the ``org.aptkit.clean``
        :ref:`PolicyKit privilege <policykit>`.

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zClean() was called)r?   r½  r¥  r   rS  rÂ  s     r'   ÚCleanzAptKit.Clean9  s*   € ô 	�‰Ð%Ô&Ø×!Ñ!¤%×"2Ñ"2°FÓ;Ð;r)   Úassc           
      ó¦   — t         j                  ddj                  |«      z  «       | j                  t        j
                  |g |g g g g gd|i¬«      S )a6  Reconfigure already installed packages.

        Requires the ``org.aptkit.install-or-remove-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :param packages: List of package names which should be reconfigure.
        :param priority: The minimum debconf priority of question to be
            displayed. Can be of value "low", "medium", "high", "critical",
            "default".

        :type packages: as
        :type priority: s

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zReconfigure() was called: %sú Úpriority)rì   rÁ   )r?   r½  Újoinr¥  r   rR  )rA   rì   rÙ  r{   s       r'   ÚReconfigurezAptKit.ReconfigureI  s[   € ô( 	�‰Ð/°#·(±(¸8Ó2DÑDÔEØ×!Ñ!¤%×"8Ñ"8¸&Ø,.°¸"¸bÀ"ÀbÐ+IØ*4°hÐ)?ð "ó Að 	Ar)   Ússsasssc                 óŠ   — t         j                  d||||||«       | j                  t        j                  |||||||dœ¬«      S )a]  Add given repository to the sources list.

        Requires the ``org.aptkit.change-repositories``
        :ref:`PolicyKit privilege <policykit>`.

        :param src_type: The type of the repository (deb, deb-src).
        :param uri: The main repository URI
            (e.g. http://archive.ubuntu.com/ubuntu)
        :param dist: The distribution to use (e.g. stable or lenny-backports).
        :param comps: List of components (e.g. main, restricted).
        :param comment: A comment which should be added to the sources.list.
        :param sourcesfile: (Optoinal) filename in sources.list.d.

        :type src_type: s
        :type uri: s
        :type dist: s
        :type comps: as
        :type comment: s
        :type sourcesfile: s

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zaAddRepository() was called: type='%s' uri='%s' dist='%s' comps='%s' comment='%s' sourcesfile='%s')Úsrc_typeÚuriÚdistÚcompsÚcommentÚsourcesfiler8  )r?   r½  r¥  r   rè  )rA   rÞ  rß  rà  rá  râ  rã  r{   s           r'   ÚAddRepositoryzAptKit.AddRepositoryc  s`   € ô8 	�‰ð Fà˜3  e¨W°kô	Cð ×!Ñ!¤%×";Ñ";¸VØ6>ÀsØ26ÀØ5<Ø9Dñ*Fð "ó Gð 	Gr)   c                 óv   — t         j                  d|«       | j                  t        j                  |d|i¬«      S )aÀ  Enable the component in the distribution repositories. This will
        not affect third-party repositories.

        The repositories of a distribution are often separated into
        different components because of policy reasons. E.g. Debian uses main
        for DFSG-free software and non-free for re-distributable but not free
        in the sense of the Debian Free Software Guidelines.

        Requires the ``org.aptkit.change-repositories``
        :ref:`PolicyKit privilege <policykit>`.

        :param component: The component, e,g, main or non-free.
        :type component: s
        :returns: The D-Bus path of the new transaction object which
            performs this action.
        z-EnableComponent() was called: component='%s' Ú	componentr8  )r?   r½  r¥  r   rU  )rA   ræ  r{   s      r'   ÚEnableDistroComponentzAptKit.EnableDistroComponent‰  s?   € ô( 	�‰Ð@À)ÔLØ×!Ñ!¤%×"?Ñ"?ÀØ*5°yÐ)Að "ó Cð 	Cr)   c                 óN   — t         j                  d«       | j                  |«      S )a  Get the list of the installed vendor keys which are used to
        authenticate packages.

        Requires the ``org.aptkit.get-trusted-vendor-keys``
        :ref:`PolicyKit privilege <policykit>`.

        :returns: Fingerprints of all installed keys.
        z!GetTrustedVendorKeys() was called)r?   r½  Ú_get_trusted_vendor_keysrÂ  s     r'   ÚGetTrustedVendorKeyszAptKit.GetTrustedVendorKeys¢  s"   € ô 	�‰Ð4Ô5Ø×,Ñ,¨VÓ4Ð4r)   c              #   ó¾   K  — t         j                  }t        j                  ||| j                  ¬«      –— | j                  j                  «       }t        |«       y ­w)Nr¯  )r   Ú!PK_ACTION_GET_TRUSTED_VENDOR_KEYSr²  r¯   rÍ  Úget_trusted_vendor_keysr   )rA   r{   r´  Úfingerprintss       r'   ré  zAptKit._get_trusted_vendor_keys±  sK   è ø€ ä×=Ñ=ˆÜ×4Ñ4°V¸VØ9=¿¹ôCò 	Cà—{‘{×:Ñ:Ó<ˆÜ�\Õ"ùs   ‚AAr‚   c                 ó8  — t         j                  d«       | j                  j                  D �cg c]  }|j                  ‘Œ }}| j                  j
                  j                  r.| j                  j
                  j                  j                  }||fS d}||fS c c}w )z^Return the currently running transaction and the list of queued
        transactions.
        z"GetActiveTransactions() was calledr5   )r?   r@   r³   rc   r®   rÍ  rÎ  )rA   rÎ  r›  rš  s       r'   ÚGetActiveTransactionszAptKit.GetActiveTransactionsº  s‚   € ô 	�	‰	Ð6Ô7Ø)-¯©×)9Ñ)9Ö: �%—)“)Ð:ˆÐ:Ø�:‰:×Ñ×"Ò"Ø—j‘j×'Ñ'×-Ñ-×1Ñ1ˆGð ˜ˆÐð ˆGØ˜ˆÐùò ;s   ®BÚcaller_namec                 óª   — t         j                  d«       t         j                  d«       t        j                  «        t         j                  d«       y)z!Request a shutdown of the daemon.zQuitting was requestedzQuitting main loop...ÚExitN)r?   r½  r@   r    Úquit)rA   rñ  s     r'   r‰  zAptKit.QuitÉ  s3   € ô
 	�‰Ð)Ô*Ü�	‰	Ð)Ô*Ü�‰ŒÜ�	‰	�&Õr)   Ússsc                 óx   — t         j                  d«       | j                  t        j                  ||||dœ¬«      S )a€  Install a license key to use a piece of proprietary software.

        Requires the ``org.aptkit.install-or-remove-packages``
        :ref:`PolicyKit privilege <policykit>`.

        :param pkg_name: The name of the package which requires the license
        :type pkg_name: s
        :param json_token: The oauth token to use with the server in
            json format
        :type pkg_name: s
        :param server_name: The name of the server to use (ubuntu-production,
            ubuntu-staging)
        :type pkg_name: s

        :returns: The D-Bus path of the new transaction object which
            performs this action.
        zAddLicenseKey() was called)Úpkg_nameÚ
json_tokenÚserver_namer8  )r?   r½  r¥  r   rë  )rA   r÷  rø  rù  r{   s        r'   ÚAddLicenseKeyzAptKit.AddLicenseKeyÔ  sD   € ô* 	�‰Ð-Ô.Ø×!Ñ!¤%×"<Ñ"<¸fØ6>Ø8BØ9Dñ*Fð "ó Gð 	Gr)   c              #   ó(  K  — t         j                  }t        j                  ||| j                  ¬«      –— |t        k(  �r/|dk(  r0| j
                  j                  |t        j                  |«      «       y
|dk(  r1| j
                  j                  |t        j                  |«      d«       y
|dk(  r1| j
                  j                  |t        j                  |«      d«       y
|dk(  r1| j
                  j                  |t        j                  |«      d«       y
|dk(  r1| j
                  j                  |t        j                  |«      d«       y
t        j                  j                  d|z  «      ‚t        j                  j                  d	|z  «      ‚­w)rŒ   r¯  ÚPopConParticipationÚAutoUpdateIntervalÚ
10periodicÚAutoDownloadÚAutoCleanIntervalÚUnattendedUpgrader�   r+  N)r   ÚPK_ACTION_CHANGE_CONFIGr²  r¯   rŠ  rÍ  Ú
set_configr[   rk   rh   rŽ   r�   )rA   ru   rN   rx   r{   r´  s         r'   r   zAptKit._set_propertyï  sM  è ø€ ô ×3Ñ3ˆÜ×4Ñ4°V¸VØ9=¿¹ôCò 	CàÔ)Ó)ØÐ,Ò,Ø—‘×&Ñ& t¬T¯\©\¸%Ó-@ÕAØÐ-Ò-Ø—‘×&Ñ& t¬T¯Z©Z¸Ó->ÀÕMØ˜Ò'Ø—‘×&Ñ& t¬T¯\©\¸%Ó-@À,ÕOØÐ,Ò,Ø—‘×&Ñ& t¬T¯Z©Z¸Ó->ÀÕMØÐ,Ò,Ø—‘×&Ñ& t¬T¯\©\¸%Ó-@À,ÕOä—o‘o×3Ñ3ð 5CØEIñ5Jó Kð Kô —/‘/×/Ñ/Ð0GØ05ñ16ó 7ð 7ùs   ‚FFc                 óÈ  — |D ]Ý  }t        |«      \  }}}|j                  d«      \  }}}|dvrt        j                  d|z  «      ‚t	        j
                  t        |«      st        j                  d|z  «      ‚|�2t	        j
                  t        |«      st        j                  d|z  «      ‚|€Œ¬t	        j
                  t        |«      rŒÇt        j                  d|z  «      ‚ y)zTCheck if the package names are valid. Otherwise raise an
        exception.
        ú#)r5   Úautoz%s isn't a valid flagz%s isn't a valid package nameNz%s isn't a valid versionz%s isn't a valid release)	r   Ú	partitionr   rø  ÚreÚmatchÚREGEX_VALID_PACKAGENAMEÚREGEX_VALID_VERSIONÚREGEX_VALID_RELEASE)rA   Ú	pkg_namesÚfullnamerN   ÚversionÚreleaseÚsepÚ	auto_flags           r'   r²  zAptKit._check_package_names  sò   € ð "ò 	5ˆHÜ%5°hÓ%?Ñ"ˆD�'˜7Ø#'§>¡>°#Ó#6Ñ ˆD�#�yØ Ñ,Ü×(Ñ(Ð)@Ø,5ñ*6ó 7ð 7ä—8‘8Ô3°TÔ:Ü×(Ñ(Ð)HØ,0ñ*1ó 2ð 2àÐ#ÜŸ™Ô!4°gÔ>Ü×(Ñ(Ð)CØ,3ñ*4ó 5ð 5àÑ#ÜŸ™Ô!4°gÕ>Ü×(Ñ(Ð)CØ,3ñ*4ó 5ð 5ñ	5r)   c           	      ó:  — |t         k(  �rt        j                  | j                  j	                  d«      «      t        j
                  | j                  j	                  d«      «      t        j                  | j                  j	                  d«      «      t        j                  | j                  j	                  d«      «      t        j
                  | j                  j	                  d«      «      t        j
                  | j                  j                  «       «      dœS i S )z/Helper get the properties of a D-Bus interface.rý  rÿ  r   r  rü  )rý  rÿ  r   r  rü  r˜  )rŠ  r[   rh   rÍ  Ú
get_configrk   r’  r…   s     r'   ra   zAptKit._get_properties  sÖ   € àÔ)Ó)ä&*§j¡jØ—K‘K×*Ñ*Ð+?Ó@ó'Bä $§¡Ø—K‘K×*Ñ*¨>Ó:ó!<ä%)§Z¡ZØ—K‘K×*Ñ*Ð+>Ó?ó&Aä%)§Z¡ZØ—K‘K×*Ñ*Ð+>Ó?ó&Aä'+§|¡|Ø—K‘K×*Ñ*Ð+@ÓAó(Cä"&§,¡,Ø—K‘K×2Ñ2Ó4ó#6ñ7ð 7ð ˆIr)   c                 ó&   — | j                  d«       y)z&Internal callback for the quit signal.N)r‰  )rA   rs   s     r'   r  zAptKit._sigquit0  s   € à�	‰	�$�r)   c                 ó”  — t         j                  d«       | j                  j                  j                  }| j                  j                  j
                  sst        j                  «       j                  «       sQt        j                  «       |z
  t        kD  r3| j                  s't         j                  d«       | j                  d«       yy)zgShutdown the daemon if it has been inactive for time specified
        in APTKIT_IDLE_TIMEOUT.
        zChecking for inactivityzQuitting due to inactivityNFT)r?   r@   r³   rÍ  Úlast_action_timestamprÎ  r   Úmain_context_defaultÚpendingr‹  r	   r½  r‰  )rA   Ú	timestamps     r'   r¡  zAptKit._check_for_inactivity4  s‡   € ô 	�	‰	Ð+Ô,Ø—J‘J×%Ñ%×;Ñ;ˆ	Ø—
‘
×!Ñ!×'Ò'Ü×-Ñ-Ó/×7Ñ7Ô9Ü—	‘	“˜iÑ'Ô*=Ò=Ø—J’JÜ�H‰HÐ1Ô2Ø�I‰I�dŒOØØr)   )TN)NN),r’   r“   r”   r•   r²   r‘  r[   r\   r–   rŠ  r  r™  re  r   r¥  r   r§  r©  r­  r¯  rµ  r¸  rÂ  rÄ  rÆ  rÊ  rÌ  rÏ  rÓ  rÕ  rÛ  rä  rç  rê  ré  r˜   rð  r‰  rú  r   r²  ra   r  r¡  r8   r)   r'   r   r   h  sò  „ ñó<,ò|8ð 
‡\�\×ÑÐ(=Ø#'ð ó )ñ	Jó)ð	Jð 
‡\�\×ÑÐ(=Ø#(ð ó *ñ#ó*ð#ò
ð ò	 ó ð	 ñ Ð/Ø')¸Ø)1ô3ñMó3ðMñ Ð/Ø')¸Ø)1ô3ñ
Ió3ð
Iñ Ð/Ø')¸Ø)1ô3ñ1ó3ð1ñ  Ð/Ø'*¸#Ø)1ô3ñ1ó3ð1ñ, Ð/Ø'+¸3Ø)1ô3ñPó3ðPñ( Ð/Ø'*¸#Ø)1ô3ñCó3ðCñ& Ð/Ø'5ÀSØ)1ô3ñ19ó3ð19ñh Ð/Ø'+¸3Ø)1ô3ñPó3ðPñ. Ð/Ø'+¸3Ø)1ô3ñPó3ðPñ. Ð/Ø'+¸3Ø)1ô3ñKó3ðKñ0 Ð/Ø'*¸#Ø)1ô3ñAó3ðAñ$ Ð/Ø'*¸#Ø)1ô3ñOó3ðOñ$ Ð/Ø'+¸3Ø)1ô3ñCó3ðCñ0 Ð/Ø')¸Ø)1ô3ñ
<ó3ð
<ñ Ð/Ø',¸CØ)1ô3ñAó3ðAñ. Ð/Ø'0ÀØ)1ô3ñ Gó3ð GñF Ð/Ø'*¸#Ø)1ô3ñCó3ðCñ, Ð/Ø')¸Ø)1ô3ñ
5ó3ð
5ð ñ#ó ð#ð 
‡\�\×ÑÐ.Ø&(¸ð ó ?ñ
ó?ð
ð 
‡\�\×ÑÐ.Ø&(¸Ø(5ð ó 7ñó7ðñ Ð/Ø',¸CØ)1ô3ñGó3ðGð0 ñ7ó ð7ò.5ò,ò&ór)   c                 ó–   — 	 t        j                  | «      S # t        $ r( t        j                  | j                  |d«      «      cY S w xY w)z<Convert the given string or unicode object to a dbus.String.Úignore)r[   rf   ÚUnicodeDecodeErrorÚdecode)ri  rZ   s     r'   rþ   rþ   D  s?   € ð<Ü�{‰{˜4Ó Ð øÜò <Ü�{‰{˜4Ÿ;™; x°Ó:Ó;Ò;ð<ús   ‚ —.AÁAc                  ó~  — t        «       } | j                  dddddt        d«      ¬«       | j                  dd	ddd
t        d«      ¬«       | j                  dddddt        d«      ¬«       | j                  dddddt        d«      ¬«       | j                  dddddt        d«      ¬«       | j                  ddddddt        d«      ¬«       | j                  dddddd t        d!«      ¬«       | j                  d"ddd#t        d$«      ¬«       | j                  «       \  }}|j                  d%u r$t
        j                  t        j                  «       nFt
        j                  t        j                  «       t        j                  t        j                  «       |j                  rt        j                  «       }nd}t        ||¬&«      }|j                  r[d'dl}|j!                  «       }|j#                  |j$                  «       |j'                  |j                  «       |j)                  «        y|j%                  «        y)(z.Allow to run the daemon from the command line.z-tz--disable-timeoutFÚ
store_truer   z0Do not shutdown the daemon because of inactivity)Údefaultr´  ÚdestÚhelpr5   z--disable-pluginsrŽ  zDo not load any pluginsz-dz--debugr@   z$Show internal processing informationz-rz	--replacer'  z*Quit and replace an already running daemonz--session-busÚsession_busz9Listen on the DBus session bus (Only required for testingz--chrootNÚstoreÚstringr�  z&Perform operations in the given chroot)r!  r´  rR   r"  r#  z-pz	--profileÚprofilez)Store profile stats in the specified filez--dummyr�  zADo not make any changes to the system (Only of use to developers)Tr¯  r   )r   Ú
add_optionr  Ú
parse_argsr@   r?   ÚsetLevelÚloggingÚDEBUGÚINFOÚ_console_handlerr$  r[   Ú
SessionBusr   r'  ÚProfileÚruncallre  Ú
dump_statsÚprint_stats)Úparserr�  Úargsr¯   Údaemonr'  Úprofilers          r'   Úmainr8  L  s?  € ä‹^€FØ
×Ñ�dÐ/Ø#Ø)Ð0AÜð *ó +ð ô ,ð
 ×Ñ�bÐ-Ø#Ø)Ð0AÜÐ6Ó7ð ô 9ð ×Ñ�d˜IØ#Ø)°Üð +ó ,ð ô -ð
 ×Ñ�d˜KØ#Ø)°	Üð &ó 'ð ô (ð
 ×Ñ�b˜/Ø#Ø)°Üð +ó ,ð ô -ð
 ×Ñ�b˜*¨dØ$¨8¸(Üð &ó 'ð ô (ð ×Ñ�d˜KØ#Ø$¨8¸)Üð $ó %ð ô &ð
 ×Ñ�iØ#Ø)°Üð 5ó 6ð ô 7ð
 ×%Ñ%Ó'�M€GˆTØ‡}�}˜ÑÜ�‰”W—]‘]Õ#ä�‰”W—\‘\Ô"Ü×!Ñ!¤'§,¡,Ô/Ø×ÒÜ�o‰oÓ‰àˆÜ�G Ô%€FØ‡‚ÛØ—?‘?Ó$ˆØ×Ñ˜Ÿ™Ô$Ø×Ñ˜GŸO™OÔ,Ø×ÑÕà�
‰
�r)   )rY   )ar•   Ú
__author__Ú__all__rZ  Ú	xml.etreer   r$   Úhashlibr   r¶   r+  Úlogging.handlersÚoptparser   r½   r  r–   r†  r‹  r«   Úgi.repositoryr   r   Údbus.exceptionsr[   Údbus.serviceÚdbus.mainloop.glibr"  r   r5   r   r   Údeferr   r   r   Údefer.utilsr   r   Úutilsr   r   rÍ  r   Úworker.aptworkerr   r   Úloopr    Úloggerr!   r  r  r@  rB  rŠ  rƒ  r   r   r   r	   r
   r   r
  r  r  ÚglibÚDBusGMainLoopÚputenvÚ	getLoggerr?   ÚhandlersÚSysLogHandlerÚ
LOG_DAEMONÚ_syslog_handlerr*  r-  Ú	FormatterÚ_syslog_formatterÚsetFormatterÚ
addHandlerÚStreamHandlerr.  Ú_console_formatterró   Ú	setlocaleÚLC_ALLr(  r‡  r\   r]   r7   r   r   r   rþ   r8  r8   r)   r'   ú<module>rY     s¨  ðñ	ð4 5€
ðB€ó Ý !Û Ý Û Û Û Ý !Û 	Û 	Û Û 
Û Û ç 'Û Û Û å  Ý Ý ß :Ñ :Ý ,Ý ß 2Ý ÷Oå Ý $ñ 0€Ø‡;�;�#ÒØ€OØ!Ñà €OØ"Ðà$Ð Ø Ð Ø"Ð à$<Ð !àÐ ØÐ ð Ð ð Ð ð BÐ ð 3Ð à,Ð ð ‡�× Ñ ×  Ñ  °Ð  Ô 5ð 
€‡	�	ˆ&Ø
HôJð €g×Ñ˜Ó!€ð$Ø×&Ñ&×4Ñ4ØØ×!Ñ!×/Ñ/×:Ñ:ð 5ó <€Oð ×Ñ˜WŸ\™\Ô*Ø)˜×)Ñ)ð +8ó 9Ðà× Ñ Ð!2Ô3ð ‡N�N�?Ô#Ø(�7×(Ñ(Ó*Ð Ù%ð '4à&*ó,Ð ð × Ñ Ð0Ô 1Ø ‡�ÐÔ  àˆG×Ñ˜nÓ-€	ðKØ€F×Ñ�V—]‘] BÔ'ô
s�—‘×$Ñ$ô sôlSO�*ô SOôl M!�w—‘ô M!ô`YˆZô Yóx<ó;øði>	Ùûð ‡|�|ò KØ‡K�KÐIÖJðKús   Ä A9I( Ç9I/ É(I,É/ JÊJ