+
    diN]                     .   ^ RI t ] P                  ! RR]4       ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIHt ^ RIHt  ! R R4      t ! R	 R
]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R4      t ! R R4      tR# )    NignorezAccessed deprecated property)gettext)Gio)utilsc                   0   a  ] tR t^.t o RR ltR tRtV tR# )
UpdateItemc                B    W0n         W n        Wn        W@n        WPn        R # N)iconnamepkg	to_remove	sensitiveselfr   r   r   r   r   s   &&&&&&?/usr/lib/python3/dist-packages/UpdateManager/Core/UpdateList.py__init__UpdateItem.__init__/   s    		""    c                    V P                   '       g5   V P                  P                  ;'       g    V P                  P                  # V P                  P                  # r
   )r   r   marked_installmarked_upgrademarked_deleter   s   &r   is_selectedUpdateItem.is_selected6   s=    ~~~88**EEdhh.E.EE88)))r   )r   r   r   r   r   NT)__name__
__module____qualname____firstlineno__r   r   __static_attributes____classdictcell____classdict__s   @r   r   r   .   s     #* *r   r   c                   v   a  ] tR t^=t o / tRR lt]R 4       tRR ltR t	R t
R tRR ltR	 tR
 tR tRtV tR# )UpdateGroupc                    \         P                  WW#WE4       \        4       V n        \        4       V n        R V n        Ve:   \        WW4V4      V n        V P                  P                  V P
                  4       R # R # r
   )r   r   set_items_deps	core_itemaddr   s   &&&&&&r   r   UpdateGroup.__init__@   s[    Dt9HeU
?'4INDNKKOODNN+ r   c                X    . pVP                  V P                  4       \        VR  R7      # )c                 6    V P                   P                  4       # r
   r   loweras   &r   <lambda>#UpdateGroup.items.<locals>.<lambda>M   s    qvv||~r   key)extendr*   sorted)r   	all_itemss   & r   itemsUpdateGroup.itemsI   s'    	%i%=>>r   Nc           	        \         P                  ! V4      p\        P                  P	                  R 4      pV P
                  P                  \        WWcV4      4       V'       dg   VP                  V9   dT   VP                  V P                  9  d7   V P                  '       g   V P                  V4       V P                  W4       R# R# R# R# packageN)r   get_package_labelr   
ThemedIconnewr*   r-   r   r   r+   
_init_deps	_add_deps)r   r   cacher   r   r   r   s   &&&&&  r   r-   UpdateGroup.addO   s     &&s+~~!!),
3dyIJ SXX&3884::+E::: &NN3& ,F&5r   c                    WP                   9   # r
   )r*   r   items   &&r   containsUpdateGroup.containsc   s    {{""r   c                    V P                    FZ  pVP                  '       g   K  VP                  P                  V P                  9  g   K>  V P	                  VP                  V4       K\  	  R # r
   )r*   r   r   r+   rE   )r   rF   rJ   s   && r   rD   UpdateGroup._init_depsf   s>    KKDxxxDHHMM;txx/  r   c                   Ve*   VP                   e   VP                  V P                  9   de   V'       * ;'       g    VP                   '       * ;'       d    R;'       g    RVP                  ,          p\        P                  ! RV,          4       R# V P                  P                  VP                  4       VP                  V P                  9   dY   V P                  VP                  ,           F5  pW@P                  9  g   K  WB9   g   K  V P                  W$,          V4       K7  	  R# VP                   pVP                  RR4      p\        P                  P                  V4       Fv  pVP                  pWP                  9  g   K!  W9   g   K)  V P                  P                  VP                  . 4      P                  V4       V P                  W(,          V4       Kx  	  R# )z8Adds pkg and dependencies of pkg to the dependency list.Nz,Package was None or didn't have a candidate.z%s already in _deps.zUseless call to _add_deps. %sDepends
Recommends)	candidater   r+   loggingdebugr-   	_depcacherE   get_dependencies	itertoolschainfrom_iterable
setdefaultappend)	r   r   rF   reasondeprR   dependenciesdependency_pkgr   s	   &&&      r   rE   UpdateGroup._add_depsk   sU   ;#--/388tzz3I
 --- C CB5 5)CHH4 
 MM9FBC

sxx 88t~~%~~chh//jj(S\NN5:u5 0 I$55iNL"+//"?"?"M%**zz)dmNN--chh;BB4HNN5;6	 #Nr   c                    V P                   '       g   V'       d   V P                  V4       VP                  V P                   9   # r
   )r+   rD   r   )r   	maybe_deprF   s   &&&r   is_dependencyUpdateGroup.is_dependency   s,    zzzeOOE"~~++r   c                ^    V P                    F  pVP                  4       '       g   K   R # 	  R# )TF)r<   r   rI   s   & r   packages_are_selected!UpdateGroup.packages_are_selected   s'    JJD!!  r   c                    V P                    Uu. uF  qP                  4       '       g   K  VNK  	  pp\        V4      ^ 8  ;'       d"    \        V4      \        V P                   4      8  # u upi r   )r<   r   len)r   rJ   pkgs_installings   &  r   selection_is_inconsistent%UpdateGroup.selection_is_inconsistent   sb    ,0JJMJD:J:J:L44JM?#a' 
 
C,@3JJD
 -
 	
 Ns
   A*A*c                    V P                   '       d   ^ # ^ pV P                   F+  pV\        VP                  P                  R^ 4      ,          pK-  	  V# )r   size)r   r<   getattrr   rR   )r   ro   rJ   s   &  r   get_total_sizeUpdateGroup.get_total_size   sC    >>>JJDGDHH..::D r   )r+   r*   r,   r   )NFTr
   )r   r   r    r!   rU   r   propertyr<   r-   rK   rD   rE   rc   rf   rl   rq   r"   r#   r$   s   @r   r'   r'   =   sP     I, ? ?
'(#0
7:,
 r   r'   c                   6   a a ] tR t^t oRV 3R lltRtVtV ;t# )UpdateApplicationGroupc                r   < VP                  4       pVP                  4       p\        \        V `  WWcV4       R # r
   )get_display_nameget_iconsuperru   r   )r   r   applicationr   r   r   r   	__class__s   &&&&&  r   r   UpdateApplicationGroup.__init__   s6    ++-##%$d4t		
r    r   r   r   r    r!   r   r"   r#   __classcell__r{   r%   s   @@r   ru   ru           
 
r   ru   c                   6   a a ] tR t^t oRV 3R lltRtVtV ;t# )UpdatePackageGroupc                   < \         P                  ! V4      p\        P                  P	                  R 4      p\
        \        V `  WWRV4       R# r?   )r   rA   r   rB   rC   ry   r   r   )r   r   r   r   r   r   r{   s   &&&&  r   r   UpdatePackageGroup.__init__   s>    &&s+~~!!), $0t		
r   r}   r   r~   r   s   @@r   r   r      r   r   r   c                   6   a a ] tR t^t oRV 3R lltRtVtV ;t# )UpdateSystemGroupc                   < \        R 4      \        P                  ! VR7      ,          p\        P                  P                  R4      p\        \        V `#  RWEW#4       R# )z%s baserF   zdistributor-logoN)	_r   get_ubuntu_flavor_namer   rB   rC   ry   r   r   )r   rF   r   r   r   r   r{   s   &&&&  r   r   UpdateSystemGroup.__init__   sJ     |e::GG~~!!"45/$i	
r   r}   r   r~   r   s   @@r   r   r      s     
 
r   r   c                   &   a  ] tR t^t o R tRtV tR# )UpdateOriginc                ,    . V n         W n        Wn        R # r
   )packages
importancedescription)r   descr   s   &&&r   r   UpdateOrigin.__init__   s    $r   )r   r   r   Nr   r   r    r!   r   r"   r#   r$   s   @r   r   r      s        r   r   c                      a  ] tR t^t o RtRtRtRtRtRt	Rt
RR	 ltR
 tR tR tR tR tR tRR lt. . 3R ltRtV tR# )
UpdateListzq
class that contains the list of available updates in
self.pkgs[origin] where origin is the user readable string
zPhased-Update-Percentagez/etc/machine-idz/var/lib/dbus/machine-idz+/usr/share/app-install/desktop/%s:*.desktopz-Update-Manager::Always-Include-Phased-Updatesz,Update-Manager::Never-Include-Phased-UpdatesNc                ,   V'       d   TM\         P                  ! 4       V n        ^ V n        . V n        . V n        . V n        . V n        . V n        . V n	        . V n
        ^ V n        \        P                  ! 4       V n        . V n         \        V P                   4      ;_uu_ 4       pVP#                  4       V n        RRR4       R\*        P,                  9   d6   \*        P,                  R,          '       d   \*        P,                  R,          pMRpTP/                  R4       Uu. uF#  p\*        P0                  P3                  TR4      NK%  	  upT n        R\*        P,                  9   d&   \*        P,                  P7                  R4      T n        MRT n        / T n        R#   + '       g   i     L; i  \&         dV    \        T P(                  4      ;_uu_ 4       pTP#                  4       T n        RRR4        EK7    + '       g   i      ELI; ii ; iu upi )r   NXDG_DATA_DIRSz/usr/local/share/:/usr/share/:applicationsXDG_CURRENT_DESKTOP )r   get_distdistdistUpgradeWouldDelete
oem_groupsupdate_groupssecurity_groupskernel_autoremove_groupsduplicate_groupsubuntu_pro_groupsubuntu_pro_fake_groupsnum_updatesrandomRandomignored_phased_updatesopenUNIQ_MACHINE_ID_FILEreadmachine_uniq_idFileNotFoundErrorUNIQ_MACHINE_ID_FILE_FALLBACKosenvironsplitpathjoinapplication_dirsgetcurrent_desktopdesktop_cache)r   parentr   f	data_dirsbases   &&&   r   r   UpdateList.__init__   s~    Denn&6	&'#!(*% "!#&(#mmo&(#	0d//00A'(vvx$ 1 bjj(RZZ-H-H

?3I7I;D??3;O!
;O4BGGLL~.;O!
 !BJJ.#%::>>2G#HD #%D % 10  	0d8899Q'(vvx$ :999	0!
sN   F. #F9F.  )HF+	&F. +F. .(HG8,H8H
H
Hc                    VP                  R 4      '       g   R# \        P                  P                  V4      pV P                   F  pVP                  V4      '       g   K   R# 	  R# )z.desktopFT)endswithr   r   abspathr   
startswith)r   	file_pathapp_dirs   && r   _file_is_applicationUpdateList._file_is_application  sU     !!*-- GGOOI.	,,G##G,, - r   c                    ^ p\         P                  P                  VP                  4       4      p\         P                  P	                  V4      ^ ,          pVP                  4       '       d#   V^,          pWRP                  8X  d
   V^,          pV# ri   )r   r   basenameget_filenamesplitextshould_showr   )r   rz   r   scoredesktop_fileapplication_ids   &&&   r   _rate_application_for_package(UpdateList._rate_application_for_package  sm    ww''(@(@(BC)),7:""$$QJE)
r   c                   . p. pVP                    F-  pV P                  V4      '       g   K  VP                  V4       K/  	  VP                  V P                  9   d$   W P                  VP                  ,          ,          pV Fj  p \
        P                  P                  V4      pVP                  V P                  4       T P                  Ya4      pT^ 8  g   KX  TP                  Y34       Kl  	  VP                  R RR7       \        V4      ^ 8  d   V^ ,          ^,          # R#   \         d*   p\        P                  ! R T: RT: 24        Rp?K  Rp?ii ; i)zError loading .desktop file : Nc                     V ^ ,          # ri   r}   )apps   &r   r5   9UpdateList._get_application_for_package.<locals>.<lambda>9  s    Ar   T)r8   reverse)installed_filesr   r[   r   r   r   DesktopAppInfonew_from_filenameset_desktop_envr   	ExceptionrS   warningr   sortrj   )	r   r   desktop_filesrated_applicationsinstalled_filer   rz   er   s	   &&       r   _get_application_for_package'UpdateList._get_application_for_package  s1   !11N((88$$^4 2 88t)))//99M)L	!00BB  ++D,@,@A 66{HEqy"))5*>? * 	$6E!"Q&%a(++  <H!L 	s   :D&&E1EEc                Z   V'       g   \         P                  ! R 4       R# \        V4      ^8X  d   V P                  V^ ,          ,          pMV P                  R,          p\        P
                  ! V4       F  p VP                  R4      R,          P                  R4      ^ ,          pYA9   g   K:  T P                  P                  T. 4      P                  T4       \         P                  ! RT: RT: 24       K  	  R#   \         d"    \         P                  ! RT,          4        K  i ; i)	z;_populate_desktop_cache called with empty list of packages.N*/r   z7Could not extract package name from '%s'. File ignored.zApp candidate for r   )rS   r   rj   APP_INSTALL_PATTERNglobiglobr   
IndexErrorerrorr   rZ   r[   rT   )r   	pkg_namespatternr   r   s   &&   r   _populate_desktop_cache"UpdateList._populate_desktop_cache?  s    OO ^q ..1=G ..4G JJw/L
"((-b177<Q? ""--c26==lKCNO 0   $&23 s   9.C>>(D*)D*c                   V P                   '       g   R# VP                  P                  pVP                  P                   F  pV'       d<   \        P
                  P                  VP                  VP                  4      ^ 8:  d   KF  VP                   Fm  w  rEVP                  RV P                   ,          8X  g   K)  VP                  R8X  g   K<  VP                  P                  P                  V4      pV'       g   Kk    R# 	  K  	  R# )ad  This will test if the pkg is a security update.
This includes if there is a newer version in -updates, but also
an older update available in -security.  For example, if
installed pkg A v1.0 is available in both -updates (as v1.2) and
-security (v1.1). we want to display it as a security update.

:return: True if the update comes from the security pocket
Fz%s-securityUbuntuT)r   _pkgcurrent_verversion_listaptapt_pkgversion_comparever_str	file_listarchiveorigin_pcache_list
find_index)r   r   inst_verververFileIterindex	indexfiles   &&     r   _is_security_updateUpdateList._is_security_update`  s     yyy88''88((C KK//X=M=MN (+$''=499+DD#**h6 # 1 1 < <[ II y# )6 )" r   c           	     "   \         P                  P                  P                  V P                  R4      '       d   R# V P
                  VP                  P                  9   Ed-   \         P                  P                  P                  V P                  R4      '       d   \        P                  ! R4       R# V P                  P                  VP                  P                  : RVP                  P                  : RV P                  : 24       VP                  P                  V P
                  ,          pV P                  P!                  ^ ^d4      pV\#        V4      8  d0   \        P                  ! RVP$                  : RV: RV: R24       R# R# )	zThis will test if the pkg is a phased update and if
it needs to get installed or ignored.

:return: True if the updates should be ignored
Fz,holding back phased update per configurationT-zholding back phased update z (z < ))r   r   configfind_bALWAYS_INCLUDE_PHASED_UPDATESPHASED_UPDATES_KEYrR   recordNEVER_INCLUDE_PHASED_UPDATESrS   infor   seedsource_nameversionr   randintintr   )r   r   	threshold
percentages   &&  r   _is_ignored_phased_update$UpdateList._is_ignored_phased_update  s#    ;;$$..
 
 ""cmm&:&::{{!!((115  KL
 KK MM--MM))((	 ,,T-D-DEI,,Q4JC	N*xxJ8 r   c           
     0   V'       g   . # . p. p. pV FH  pV P                  V4      p	V	e    \        WW44      p
VP                  V
4       K7  VP                  V4       KJ  	  \        V4       F  p. pV F?  pVP	                  W4      '       g   K  VP                  V4       \        V4      ^8  g   K?   M	  \        V4      ^8X  g   K\  V^ ,          P                  WV4       VP                  V4       K  	  R pV'       EdN   Rp\        P                  ! RRP                  V Uu. uF  pRV,           NK  	  up4      ,           R,           4      p\        R R R W44      p\        P                  ! VR7      pVRR.pV FA  pVP                  VP                  4      '       g   K&  VP                  VP                  4       KC  	  V F,  pW9   g   K  V'       d   K  VP                  W,          4       K.  	  V FX  pVP	                  W4      '       d$   Vf   \!        WV4      pVP                  V4       K=  VP                  \#        WV4      4       KZ  	  VP%                  R R	7       VP%                  R
 R	7       V'       d   VP                  V4       Wg,           # u upi )N(|^r
  r   zubuntu-standardzubuntu-minimalc                 6    V P                   P                  4       # r
   r1   r3   s   &r   r5   )UpdateList._make_groups.<locals>.<lambda>      affllnr   r7   c                 6    V P                   P                  4       # r
   r1   r3   s   &r   r5   r     r!  r   )zlinux$zlinux-.*-buildinfo.*zlinux-.*-dev.*zlinux-.*-generic.*zlinux-.*-headers.*zlinux-.*-hwe.*zlinux-.*-gcp.*zlinux-.*-kernel.*zlinux-.*-lowlatency.*zlinux-.*-modules.*zlinux-.*-raspi.*zlinux-.*-tools.*zlinux-.*-virtual.*zlinux-base.*zlinux-crashdump.*zlinux-doc.*)r   ru   r[   listrc   rj   r-   removerecompiler   r'   r   get_ubuntu_flavor_packagematchr   r   r   r   )r   rF   pkgsr   r   ungrouped_pkgs
app_groups
pkg_groupsr   r   	app_group
dep_groupsgroupsystem_grouplinux_namesnlinux_regexpubuntu_base_groupflavor_packageubuntu_base_pkgss   &&&&&               r   _make_groupsUpdateList._make_groups  se   I

C33C8C2i	 !!),%%c*  'CJ#&&s22%%e,:*	 $
 :!#1!!#i8%%c* ( >K$ ::chh=Aa=>>DL !,dD)! #<<5IN!  
 %%chh//$++CHH5  (<		 &))%*5 ( &$22  $+'8!i( !$$S)%%*39E & 	4545l+&&O  >s   !Jc                  a . V n         VP                  4       V n        . p. p. p. p. p. p	 ! R  R4      o ! V3R lR4      p
. p. pV F;  w  ppppV'       d   VP                  V4       K#  VP                  V
! WV4      4       K=  	  V EFY  pVP                  '       g   VP
                  '       Ed#   \        VP                  RR4      f   \        RVP                  4       KZ  V P                  V4      pV'       g5   V P                  V4      '       d   V P                  P                  V4       K  \        P                  ! VP                  R4      '       d   VP                  V4       VP                  V9   pV'       d   VP                  V4       M+V'       d   VP                  V4       MVP                  V4       V P                  ^,           V n        VP                  '       dM   VP                  '       g;   VP
                  '       g)   V P                   P                  VP                  4       EK  VP                   '       dz   VP"                  '       dh   VP"                  P%                  VP                  4      '       d=   VP&                  P%                  VP                  4      '       g   VP                  V4       VP                  V9   g   EKH  V	P                  V4       EK\  	  V F  pVP)                  4        K  	  V	 F  pVP)                  4        K  	  V P                   F  pVP+                  4        K  	  V'       g   V'       g	   V'       dI   VV,           V,           V	,           V,            Uu. uF  pVP                  NK  	  ppV P-                  V4       V P/                  W4      V n        V P/                  W4      V n        V P/                  W4      V n        V P/                  WR4      V n        V P/                  WR4      V n        V P/                  WR	R
7      V n        V P/                  W4      V n        R# u upi )c                   &   a  ] tR tRt o R tRtV tR# )8UpdateList.update.<locals>.FakeUbuntuProPackageCandidatei  c                ^    Wn         Wn        Wn        W n        W0n        R V n        / V n        R# FN)r  summaryr   r  ro   downloadabler  )r   r  r  ro   s   &&&&r   r   AUpdateList.update.<locals>.FakeUbuntuProPackageCandidate.__init__  s,    #. *#. & 	$)! r   )r   r?  r  ro   r  r>  r  Nr   r$   s   @r   FakeUbuntuProPackageCandidater;    s     ! !r   rA  c                   :   <a  ] tR tRt o V3R ltR tR tRtV tR# )/UpdateList.update.<locals>.FakeUbuntuProPackagei!  c                h   < Wn         S! WV4      V n        R V n        R V n        R V n        . V n        R# r=  )r   rR   r   r   r   r   )r   package_namer  ro   rA  s   &&&&r   r   8UpdateList.update.<locals>.FakeUbuntuProPackage.__init__"  s;    (	!> 4" ',#&+#%*"')$r   c                    R # r
   r}   r   s   &r   mark_install<UpdateList.update.<locals>.FakeUbuntuProPackage.mark_install,      r   c                    R # r
   r}   r   s   &r   mark_delete;UpdateList.update.<locals>.FakeUbuntuProPackage.mark_delete/  rJ  r   )rR   r   r   r   r   r   N)	r   r   r    r!   r   rH  rL  r"   r#   )r%   rA  s   @r   FakeUbuntuProPackagerC  !  s     * r   rN  originsNz1WARNING: upgradable but no candidate.origins?!?: z
oem-*-metaTF)r   )	held_backsaveDistUpgrader   r[   is_upgradabler   rp   rR   printr   r  r  r   fnmatchr   r   is_auto_removableversioned_kernel_pkgs_regexpr(  running_kernel_pkgs_regexprL  	mark_keepr   r7  r   r   r   r   r   r   r   )r   rF   duplicate_packagesua_security_packagesoem_pkgspro_pkgssecurity_pkgsupgrade_pkgskernel_autoremove_pkgsduplicate_pkgsrN  fake_ua_packagesua_packages_namesrE  r  ro   r?  r   is_security_updatecomes_from_propr   rA  s   &&&&                  @r   updateUpdateList.update  s     ',&;&;&=#!#	! 	!	 	"  "
!((6 ''(E	 " C   C$6$6$63==)T:B K 
 &*%=%=c%B")55c::33::3? ??388\::OOC(!$->!>!OOC('!((- '',#'#3#3a#7    """c&8&8&8%%chh/$$$22266<<SXXFF88>>sxxHH&--c2xx--%%c*W ^ *COO *!COO "..CMMO / LH '() !! 	A    ((3++
 "..
  $00 
 )-(9(94)
% !% 1 14!
 '+&7&7u '8 '
# "&!2!2"
7s   3P;)r   r   r   r   r   r   rP  r   r   r   r   r   r   r   r   r   r   r
   )FT)r   r   r    r!   __doc__r  r   r   r   r  r  r   r   r   r   r   r  r  r7  rf  r"   r#   r$   s   @r   r   r      s}      4 -$>!G 	8 "
 	7 !! F@PB>&P\'B 	R
 R
r   r   )warningsfilterwarningsDeprecationWarningr   r   r   rT  rS   rW   r   r   r   r%  gi.repositoryr   UpdateManager.Corer   r   r'   ru   r   r   r   r   r}   r   r   <module>rn     s   2    ,.@ ! 
    	   	  $* *c* cL
[ 

 

 
   P
 P
r   