Ë
    É f·�  ã                   óú  — 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
Z
d dlZ	 d dlm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 d dlZd dlZd dl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'  G d„ de(«      Z)e*dk(  r/ e)«       Z+ e,e+j[                  «       «       e+j]                  d «       yy# e$ r ej                  ZY Œ£w xY w# e$ r d dlZY Œ©w xY w# e$ r	 d dlmZ Y Œ§w xY w)é    N)Úmd5)Ú	maketrans)ÚNamedTemporaryFile)Úescape)ÚConfigParser)Úgettexté   )ÚAptAuth)ÚSourcesListÚSourceEntryÚDeb822SourceEntry)ÚInvalidShortcutException)Úshortcut_handler)ÚGioc                   óš  — e Zd ZdZdZ e ed«      «      \  ZZZ	edede	diZ
d=d„Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z d„ Z!d„ Z"d „ Z#d!„ Z$d"„ Z%d#„ Z&d$„ Z'd%„ Z(d&„ Z)d'„ Z*d(„ Z+d)„ Z,d*„ Z-d+„ Z.d,„ Z/d-„ Z0d.„ Z1d/„ Z2d0„ Z3d1„ Z4d2„ Z5d3„ Z6d>d4„Z7d>d5„Z8d?d6„Z9d7„ Z:d8„ Z;d9„ Z<d:„ Z=d;„ Z>e?d@d<„«       Z@y)AÚSoftwarePropertiesz /usr/share/app-install/channels/z$/etc/update-manager/release-upgradesé   ÚnormalÚltsÚneverNc                 óP  — |dz   | _         || _        |dk7  r t        j                  j	                  d|«       |dk(  rd}|| _        || _        t        |¬«      | _        t        j                  j                  «       | _
        g | _        d| _        | j                  «        | j                  «        | j!                  «        g | _        t%        j&                  «       | _        t+        |¬«      | _        t/        j0                  «       | _        t5        j6                  | j8                  «       y)	zš Provides the core functionality to configure the used software
        repositories, the corresponding authentication keys and
        update automation z/etc/popularity-contest.confú/ÚDirNz/usr/share/software-properties/)Údeb822F)Úrootdir)Ú
popconfiler   Úapt_pkgÚconfigÚsetÚoptionsÚdatadirr   ÚsourceslistÚ
aptsourcesÚdistroÚ
get_distroÚseen_serverÚmodified_sourceslistÚreload_sourceslistÚbackup_sourceslistÚbackup_apt_confÚcustom_mirrorsÚqueueÚQueueÚmyqueuer
   Úapt_keyr   ÚCancellableÚcancellableÚatexitÚregisterÚwait_for_threads)Úselfr!   r    r   r   s        úG/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.pyÚ__init__zSoftwareProperties.__init__W   sî   € ð Ð<Ñ<€D„Oà€D„LØ�#‚~Ü‡n�n×Ñ˜ Ô(ð �$‚Ø1€gØ€D„LØ€D„Lä"¨&Ô1€DÔÜ×#Ñ#×.Ñ.Ó0€D„Kà€DÔØ %€DÔà×ÑÔØ×ÑÔà×ÑÔð €DÔô —;‘;“=€D„Lô  7Ô+€D„Lä—‘Ó(€DÔä
‡O�O�D×)Ñ)Õ*ó    c                 ó®   — t        j                  «       D ]>  }|j                  t        j                  «       j                  k7  sŒ/|j	                  «        Œ@ y)z9 wait for all running threads (PPA key fetchers) to exit N)Ú	threadingÚ	enumerateÚidentÚcurrent_threadÚjoin)r5   Úts     r6   r4   z#SoftwareProperties.wait_for_threads€   s>   € ä× Ñ Ó"ò ˆØ	
�‰”I×,Ñ,Ó.×4Ñ4Ó	4Ø	�‰�ñr8   c                 óÖ   — i | _         t        j                  j                  «       D ]A  }t        j
                  j                  t        j                  |   «      }|| j                   |<   ŒC y)z$Backup all apt configuration optionsN)Úapt_conf_backupÚsoftwarepropertiesÚCONF_MAPÚkeysr   r   Úfind_i)r5   ÚoptionÚvalues      r6   r*   z"SoftwareProperties.backup_apt_conf†   sX   € à€DÔÜ$×-Ñ-×2Ñ2Ó4ò -ˆÜ—‘×%Ñ%Ô&8×&AÑ&AÀ&Ñ&IÓJˆØ',ˆ×Ñ˜VÒ$ñ-r8   c                 óð   — | j                   j                  «       D ]I  }t        j                  j	                  t
        j                  |   t        | j                   |   «      «       ŒK | j                  «        y)z$Restore the stored apt configurationN)	rA   rD   r   r   r   rB   rC   ÚstrÚwrite_config)r5   rF   s     r6   Úrestore_apt_confz#SoftwareProperties.restore_apt_conf�   sa   € à×&Ñ&×+Ñ+Ó-ò >ˆÜ�‰×ÑÔ-×6Ñ6°vÑ>Ü˜t×3Ñ3°FÑ;Ó<õ	>ð>ð 	×ÑÕr8   c                 óö  — t         j                  j                  t        j                  d   «      dkD  �rOt         j                  j                  t        j                  d   «      dk(  r/t
        j                  j                  d«      rt        j                  S t         j                  j                  t        j                  d   «      dk(  rCt         j                  j                  t        j                  d   «      dk(  rt        j                  S t         j                  j                  t        j                  d   «      dk(  rCt         j                  j                  t        j                  d   «      dk(  rt        j                  S yt         j                  j                  t        j                  d   «      dk(  rCt         j                  j                  t        j                  d   «      dk(  rt        j                  S y)zÈ Parse the apt cron configuration. Try to fit a predefined use case
        and return it. Special case: if the user made a custom
        configurtation, that we cannot represent it will return None Ú
autoupdater   Ú
unattendedr	   z/usr/bin/unattended-upgradeÚautodownloadN)r   r   rE   rB   rC   ÚosÚpathÚexistsÚUPDATE_INST_SECÚUPDATE_DOWNLOADÚUPDATE_NOTIFYÚUPDATE_MANUAL©r5   s    r6   Úget_update_automation_levelz.SoftwareProperties.get_update_automation_level”   sg  € ô ‡~�~×ÑÔ/×8Ñ8¸ÑFÓGÈ!ÓKä�>‰>× Ñ Ô!3×!<Ñ!<¸\Ñ!JÓKÈqÒPÜ�w‰w�~‰~Ð;Ô<Ü%×5Ñ5Ð5Ü�^‰^×"Ñ"Ô#5×#>Ñ#>¸~Ñ#NÓOÐSTÒTÜ�^‰^×"Ñ"Ô#5×#>Ñ#>¸|Ñ#LÓMÐQRÒRÜ%×5Ñ5Ð5Ü�^‰^×"Ñ"Ô#5×#>Ñ#>¸|Ñ#LÓMÐQRÒRÜ�^‰^×"Ñ"Ô#5×#>Ñ#>¸~Ñ#NÓOÐSTÒTÜ%×3Ñ3Ð3àÜ	�‰×	Ñ	Ô1×:Ñ:¸<ÑHÓ	IÈQÒ	NÜ	�‰×	Ñ	Ô1×:Ñ:¸>ÑJÓ	KÈqÒ	PÜ!×/Ñ/Ð/àr8   c                 ó´  — |t         j                  k(  rvt        j                  j	                  t         j
                  d   t        d«      «       t        j                  j	                  t         j
                  d   t        d«      «       �n¿|t         j                  k(  rvt        j                  j	                  t         j
                  d   t        d«      «       t        j                  j	                  t         j
                  d   t        d«      «       �n6|t         j                  k(  rut        j                  j	                  t         j
                  d   t        d«      «       t        j                  j	                  t         j
                  d   t        d«      «       n®t        j                  j	                  t         j
                  d   t        d«      «       t        j                  j	                  t         j
                  d   t        d«      «       t        j                  j	                  t         j
                  d   t        d«      «       | j                  «        y)zð Set the apt periodic configurtation to the selected
        update automation level. To synchronize the cache update and the
        actual upgrading function, the upgrade function, e.g. unattended,
        will run every day, if enabled. rN   r	   rO   r   rM   N)
rB   rS   r   r   r   rC   rI   rT   rU   Úset_modified_config)r5   Ústates     r6   Úset_update_automation_levelz.SoftwareProperties.set_update_automation_level«   s�  € ð
 Ô"×2Ñ2Ò2Ü�‰×ÑÔ-×6Ñ6°|ÑDÄcÈ!ÃfÔMÜ�‰×ÑÔ-×6Ñ6°~ÑFÌÈAËÖOØ	Ô$×4Ñ4Ò	4Ü�‰×ÑÔ-×6Ñ6°~ÑFÌÈAËÔOÜ�‰×ÑÔ-×6Ñ6°|ÑDÄcÈ!ÃfÖMØ	Ô$×2Ñ2Ò	2Ü�‰×ÑÔ-×6Ñ6°~ÑFÌÈAËÔOÜ�‰×ÑÔ-×6Ñ6°|ÑDÄcÈ!ÃfÕMä�‰×ÑÔ-×6Ñ6°|ÑDÄcÈ!ÃfÔMÜ�‰×ÑÔ-×6Ñ6°|ÑDÄcÈ!ÃfÔMÜ�‰×ÑÔ-×6Ñ6°~ÑFÌÈAËÔOØ×ÑÕr8   c                 ó   — |t         j                  j                  t        j                  d   «      k(  sKt         j                  j                  t        j                  d   t        |«      «       | j                  «        yy)z8Set the interval in which we check for available updatesrM   N)r   r   rE   rB   rC   r   rI   rZ   )r5   Údayss     r6   Úset_update_intervalz&SoftwareProperties.set_update_interval¿   s]   € ð ”W—^‘^×*Ñ*Ô+=×+FÑ+FÀ|Ñ+TÓUÒUÜ
�.‰.×
Ñ
Ô/×8Ñ8¸ÑFÌÈDË	Ô
RØ
×
"Ñ
"Õ
$ð Vr8   c                 ób   — t         j                  j                  t        j                  d   «      S )z3 Returns the interval of the apt periodic cron job rM   )r   r   rE   rB   rC   rW   s    r6   Úget_update_intervalz&SoftwareProperties.get_update_intervalÆ   s#   € ä�>‰>× Ñ Ô!3×!<Ñ!<¸\Ñ!JÓKÐKr8   c                 óˆ  — t         j                  j                  | j                  «      s| j                  S t        «       }|j                  | j                  «       |j                  dd«      rK|j                  dd«      j                  «       }| j                  j                  «       D ]  \  }}||k(  sŒ|c S  | j                  S )z�
    return the release upgrade policy:
     RELEASE_UPGRADES_NORMAL,
     RELEASE_UPGRADES_LTS,
     RELEASE_UPGRADES_NEVER
    ÚDEFAULTÚPrompt)rP   rQ   rR   ÚRELEASE_UPGRADES_CONFÚRELEASE_UPGRADES_NORMALr   ÚreadÚ
has_optionÚgetÚlowerÚrelease_upgrades_policy_mapÚitems)r5   ÚparserÚtypeÚkÚvs        r6   Úget_release_upgrades_policyz.SoftwareProperties.get_release_upgrades_policyÊ   s¤   € ô �7‰7�>‰>˜$×4Ñ4Ô5Ø×)Ñ)Ð)Ü‹^€FØ
‡K�K�×*Ñ*Ô+Ø×Ñ˜ 8Ô,Ø�Z‰Z˜	 (Ó+×1Ñ1Ó3€dØ×2Ñ2×8Ñ8Ó:ò ‰$ˆ!ˆQØ�‹9ØŠ(ðð ×'Ñ'Ð'r8   c                 ó(  — t         j                  j                  | j                  «      sAt	        | j                  d«      5 }|j                  d| j                  |   z  «       ddd«       yt	        | j                  d«      5 }t        d¬«      5 }|D ]g  }|j                  «       }|j                  «       j                  d«      r"|j                  d	| j                  |   z  «       ŒT|j                  |d
z   «       Œi |j                  «        t        j                  | j                  |j                  «       t        j                  |j                  | j                  «       ddd«       ddd«       y# 1 sw Y   yxY w# 1 sw Y   ŒxY w# 1 sw Y   yxY w)z
    set the release upgrade policy:
     RELEASE_UPGRADES_NORMAL,
     RELEASE_UPGRADES_LTS,
     RELEASE_UPGRADES_NEVER
     Úwz[DEFAULT]
Prompt=%s
NTÚrzw+)ÚmodeÚpromptz
Prompt=%s
ú
)rP   rQ   rR   re   ÚopenÚwriterk   r   Ústriprj   Ú
startswithÚflushÚshutilÚcopymodeÚnameÚcopy)r5   ÚiÚfÚoutÚlines        r6   Úset_release_upgrades_policyz.SoftwareProperties.set_release_upgrades_policyÝ   sC  € ô �7‰7�>‰>˜$×4Ñ4Ô5Ü�×*Ñ*¨3Ó/ð O°1Ø	�‰Ð(¨$×*JÑ*JÈ1Ñ*MÑMÔN÷OàÜ	ˆd×(Ñ(¨Ó	-ð 	8°Ô4FÈDÔ4Qð 	8ÐUXØò ˆ$Ø�z‰z‹|ˆØ�:‰:‹<×"Ñ" 8Ô,Ø
�)‰)�M D×$DÑ$DÀQÑ$GÑGÕ
Hà
�)‰)�D˜‘IÕ
ðð 
‡i�i„kÜ‡o�o�d×0Ñ0°#·(±(Ô;Ü‡k�k�#—(‘(˜D×6Ñ6Ô7÷	8÷ 	8ð ÷Oàú÷	8ð 	8ú÷ 	8ð ús1   Á "E0ÂFÂCE<ÅFÅ0E9Å<F	ÆFÆFc                 ó�  — t         j                  j                  | j                  «      r‚t	        | j                  «      5 }|j                  «       j                  d«      }ddd«       D ]@  }	 |j                  d«      \  }}|dk(  r$|j                  d«      j                  «       dk(  r yŒB y# 1 sw Y   ŒOxY w# t        $ r Y Œ[w xY w)	z» Will return True if the user wants to participate in the popularity
        contest. Otherwise it will return False. Special case: if no
        popcon is installed it will return False rw   Nú=ÚPARTICIPATEú"ÚyesTF)
rP   rQ   rR   r   rx   rg   Úsplitrz   rj   Ú
ValueError)r5   r‚   Úlinesr„   ÚkeyrG   s         r6   Úget_popcon_participationz+SoftwareProperties.get_popcon_participationõ   s±   € ô 
‡w�w‡~�~�d—o‘oÔ&Ü�$—/‘/Ó"ð 	' aØ—&‘&“(—.‘. Ó&ˆ%÷	'àò 	ˆDðØ"Ÿj™j¨›o‘��UØ˜-Ò'¨E¯K©K¸Ó,<×,BÑ,BÓ,DÈÒ,MÙøð		ð ÷	'ð 	'ûô ò Ùðús   ¿ B-Á-;B9Â-B6Â9	CÃCc           	      óÐ  — |dk(  rd}nd}t         j                  j                  | j                  «      rGt	        | j                  d«      5 }|D �cg c]  }t        j                  dd|z  |«      ‘Œ }}ddd«       n“t        «       }t	        dd	«      5 }|j                  |j                  d
«      «       ddd«       |j                  «       }g }|j                  d|z  «       |j                  dt        |«      z  «       |j                  d«       t	        | j                  d«      5 }|j                  «       ddd«       yc c}w # 1 sw Y   Œ?xY w# 1 sw Y   ŒŸxY w# 1 sw Y   yxY w)z? Enable or disable the participation in the popularity contest TrŠ   Únort   z^(PARTICIPATE=)(".+?")z\1"%s"Nz/dev/urandomÚrbi   zMY_HOSTID="%s"
zPARTICIPATE="%s"
zUSE_HTTP="yes"
rs   )rP   rQ   rR   r   rx   ÚreÚsubr   Úupdaterg   Ú	hexdigestÚappendrI   Ú
writelines)	r5   Ú
is_helpfulrG   r   r„   r�   Úmr‚   Úids	            r6   Úset_popcon_pariticipationz,SoftwareProperties.set_popcon_pariticipation  sB  € à�TÒØ‰àˆÜ	‡w�w‡~�~�d—o‘oÔ&ô �$—/‘/ 3Ó'ð 	-¨:à!+ö-Øô —V‘VÐ5°yÀ5Ñ7HÈ$ÕOð -ˆEð -÷	-ð 	-ô
 ‹EˆÜ�. $Ó'ð 	#¨1Ø�H‰H�Q—V‘V˜D“\Ô"÷	#à�[‰[‹]ˆØˆØ�‰Ð)¨BÑ.Ô/Ø�‰Ð+¬c°%«jÑ8Ô9Ø�‰Ð)Ô*Ü	ˆd�o‰o˜sÓ	#ð  qØ	�‰�UÔ÷ð ùò-÷	-ð 	-ú÷	#ð 	#ú÷ð ús6   Á
EÁ!D?Á0EÂ!EÄ$EÄ?EÅEÅEÅE%c                 ó  — t        | j                  j                  «      dk  rd| j                  _        yd| j                  _        i }g }|j	                  | j                  j
                  «       |j	                  | j                  j                  «       |D ]b  }|j                  |v r0|j                  D ]   }||j                     j                  |«       Œ" ŒAt        |j                  «      ||j                  <   Œd t        | j                  j                  «      dkD  r-| j                  j                  || j                  j                  <   | j                  j                  D ]¥  }|j                  |vsƒ|j                  |v sŒ t        t        ||j                     «      t        |j                  «      z  «      dk(  rŒ[t        t        |j                  «      | j                  j                  z  «      dk(  rŒ”d| j                  _         y y)z±Return True if all distro componets are also available as
       source code. Otherwise return Flase. Special case: If the
       configuration cannot be represented return Noner	   FTr   N)Úlenr$   Úsource_code_sourcesÚget_source_codeÚextendÚmain_sourcesÚchild_sourcesÚtemplateÚcompsÚaddr   Úcdrom_sourcesÚcdrom_compsÚsource_templateÚenabled_comps)r5   Ú	templatesÚsourcesÚsourceÚcomps        r6   Úget_source_code_statez(SoftwareProperties.get_source_code_state  sš  € ô
 ˆ4�;‰;×*Ñ*Ó+¨aÒ/ð ',ˆ�‰Ô#Øð '+ˆ�‰Ô#ð ˆ	ØˆØ�‰�t—{‘{×/Ñ/Ô0Ø�‰�t—{‘{×0Ñ0Ô1Øò 	?ˆFØ�‰ )Ñ+Ø"ŸL™Lò 9�DØ˜fŸo™oÑ.×2Ñ2°4Õ8ñ9ô .1°·±Ó->�	˜&Ÿ/™/Ò*ð	?ô ˆt�{‰{×(Ñ(Ó)¨AÒ-Ø59·[±[×5LÑ5LˆI�d—k‘k×1Ñ1Ñ2Ø—k‘k×5Ñ5ò 	ˆFØ�‰ iÑ/Ø—‘ 9Ò,Ü”S˜ 6§?¡?Ñ3Ó4´s¸6¿<¹<Ó7HÑHÓIÈQÓNÜœ˜VŸ\™\Ó*¨T¯[©[×-FÑ-FÑFÓGÈ1ÓLØ.3�—‘Ô+Ùð	ð r8   c                 óf  — d|j                   fd|j                  fd|j                   fd|j                   ffD ]  \  }}t	        d|›d|›�«       Œ |j
                  rId|j
                  j                  fd|j
                  j                  ffD ]  \  }}t	        d|›d|›�«       Œ t	        d«       y	)
z4Print the data of a source entry to the command linezURI:zComps:zEnabled:zValid:ú z	MatchURI:zBaseURI:rw   N)Úurir¥   ÚdisabledÚinvalidÚprintr¤   Ú	match_uriÚbase_uri)r5   r­   ÚlabelrG   s       r6   Úprint_source_entryz%SoftwareProperties.print_source_entryE  sµ   € à" F§J¡JÐ/Ø$ f§l¡lÐ3Ø&¨F¯O©OÐ(;Ð<Ø$¨&¯.©.Ð&8Ð9ð;ò )‰ˆ�õ 	š%¡Ð'Õ(ð	)ð
 ‡‚Ø +¨V¯_©_×-FÑ-FÐGØ *¨F¯O©O×,DÑ,DÐEðGò 	-‰NˆU�Eåše¡UÐ+Õ,ð	-ô 
ˆ$…Kr8   c                 ó„   — t        d«       | j                  D ]  }t        |j                  «       «       Œ t        d«       y)zPrint the complete sources.listzSTART SOURCES.LIST:zEND SOURCES.LIST
N)rµ   r"   rI   ©r5   r­   s     r6   Úmassive_debug_outputz'SoftwareProperties.massive_debug_outputR  s7   € ä	Ð
Ô Ø×"Ñ"ò ˆÜˆf�j‰j‹lÕðä	Ð
Õr8   c                 ó~   — || j                   _        | j                   j                  |«      }| j                  «        |S )z! change the main download server )r$   Údefault_serverÚchange_serverÚset_modified_sourceslist)r5   ÚserverÚress      r6   Úchange_main_download_serverz.SoftwareProperties.change_main_download_serverY  s3   € à!'€D‡K�KÔØ
�+‰+×
#Ñ
# FÓ
+€CØ×!Ñ!Ô#Ø€Jr8   c                 óZ   — | j                   j                  |«       | j                  «        y)z Enable a component of the distroN)r$   Úenable_componentrÀ   ©r5   r®   s     r6   rÅ   z#SoftwareProperties.enable_component`  s    € à‡K�K× Ñ  Ô&Ø×!Ñ!Õ#r8   c                 óZ   — | j                   j                  |«       | j                  «        y)z!Disable a component of the distroN)r$   Údisable_componentrÀ   rÆ   s     r6   rÈ   z$SoftwareProperties.disable_componente  s    € à‡K�K×!Ñ! $Ô'Ø×!Ñ!Õ#r8   c                 ót   — | j                   j                  j                  D ]  }|j                  |k(  sŒ|c S  y ©N)r$   r©   Úchildrenr   )r5   r   r¤   s      r6   Ú_find_template_from_stringz-SoftwareProperties._find_template_from_stringj  s2   € Ø—K‘K×/Ñ/×8Ñ8ò ˆØ	�‰˜$Ó	ØŠñr8   c                 ó~  — t        |t        «      r| j                  |«      }| j                  j                  D ]-  }|j
                  |k(  sŒ| j                  j                  |«       Œ/ | j                  j                  D ]-  }|j
                  |k(  sŒ| j                  j                  |«       Œ/ | j                  «        y)ú7Enable a child repo of the distribution main repositoryN)
Ú
isinstancerI   rÌ   r$   r£   r¤   r"   ÚremoverŸ   rÀ   )r5   r¤   r­   s      r6   Údisable_child_sourcez'SoftwareProperties.disable_child_sourceo  sž   € ä�(œCÔ Ø×0Ñ0°Ó:€hà—+‘+×+Ñ+ò ,ˆØ�?‰?˜hÓ&Ø×Ñ×#Ñ# FÕ+ð,ð —+‘+×1Ñ1ò ,ˆØ�?‰?˜hÓ&Ø×Ñ×#Ñ# FÕ+ð,ð 	×!Ñ!Õ#r8   c                 ó  — t        |t        «      r| j                  |«      }|j                  dk(  r| j                  j
                  }n|j                  }| j                  j                  ||j                  ¬«       | j                  «        y)rÎ   N)r²   Údist)	rÏ   rI   rÌ   r·   r$   r¾   Ú
add_sourcer   rÀ   )r5   r¤   Ú	child_uris      r6   Úenable_child_sourcez&SoftwareProperties.enable_child_source|  sm   € ä�(œCÔ Ø×0Ñ0°Ó:€hð ×Ñ˜DÒ Ø—K‘K×.Ñ.‰	à×%Ñ%ˆ	Ø‡K�K×Ñ˜y¨x¯}©}ÐÔ=Ø×!Ñ!Õ#r8   c                 ó(  — g }|j                  | j                  j                  «       |j                  | j                  j                  «       | j                  j                  D ]  }| j
                  j                  |«       Œ | j                  «        y)z%Remove all distro source code sourcesN)r¡   r$   r¢   r£   rŸ   r"   rÐ   rÀ   ©r5   r¬   r­   s      r6   Údisable_source_code_sourcesz.SoftwareProperties.disable_source_code_sourcesŠ  sl   € à€GØ‡N�N�4—;‘;×+Ñ+Ô,Ø‡N�N�4—;‘;×,Ñ,Ô-à—+‘+×1Ñ1ò (ˆØ×Ñ×Ñ Õ'ð(à×!Ñ!Õ#r8   c                 óX  — g }|j                  | j                  j                  «       |j                  | j                  j                  «       | j                  j                  D ]  }| j
                  j                  |«       Œ |D ]i  }| j
                  j                  d|j                  |j                  |j                  d| j
                  j                  |«      dz   |j                  |¬«       Œk | j                  j                  D ]‘  }| j
                  j                  d| j                  j                  j                  | j                  j                  j                   |j                  d| j
                  j                  |«      dz   |j                  |¬«       Œ“ | j#                  «        y)z0Enable source code source for all distro sourcesúdeb-srczAdded by software-propertiesr	   )ÚparentN)r¡   r$   r¢   r£   rŸ   r"   rÐ   r¦   r²   rÓ   r¥   ÚindexÚfiler§   r©   r·   r   rÀ   rØ   s      r6   Úenable_source_code_sourcesz-SoftwareProperties.enable_source_code_sources”  s`  € à€GØ‡N�N�4—;‘;×+Ñ+Ô,Ø‡N�N�4—;‘;×,Ñ,Ô-ð —+‘+×1Ñ1ò (ˆØ×Ñ×Ñ Õ'ð(ð ò ,ˆØ×Ñ×Ñ˜YØ#ŸZ™ZØ#Ÿ[™[Ø#Ÿ\™\Ø;Ø!×-Ñ-×3Ñ3°FÓ;¸AÑ=Ø#Ÿ[™[Ø$*ð 	õ 	,ð,ð —+‘+×+Ñ+ò ,ˆØ×Ñ×Ñ˜YØ!Ÿ[™[×8Ñ8×AÑAØ!Ÿ[™[×8Ñ8×=Ñ=Ø#Ÿ\™\Ø;Ø!×-Ñ-×3Ñ3°FÓ;¸AÑ=Ø#Ÿ[™[Ø$*ð 	õ 	,ð,ð 	×!Ñ!Õ#r8   c                 ób  — g | _         | j                  j                  D ]�  }t        |t        «      r"t	        |j
                  |j                  ¬«      }n@t        |t        «      r"t        |j
                  |j                  ¬«      }nt        d|› �«      ‚| j                   j                  |«       Œ‘ y)z+Store a backup of the source.list in memory©r„   rÞ   ©ÚsectionrÞ   úUnknown source: N)
Úsourceslist_backupr"   ÚlistrÏ   r   r„   rÞ   r   Ú	TypeErrorr—   )r5   r­   Ú
source_bkps      r6   r)   z%SoftwareProperties.backup_sourceslist²  s‰   € à €DÔØ×"Ñ"×'Ñ'ò 3ˆÜ�fœkÔ*Ü$¨&¯+©+¸6¿;¹;ÔG‰JÜ˜Ô 1Ô2Ü*°6·;±;ÀVÇ[Á[ÔQ‰JäÐ.¨v¨hÐ7Ó8Ð8Ø×Ñ×&Ñ& zÕ2ñ3r8   c                 ó~   — | j                  «        | j                  j                  D ]  }t        |«      |k(  sŒ|c S  y rÊ   )r(   r"   ræ   rI   )r5   r„   r­   s      r6   Ú_find_source_from_stringz+SoftwareProperties._find_source_from_string¾  sA   € ð 	×ÑÔà×"Ñ"×'Ñ'ò ˆÜ	ˆV‹˜Ó	ØŠðð r8   c                 óŠ   — t        |t        «      r| j                  |«      }|j                   |_        | j	                  «        y)z&Enable or disable the selected channelN)rÏ   rI   rê   r³   rÀ   r»   s     r6   Útoggle_source_usez$SoftwareProperties.toggle_source_useÈ  s8   € ô �&œ#ÔØ×,Ñ,¨VÓ4€fØ Ÿ/™/Ð)€F„OØ×!Ñ!Õ#r8   c                 ó†  — t        | j                  j                  «      D ]Ÿ  \  }}t        |«      |k(  sŒ| j                  j                  |   j                  }t        |t        «      r$t        ||«      | j                  j                  |<   n#t        ||«      | j                  j                  |<   | j                  «         y y)NTF)	r;   r"   ræ   rI   rÞ   rÏ   r   r   rÀ   )r5   Ú	old_entryÚ	new_entryrÝ   ÚentryrÞ   s         r6   Úreplace_source_entryz'SoftwareProperties.replace_source_entryÐ  s§   € ä# D×$4Ñ$4×$9Ñ$9Ó:ò ‰ˆ�Ü	ˆU‹�yÓ	 Ø×Ñ×$Ñ$ UÑ+×0Ñ0ˆÜ�eÔ.Ô/Ü+<¸YÈÓ+MˆD×Ñ×!Ñ! %Ò(ä+6°yÀ$Ó+GˆD×Ñ×!Ñ! %Ñ(Ø×%Ñ%Ô'Ùðð r8   c                 óD   — | j                  «        | j                  «        y)zMRevert all settings to the state when software-properties
       was launchedN)rK   Úrevert_sourceslistrW   s    r6   ÚrevertzSoftwareProperties.revertÝ  s   € ð 	×ÑÔØ×ÑÕr8   c                 ó¶  — g | j                   _        | j                  D ]™  }t        |t        «      r"t	        |j
                  |j                  ¬«      }n@t        |t        «      r"t        |j
                  |j                  ¬«      }nt        d|› �«      ‚| j                   j                  j                  |«       Œ› | j                  «        | j                  «        y)z6Restore the source list from the startup of the dialográ   râ   rä   N)r"   ræ   rå   rÏ   r   r„   rÞ   r   rç   r—   Úsave_sourceslistr(   )r5   r­   Úsource_resets      r6   ró   z%SoftwareProperties.revert_sourceslistä  s©   € à€D×ÑÔØ×)Ñ)ò 3ˆÜ�fœkÔ*Ü&¨F¯K©K¸V¿[¹[ÔI‰LÜ˜Ô 1Ô2Ü,°V·[±[ÀvÇ{Á{ÔS‰LäÐ.¨v¨hÐ7Ó8Ð8Ø×Ñ×Ñ×$Ñ$ \Õ2ð3ð 	×ÑÔØ×ÑÕr8   c                 ó¶   — d| _         | j                  r&| j                  j                  r| j                  «        | j	                  «        | j                  «        y)zCThe sources list was changed and now needs to be saved and reloadedTN)r'   r    Úmassive_debugr¼   rö   r(   rW   s    r6   rÀ   z+SoftwareProperties.set_modified_sourceslistò  sA   € à $€DÔØ‡|‚|˜Ÿ™×2Ò2Ø×!Ñ!Ô#Ø×ÑÔØ×ÑÕr8   c                 ó$   — | j                  «        y)z+Write the changed apt configuration to fileN)rJ   rW   s    r6   rZ   z&SoftwareProperties.set_modified_configú  s   € à×ÑÕr8   c                 ó@  — |j                   dk(  �r,|j                  rÉt        |j                  «      dkD  r0|j                  j                  dd«      j	                  «       dd dz   nd}dt        |«      ›d|j                  ›�}t        |j                  «      d	kD  r|j                  D ]
  }|d
|z  z  }Œ |j                  dv r|d
t        d«      z  z  }|d|j                  z  z  }|S d|j                  ›d|j                  ›d�}|j                  D ]
  }|d
|z  z  }Œ |j                  dv r|d
t        d«      z  z  }|S d|j                   j                  z  }|j                  dv r|dt        d«      z  z  }|j                  r|d
|j                  z  z  }|j                   j                  dk(  rr|j                  D ]c  }|j                   j                  |«      r>|j                   j                  D ]$  }|j                  |k(  sŒ|d|j                  z  z  }Œ& Œ\|d|z  z  }Œe |S )z5Render a nice output to show the source in a treeviewNéP   rw   r±   u   [â€¦]Ú z<b>z</b> r	   z %s)rÛ   zrpm-srcz(Source Code)z
%sz</b>z	<b>%s</b>z (%s)zSource CodeF)r¤   Úcommentrž   Úreplacerz   r   rÓ   r¥   rn   Ú_r²   ÚdescriptionÚchildÚhas_componentÚ
componentsr   )r5   r­   rþ   ÚcontentsÚcr®   s         r6   Úrender_sourcez SoftwareProperties.render_sourceþ  s  € à‡�˜$ÓØ�>Š>ô ! §¡Ó0°2Ò5ð —‘×&Ñ& t¨SÓ1×7Ñ7Ó9¸#¸2Ð>ØòØ;=ñ ô *0°­¸&¿+º+ÐFˆHä�6—<‘<Ó  1Ò$ØŸ™ò *�AØ ¨¡	Ñ)‘Hð*à�{‰{Ð4Ñ4Ø˜E¤A oÓ$6Ñ6Ñ6�Ø˜ §¡Ñ+Ñ+ˆHð ˆð' ð *0¯«°V·[³[ÐAˆHØ—\‘\ò &�Ø˜E A™IÑ%‘ð&à�{‰{Ð4Ñ4Ø˜E¤A oÓ$6Ñ6Ñ6�Øˆð  §¡×!<Ñ!<Ñ<ˆØ�;‰;Ð0Ñ0Ø˜¤! MÓ"2Ñ2Ñ2ˆHØ�>Š>Ø�u˜vŸ~™~Ñ-Ñ-ˆHØ�?‰?× Ñ  EÒ)ØŸ™ò .�Ø—?‘?×0Ñ0°Ô6ð $Ÿ_™_×7Ñ7ò ?˜ØŸ6™6 T›>Ø$¨°·±Ñ(>Ñ>™Hñ?ð  ¨¡Ñ-‘Hð.ð ˆr8   c                 ó�  — d}d}d}d}t        dd«      }|j                  r>d}|j                  j                  }|j                  j                  | j                  k(  r9d}n6|j
                  ›d|j                  ›d|j                  ›�}|j                  rd}|j                  j                  d«      rd}|||||j                  |«      fS )z&extract attributes to sort the sourcesr	   Ú
0123456789Ú
9876543210r   r±   Úsrc)r   r¤   r  Údistributionr$   r²   rÓ   r¥   rþ   rn   ÚfindÚ	translate)r5   r­   Úcur_sysÚhas_templateÚhas_commentÚ	is_sourceÚrevert_numbersÚdescs           r6   Úget_comparablez!SoftwareProperties.get_comparable(  s²   € à€gØ€lØ€kØ€iÜ  ¨|Ó<€nØ	�ŠØˆØ�‰×*Ñ*ˆØ�?‰?×'Ñ'¨4¯;©;Ò6Ø‰Gà%Ÿz›z¨6¯;«;¸¿ºÐEˆ$Ø�^Š^ØˆkØ	�‰×	Ñ	˜%Ô	 Øˆ)Ø�| [°)Ø�n‰n˜^Ó,ð.ð .r8   c                 óv  — g }| j                   j                  D ]�  }|j                  rŒ|| j                  j                  vsŒ)|| j                  j
                  vsŒB|| j                  j                  vsŒ[|| j                  j                  vsŒt|| j                  j                  vsŒ�|j                  |«       ŒŸ |S )z>Return a list of sources that are not part of the distribution)
r"   ræ   r´   r$   r¢   r§   r£   Údisabled_sourcesrŸ   r—   )r5   Úisv_sourcesr­   s      r6   Úget_isv_sourcesz"SoftwareProperties.get_isv_sources=  s™   € à€KØ×"Ñ"×'Ñ'ò 'ˆØ�~‹~Ø˜$Ÿ+™+×2Ñ2Ò2Ø˜$Ÿ+™+×3Ñ3Ò3Ø˜$Ÿ+™+×3Ñ3Ò3Ø˜$Ÿ+™+×6Ñ6Ò6Ø˜Ÿ™×8Ñ8Ò8Ø×Ñ˜vÕ&ð'ð Ðr8   c                 ó.   — | j                   j                  S )z-Return the list of CDROM based distro sources)r$   r§   rW   s    r6   Úget_cdrom_sourcesz$SoftwareProperties.get_cdrom_sourcesJ  s   € à�;‰;×$Ñ$Ð$r8   c                 óJ   — |j                   | j                  j                  v dfS )z®Return a tuple: the first value describes if a component is enabled
       in the Internet repositories. The second value describes if the
       first value is inconsistent.F)r   r$   Údownload_compsrÆ   s     r6   Úget_comp_download_statez*SoftwareProperties.get_comp_download_stateN  s"   € ð
 �I‰I˜Ÿ™×3Ñ3Ð3°UÐ;Ð;r8   c                 óˆ  — g }| j                   j                  D ]-  }|j                  |k(  sŒ|j                  |j                  «       Œ/ t        |«      dkD  r/t        | j                   j                  t        |«      z  «      dk(  ryt        |«      dkD  r/t        | j                   j                  t        |«      z  «      dk7  ryy)zËReturn a tuple: the first value describes if a component is enabled
       in one of the child source that matcth the given template.
       The second value describes if the first value is inconsistent.r   )TF)FT)FF)r$   r£   r¤   r¡   r¥   rž   rª   r   )r5   r¤   r¥   r  s       r6   Úget_comp_child_statez'SoftwareProperties.get_comp_child_stateU  s£   € ð €EØ—‘×*Ñ*ò &ˆØ�>‰>˜XÓ%Ø�L‰L˜Ÿ™Õ%ð&ô ˆ5ƒz�A‚~ÜˆD�K‰K×%Ñ%¬¨E«
Ñ2Ó3°qÒ8àÜ	ˆU‹�aŠÜˆD�K‰K×%Ñ%¬¨E«
Ñ2Ó3°qÒ8ð ð r8   c                 ó�   — | j                   j                  «        g | _        | j                  j	                  | j                   «       y rÊ   )r"   ÚrefreshÚsourceslist_visibler$   Úget_sourcesrW   s    r6   r(   z%SoftwareProperties.reload_sourceslistj  s4   € Ø×Ñ×ÑÔØ€DÔØ‡K�K×Ñ˜D×,Ñ,Õ-r8   c                 ó0  — | j                   dz   | j                   dz   | j                   dz   g}|D ]#  }t        j                  j                  |«      sŒ# n˜ t	        d«       t        j                  j                  «      }t        j                  j                  |«      s%t        j                  |«      j                  d¬«       t        |d   d«      5 }|j                  d	«       d
d
d
«       d}t        j                  j                  |«      r]t        j                  |«      t        j                     }|t        j                  z  s$t	        d|z  «       t        j                  |d«       |D �]  }g }t        j                  j                  |«      sŒ&t        |d«      5 }|j!                  «       }d
d
d
«       t"        j$                  j'                  d«      }t        |d«      5 }|D ]A  }	|j)                  «       D ]  }
|	j+                  d|
z  «      dk\  sŒ Œ0 |j                  |	«       ŒC |j)                  «       D ])  }|j                  d|›d|j-                  |«      ›d�«       Œ+ 	 d
d
d
«       �Œ y
# 1 sw Y   �Œ�xY w# 1 sw Y   ŒÑxY w# 1 sw Y   �Œ)xY w)z+Write the current apt configuration to filez/etc/apt/apt.conf.d/10periodicz#/etc/apt/apt.conf.d/20auto-upgradesz+/etc/apt/apt.conf.d/15adept-periodic-updatezNo config found, creating oneT)Úparentsr   rs   rý   Nz/etc/cron.daily/aptz file '%s' not executable, fixingií  rt   zAPT::PeriodiczAPT::Periodic::%szAPT::Periodic::z "z";
)r   rP   rQ   Úisfilerµ   ÚdirnamerR   ÚpathlibÚPathÚmkdirrx   ry   ÚstatÚST_MODEÚS_IXUSRÚchmodÚ	readlinesr   r   Úsubtreeræ   r  rE   )r5   Ú	conffilesr‚   r(  ÚacÚpermÚperiodicÚcontentÚcnfr„   rŽ   r�   s               r6   rJ   zSoftwareProperties.write_configo  s5  € ð —‘Ð>Ñ>Ø—‘ÐCÑCØ—‘ÐKÑKðM€Ið
 ò 	ˆÜ	�‰�‰˜Õ	Ùð	ô Ð+Ô,Ü—‘—‘ Ó"€gÜ�W‰W�^‰^˜GÔ$Ü�‰�WÓ×#Ñ#¨DÐ#Ô1Ü�	˜!‘˜cÓ"ð  aØ	�‰�Œ÷ð 
€BÜ	‡w�w‡~�~�bÔÜ�W‰W�R‹[œŸ™Ñ&€dØ”T—\‘\Ò!ÜÐ0°2Ñ5Ô6Ü
�‰��UÔð ó Hˆà€gÜ	�‰�‰˜Õ	!Ü�(˜CÓ ð 	" AØ—K‘K“Mˆ'÷	"ä�n‰n×$Ñ$ _Ó5ˆô �(˜CÓ ð 
	H AØò ˆdØ—x‘x“zò �Ø—‘Ð.°#Ñ6Ó7¸1Ó<Ùðð �g‰g�d�mðð —8‘8“:ò HˆaØ�GŠG²Q¸¿
¹
À1½ÐFÕGñH÷
	Hñ 
	HñH÷ñ ú÷ 	"ð 	"ú÷

	Hñ 
	Hús+   ÃI2ÆI?Ç"0JÈAJÉ2I<É?J	ÊJ	c                 ón   — | j                   j                  d«       | j                   j                  «        y)zQBackup the existing sources.list files and write the current
       configurationz.saveN)r"   ÚbackupÚsaverW   s    r6   rö   z#SoftwareProperties.save_sourceslist   s*   € ð 	×Ñ×Ñ˜GÔ$Ø×Ñ×ÑÕr8   c                 óþ  — t        |«      }t        j                  j                  | j                  «      r½t        j
                  d| j                  z  «      D ]˜  }t        |«      5 }|D ]|  }|j                  «       j                  d«      rŒ#|t        |«      k(  sŒ2t        j                  j                  t        j                  j                  |«      «      d   c cddd«       c S  	 ddd«       Œš y# 1 sw Y   Œ¥xY w)zs
    helper that checks if a given line is in the source list
    return the channel name or None if not found
    z	%s/*.listú#r   N)r   rP   rQ   rR   ÚCHANNEL_PATHÚglobrx   rz   r{   ÚsplitextÚbasename)r5   ÚsrclineÚsrcentryÚfilenamer‚   r„   s         r6   Ú_get_channel_from_linez)SoftwareProperties._get_channel_from_line¦  sà   € ô
 ˜7Ó#€HÜ	‡w�w‡~�~�d×'Ñ'Ô(Ü—i‘i ¨d×.?Ñ.?Ñ ?Ó@ò Eˆ(Ü�(‹^ð 	E˜qØò EˆdØ�z‰z‹|×&Ñ& sÔ+ØØœ; tÓ,Ó,Ü—W‘W×%Ñ%¤b§g¡g×&6Ñ&6°xÓ&@ÓAÀ!ÑDÑD÷	Eó 	EñE÷	Eð 	EðEð ÷	Eð 	Eús   Á%4C3ÂA C3Ã&C3Ã3C<	c                 ó¦   — |j                  «       j                  }| j                  |«      }|r$| j                  ›d|›d�}| j	                  |«       yy)zƒ
    helper that adds the gpg key of the channel to the apt
    keyring *if* the channel is in /usr/share/app-install/channels
    r   z.keyTF)r   r„   rD  r=  Úadd_key)r5   ÚshortcutrA  ÚchannelÚkeyps        r6   Ú&check_and_add_key_for_channel_shortcutz9SoftwareProperties.check_and_add_key_for_channel_shortcut¶  sM   € ð
 ×"Ñ"Ó$×)Ñ)€GØ×)Ñ)¨'Ó2€GÙØ ×-Ó-ªwÐ7€dØ
‡l�l�4ÔØØr8   c                  ó   — y)z) abstract interface to keep the UI alive N© rW   s    r6   Úupdate_interfacez#SoftwareProperties.update_interfaceÃ  s   � r8   c                 óÞ   — |j                  d«      s|S |j                  «       d   }	 |j                  dd«      d   }d|›d| j                  j                  ›d|›�}|S # t        $ r d}Y Œ.w xY w)zÍ
    short cut - this:
      apt-add-repository http://packages.medibuntu.org free non-free
    same as
      apt-add-repository 'deb http://packages.medibuntu.org/ '$(lsb_release -cs)' free non-free'
    Úhttpr   r±   r	   Úmainzdeb )r{   r‹   Ú
IndexErrorr$   Úcodename)r5   r„   ÚrepoÚareass       r6   Úexpand_http_linez#SoftwareProperties.expand_http_lineÆ  sr   € ð �?‰?˜6Ô"Ø€kØ�:‰:‹<˜‰?€DðØ—
‘
˜3˜qÓ! !Ñ$ˆøò # D§K¡K×$8Ó$8¹%ÐA€DØ€Køô ò ØŠðús   ¨A ÁA,Á+A,c                 óx   — 	 t        |j                  «       «      }| j                  ||«      S # t        $ r Y yw xY w)z*
    Add a source for the given line.
    F)r   rz   r   Úadd_source_from_shortcut)r5   r„   Úenable_source_coderG  s       r6   Úadd_source_from_linez'SoftwareProperties.add_source_from_line×  sA   € ðÜ# D§J¡J£LÓ1ˆð ×(Ñ(¨Ð3EÓFÐFøô $ò Ùðús   ‚- ­	9¸9c           	      ó‚  — |j                  «       j                  }|j                  }| j                  |«      }|rdnd}||dd z   }t        ||«      }t        ||«      }|j                  s|j                  ry| j                  |«      s|j                  «        | j                  j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  ¬«       | j                  j                  ||j                  |j                  |j                  |j                  |j                  |j                  ¬«       | j!                  «        | j"                  rF| j"                  j$                  r0ddl}	|	j)                  «       }
|
j%                  |j                  ¬«       y	)
zŽ
    Add a source with the given shortcut and add the signing key if the
    site is a known channel or the shortcut implementer adds it.
    rÛ   z	# deb-srcr   NF)rþ   rÞ   Úarchitecturesr   )Úsources_listT)r   r„   Úsourceparts_filerU  r´   rJ  rF  r"   r¦   rn   r²   rÓ   r¥   rþ   rÞ   r[  rÀ   r    r•   ÚaptÚCache)r5   rG  rX  Údeb_linerÞ   Údebsrc_entry_typeÚdebsrc_lineÚnew_deb_entryÚnew_debsrc_entryr^  Úcaches              r6   rW  z+SoftwareProperties.add_source_from_shortcutâ  s‰  € ð ×#Ñ#Ó%×*Ñ*€HØ×$Ñ$€DØ×$Ñ$ XÓ.€HÙ%7™	¸[ÐØ# h¨q¨r lÑ2€KÜ ¨$Ó/€MÜ" ;°Ó5ÐØ×ÒÐ 0× 8Ò 8ØØ×6Ñ6°xÔ@Ø×ÑÔØ×Ñ×Ñ˜×+Ñ+Ø&×*Ñ*Ø&×+Ñ+Ø&×,Ñ,Ø!.×!6Ñ!6Ø+×0Ñ0Ø'4×'BÑ'Bð ô Dð 	×Ñ×ÑÐ*Ø)×-Ñ-Ø)×.Ñ.Ø)×/Ñ/Ø!1×!9Ñ!9Ø.×3Ñ3Ø'7×'EÑ'Eð ô Gð 	×!Ñ!Ô#Ø‡|‚|˜Ÿ™×+Ò+ÛØ—	‘	“ˆØ�‰Ð"2×"7Ñ"7ˆÔ8Ør8   c                 ól  — |r—t        |t        «      r$| j                  |«      }| j                  |d«       y|�`| j                  |d«       t	        j                  |«      }d|_        d|_        | j                  |d«       d|_        | j                  |d«       yt        |t        «      r| j                  |«      }|€y|j                  t        j                  j                  d«      k7  r�|j                  j                  d«      r;| j                  j                  j                  t        d|j                  ¬«      «       n:| j                  j                  j                  t!        d|j                  ¬«      «       	 | j                  j#                  |«       | j'                  «        y# t$        $ r Y Œw xY w)	zRemove the given sourceTNFrÛ   zDir::Etc::sourcelistz.sourcesrý   )rÞ   )rÏ   rI   rê   Úremove_sourcer€   rn   r³   rÞ   r   r   Ú	find_fileÚendswithr"   ræ   r—   r   r   rÐ   rŒ   rÀ   )r5   r­   Úremove_source_codes      r6   rg  z SoftwareProperties.remove_source  sp  € áÜ	�FœCÔ	 à×.Ñ.¨vÓ6ˆØ×Ñ˜6 4Ô(ð ð ÐØ×Ñ˜6 5Ô)ô —‘˜6Ó"ˆØˆŒØˆŒØ×Ñ˜6 5Ô)ØˆŒØ×Ñ˜6 5Ô)Øô �&œ#ÔØ×,Ñ,¨VÓ4€fØ€~Øð
 ‡{�{”g—n‘n×.Ñ.Ð/EÓFÒFØ	�‰×	Ñ	˜jÔ	)Ø×Ñ×Ñ×$Ñ$Ô%6°rÀÇÁÔ%LÕMà×Ñ×Ñ×$Ñ$¤[°¸&¿+¹+Ô%FÔGðØ
×Ñ×Ñ˜fÔ%ð 	×!Ñ!Õ#øô ò ñ
 ðús   Å;F' Æ'	F3Æ2F3c                 óŒ   — t         j                  j                  |«      sy	 | j                  j	                  |«      }|S #  Y yxY w)z7Add a gnupg key to the list of trusted software vendorsF)rP   rQ   rR   r/   r¦   )r5   rQ   rÂ   s      r6   rF  zSoftwareProperties.add_key3  s=   € ä�7‰7�>‰>˜$ÔØðØ�l‰l×Ñ˜tÓ$ˆØˆ
øðÙús	   ¢? ¿Ac                 óÀ   — t        j                  «       }|j                  |j                  d«      «       |j	                  «        | j                  |j                  «      S )z<Add a gnupg key from a utf-8 data string (e.g. copy-n-paste)zutf-8)Útempfiler   ry   Úencoder|   rF  r   )r5   ÚkeydataÚtmps      r6   Úadd_key_from_dataz$SoftwareProperties.add_key_from_data=  sA   € ä
×
%Ñ
%Ó
'€CØ‡I�Iˆg�n‰n˜WÓ%Ô&Ø‡I�I„KØ�<‰<˜Ÿ™Ó!Ð!r8   c                 óJ   — 	 | j                   j                  |«       y#  Y yxY w)z<Remove a gnupg key from the list of trusted software vendorsTF)r/   Úrm)r5   Úkeyids     r6   Ú
remove_keyzSoftwareProperties.remove_keyD  s$   € ðØ�‰�‰˜ÔØøðÙús   ‚ ž"c                 óH   — 	 | j                   j                  «        y#  Y yxY w)z Run apt-key update TF)r/   r•   rW   s    r6   Úupdate_keyszSoftwareProperties.update_keysL  s$   € ðØ
‡l�l×ÑÔØøðÙús   ‚ �!c                 ó.  — t        |t        j                  «      sJ ‚|j                  }|r|j                  }|j
                  }n>t        j                  |«      }|j                  |«      }|j                  }|j
                  }|j                  ›d|›d|›d�S )z" Return the PackageKit package id ú;)	rÏ   r   ÚPackageÚcurrent_verÚver_strÚarchÚDepCacheÚget_candidate_verr   )r5   Ú	apt_cacheÚpkgÚcur_verÚverr}  ÚdepcacheÚ	candidates           r6   Úget_package_idz!SoftwareProperties.get_package_idT  sy   € ä�cœ7Ÿ?™?Ô+Ð+Ð+Ø�o‰o€GÙØ�o‰oˆØ�|‰|‰ä×#Ñ# IÓ.ˆØ×.Ñ.¨sÓ3ˆ	Ø×ÑˆØ�~‰~ˆØŸ(›(¢CªÐ.Ð.r8   c                 ó0  — t        j                  | «      }|j                  |«      }g }	 |j                  j	                  d«      D ]6  }|D ]/  \  }}}	|j                  |«      dk7  sŒ|j                  | |   «       Œ1 Œ8 	 |S # t        t        f$ r g cY S w xY w)zF Get the package dependencies, which can be filtered out by a pattern ÚDependséÿÿÿÿ)	r   r~  r  Údepends_list_strri   r  r—   ÚKeyErrorrç   )
r€  ÚpackageÚpatternr„  r…  ÚdependenciesÚdep_listÚdep_nameÚdep_verÚdep_ops
             r6   Úget_dependenciesz#SoftwareProperties.get_dependenciesb  s«   € ô ×Ñ 	Ó*€HØ×*Ñ*¨7Ó3€Ià€LðØ!×2Ñ2×6Ñ6°yÓAò 	=ˆHØ-5ò =Ñ)�˜' 6Ø—=‘= Ó)¨RÓ/Ø ×'Ñ'¨	°(Ñ(;Õ<ñ=ñ	=ð Ðøô ”iÐ ò ØŠ	ðús   ª;B Á&B ÂBÂB)NNr   F)F)TrÊ   )AÚ__name__Ú
__module__Ú__qualname__r=  re   ræ   Úrangerf   ÚRELEASE_UPGRADES_LTSÚRELEASE_UPGRADES_NEVERrk   r7   r4   r*   rK   rX   r\   r_   ra   rq   r…   r�   rœ   r¯   r¹   r¼   rÃ   rÅ   rÈ   rÌ   rÑ   rÖ   rÙ   rß   r)   rê   rì   rñ   rô   ró   rÀ   rZ   r  r  r  r  r  r   r(   rJ   rö   rD  rJ  rM  rU  rY  rW  rg  rF  rq  ru  rw  r†  Ústaticmethodr“  rL  r8   r6   r   r   D   sg  „ ð 2€,ð AÐñ ‰5�‹8ƒnñ	ØØØð ˜hØ˜eØ˜gð!Ðó'+òRò-òòò.ò(%òLò(ò&ò0ò ò2%òNò òò$ò
$ò
ò
$ò$ò$ò$ò<
3òò$òòòòòò(òT.ò*ò%ò<òò*.ò
/Hòbòò ò0òó"	Gó$óL)$òVò"òòò/ð òó ñr8   r   Ú__main__)/r   r€   Úhashlibr   r“   rP   r>  r}   r:   r2   rm  r)  Ústringr   ÚImportErrorrI   r,  r,   r-   r   Úxml.sax.saxutilsr   Úconfigparserr   r   r   r#   Úaptsources.distrorB   r
   Úaptsources.sourceslistr   r   r   Ú"softwareproperties.shortcuthandlerr   Úsoftwareproperties.shortcutsr   Úgi.repositoryr   Úobjectr   r”  Úsprµ   rq   r…   rL  r8   r6   ú<module>r¨     só   ðó4 Û Ý Û 	Û 	Û Û Û Û Û Û ðÝó ðÛõ (Ý #ð(Ý'õ !ã Û Û å ß PÑ PÝ GÝ 9å ôm˜ô mð` ˆzÒÙÓ€"Ùˆ×&Ñ&Ó(Ô)Ø× Ñ  Õ#ð øð[ ò Ø�m‰m‚)ðûð ò Ýðûð ò (ß'ð(ús4   °C »C ÁC, ÃCÃCÃ	C)Ã(C)Ã,C:Ã9C: