+
    j"#                         ^ 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IHt . ROt^RIHt R tR tR tR	 tR
 tR tR# )    N)datetime)OptionParser)gettext)DistUpgradeConfigc            	        \        4       p V P                  RRR\        R4      R7       V P                  RRR\        R	4      R7       V P                  R
RRR\        R4      R7       V P                  RRR\        R4      R7       V P                  RRR\        R4      R7       V P                  RRRR\        R4      R7       V P                  4       # )z.setup option parser and parse the commandline z
--frontendfrontendNz_Use frontend. Currently available: 
DistUpgradeViewText, DistUpgradeViewGtk, DistUpgradeViewKDE)destdefaulthelpz--modemodedesktopz(*DEPRECATED* this option will be ignoredz	--partialpartialF
store_truez:Perform a partial upgrade only (no sources.list rewriting))r	   r
   actionr   z--disable-gnu-screenzDisable GNU screen support)r   r
   r   z	--datadirdatadir.zSet datadirz--devel-releasedevel_releasez"Upgrade to the development release)r   r	   r
   r   )r   
add_option_
parse_args)parsers    =/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeMain.pydo_commandliner   5   s    ^F
lD [ \  ] hVIGH  J
k	5)YZ  \ ,\#9:  < k	3]+  -
'*EAB  D     c           
        VP                  RRR4      p\        P                  P                  V4      '       g   \        P                  ! V4       \
        P
                  ! VR,           4      '       Ed   \        P                  ! 4       pVRVP                  VP                  VP                  VP                  VP                  3,          ,           p\        P                  P                  V4      '       g   \        P                  ! V4       \
        P
                  ! VR,           4       FU  p\        P                  ! V\        P                  P                  V\        P                  P!                  V4      4      4       KW  	  \        P                  P                  VR4      pV P"                  '       d
   VR,          p\%        VR4      ;_uu_ 4         R	R	R	4       \&        P(                  ! \&        P*                  VR
RR7       \&        P,                  ! RVP.                  ,          4       \&        P,                  ! RRP                  \        P0                  ! 4       4      ,          4       \2        P4                  P7                  R	4      pVR,          P8                  P:                  p\&        P,                  ! RV,          4       \&        P,                  ! R\<        P>                  ,          4       V#   + '       g   i     EL%; i)zsetup the logging FilesLogDirz/var/log/dist-upgrade/z/*.logz/%04i%02i%02i-%02i%02izmain.logz.partialaNz%%(asctime)s %(levelname)s %(message)sw)levelfilenameformatfilemodezUsing config files '%s'zuname information: '%s' aptzapt version: '%s'zpython version: '%s') getWithDefaultospathexistsmkdirglobr   nowyearmonthdayhourminuteshutilmovejoinbasenamer   openloggingbasicConfigDEBUGinfoconfig_filesunamer%   apt_pkgCachecurrent_verver_strsysversion)	optionsconfiglogdirr,   
backup_dirffnamecacheapt_versions	   &&       r   setup_loggingrK   J   s   ""784LMF77>>&!!
yy!!lln4377SVS[S[\_\f\f7ggg
ww~~j))HHZ 6(?+AKK277<<
2773C3CA3FGH ,GGLL
+E	eS		 
gmm!&F!$& LL*V-@-@@ALL*SXXbhhj-AABKKd#E,**22KLL${23LL'#++56M 
		s   K--K>	c                     ^ RI Hp \
        P                  P                  T R4      p\        P                  ! RT,          4       \
        P                  ! ^64      pT! 4       pTP                  RTRRR7       \
        P                  ! T4        \        P                  ! R	R
.\        P                  RR7      P                  4       ^ ,          p\        \
        P                  P                  T R4      R4      ;_uu_ 4       pTP!                  T4       RRR4       R#   \         d    \        P                  ! R4        R# i ; i  + '       g   i     R# ; i  \"         d)   p\        P                  ! RT,          4        Rp?R# Rp?ii ; i)r   )AptClonezfailed to import AptCloneNzapt-clone_system_state.tar.gzzcreating statefile: '%s'/T)	sourcedirtargetwith_dpkg_statusscrub_sourceslspciz-nnstdoutuniversal_newlinesz	lspci.txtr   zlspci failed: %s)	apt_clonerM   ImportErrorr7   errorr'   r(   r4   debugumask
save_state
subprocessPopenPIPEcommunicater6   writeOSError)rE   rM   rP   	old_umaskclonesrG   es   &       r   save_system_staterg   k   s)   & WW\\&"ABFMM,v56  IJE	s6D   HHY.


GE?:??.244?KM!E"'',,v{3S99QGGAJ :9#  12" :99 .(1,--.sH   D A0E >EE !D?>D?E	E E F	!FF	c           	        V P                   .VP                  RR4      ,            FC  pV'       g   K   ^ RIHp V! RV,           R4      p\	        WS4      pV! W P
                  R7      p V# 	  \        P                  ! R4       \        R4       \        P                  ! ^4       X#   \         d?   p\        P                  ! RT: RT: R24       \        R	T: R
T: R24        Rp?K  Rp?ii ; i)z/setup view based on the config and commandline View)import_moduler   DistUpgrade)rE   r   zcan't import view 'z' ()zcan't load z (Nz!No view can be imported, aborting)r   getlist	importlibrj   getattrr   	Exceptionr7   warningprintrY   rA   exit)	rC   rD   rE   requested_viewrj   
view_modul
view_classinstancerf   s	   &&&      r   
setup_viewrx      s     #++,V^^F6-JJJ	>/&s>'9=IJ !<J!IH O) K" 	9:12O  	>OO^ANO.!<==	>s   4B%%C.03C))C.c                 L   Rp  \         P                  ! RR.\         P                  RR7      P                  4       ^ ,          p\        P
                  ! RV,          4       Y9   d3   \        P                  ! R	4       \        P                  ! R
RRRRT .4       R\        P                  R&   RRRRRRT .\        P                  ,           p\        P                  ! RT,          4       \        P                  ! R
T4       R#   \         d    \        P                  ! R4        R# i ; i)zpcheck if there is a upgrade already running inside gnu screen,
if so, reattach
if not, create new screen window
z$ubuntu-release-upgrade-screen-windowscreenz-lsTrT   zscreen returned: '%s'zscreen could not be runNz)found active screen session, re-attachingz/usr/bin/screenz-dz-rz-p1RELEASE_UPGRADER_NO_SCREENz-ez\0\0z-cscreenrcz-Szre-exec inside screen: '%s')r]   r^   r_   r`   r7   rZ   rb   r:   r'   execvenvironrA   argv)
SCREENNAMEoutcmds      r   %run_new_gnu_screen_window_or_reattachr      s    
 8JeZ__#%%0[]16 	-34
 @A
"hdD*%MN-0BJJ+,  !XX&C LL.45HH$%  ./s   AC> >!D#"D#c                    \        4       w  r\        V P                  4      p\        W4      p^RIHp \        P                  ! RV,          4       \        P                  ! R4       V P                  e   V P                  R8X  dK   \        P                  P                  \        P                  ! 4       R4      p\        P                  ! RV4       \        WV4      pVP                   '       d2   R\        P"                  9   g   V P$                  '       g   \'        4        \        P(                  ! R4      '       g   R\        P"                  R&   ^R	IHp V! W`V P                  R
7      pV P,                  '       dC   VP/                  4       '       g   \0        P2                  ! ^4       \0        P2                  ! ^ 4       \5        V4       VP7                  4       '       d   ^ # ^# )zmain method )VERSIONz%release-upgrader version '%s' startedzubuntu-release-upgraderr   mor|   NEEDRESTART_SUSPENDy)DistUpgradeController)r   )r   r   r   rK   DistUpgradeVersionr   r7   r:   r   
textdomainr'   r(   r4   getcwdbindtextdomainrx   needs_screenr   disable_gnu_screenr   getenvr   r   doPartialUpgraderA   rs   rg   run)	rC   argsrD   rE   r   	localedirviewr   apps	            r   mainr      sE    %&OWw/F7+F+LL87BC01'//S"8GGLLd3	8)D gv.D 	(BJJ6&&&-/ 99*++,/

()<
w
GC ##%%HHQK f wwyyr   )
z/binz/bootz/etcz/initrdz/libz/lib32z/lib64z/sbinz/usrz/var)r%   r   r+   r7   r'   r2   r]   rA   r   optparser   r   SYSTEM_DIRSDistUpgradeConfigParserr   r   rK   rg   rx   r   r    r   r   <module>r      sT   ,     	   
  !  
 7*B.44%B-r   