Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/DistUpgrade/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pyc


RSc
@s-ddlZejddeddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
ddlmZddd	d
ddd
dddg
ZddlmZddlmZdZdZdZdZdZdZdS(iNtignoresAccessed deprecated(tdatetime(tOptionParser(tgettexts/bins/boots/etcs/initrds/libs/lib32s/lib64s/sbins/usrs/var(tDistUpgradeController(tDistUpgradeConfigcCsyt}|jdddddtdddtd	|jd
ddddd#dtd
|jddddddt|jddddd|jddddd|jddddd#dtd|jddddddtd|jddddtdddtd|jddddtdtd|jd dd!dd#dtd"|jS($s/ setup option parser and parse the commandline s-ss	--sandboxtdesttuseAufstdefaulttactiont
store_truethelpsSandbox upgrade using aufss-cs--cdromt	cdromPathsAUse the given path to search for a cdrom with upgradable packagess--have-prerequiststhavePrerequistss--with-networktwithNetworks--without-networktstore_falses
--frontendtfrontends_Use frontend. Currently available: 
DistUpgradeViewText, DistUpgradeViewGtk, DistUpgradeViewKDEs--modetmodetdesktops(*DEPRECATED* this option will be ignoreds	--partialtpartials:Perform a partial upgrade only (no sources.list rewriting)s--disable-gnu-screensDisable GNU screen supports	--datadirtdatadirsSet datadirN(Rt
add_optiontFalset_tNonet
parse_args(tparser((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pytdo_commandline:s.	







c
Cs|jddd}tjj|s7tj|ntj|drtj}|d|j|j	|j
|j|jf}tjj|stj|nxItj|dD]1}t
j|tjj|tjj|qWntjj|d}|jr|d7}nt|dWd	QXtjd
tjd|dd
ddtjd|jtjddjtjtjdtjj|S(s setup the logging tFilestLogDirs/var/log/dist-upgrade/s/*.logs/%04i%02i%02i-%02i%02ismain.logs.partialtaNtleveltfilenametformats%%(asctime)s %(levelname)s %(message)stfilemodetwsUsing config files '%s'suname information: '%s't sapt version: '%s'(tgetWithDefaulttostpathtexiststmkdirtglobRtnowtyeartmonthtdaythourtminutetshutiltmovetjointbasenameRtopentloggingtbasicConfigtDEBUGtinfotconfig_filestunametapttapt_pkgtVERSION(toptionstconfigtlogdirR+t
backup_dirtftfname((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pyt
setup_loggingUs.,2	
 c	Csyddlm}Wntk
r5tjddSXtjj|d}tjd|tj	d}|}|j
ddd	|d
tdttj	|yQtj
dd
gdtjjd}ttjj|ddj|Wn$tk
r}tjd|nXdS(Ni(tAptClonesfailed to import AptClonesapt-clone_system_state.tar.gzscreating statefile: '%s'i6t	sourcedirt/ttargettwith_dpkg_statust
scrub_sourcestlspcis-nntstdoutis	lspci.txtR#slspci failed: %s(t	apt_cloneRFtImportErrorR6terrorR&R'R3tdebugtumaskt
save_statetTruet
subprocesstPopentPIPEtcommunicateR5twritetOSError(RARFRIt	old_umasktclonetste((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pytsave_system_statess"

	
()cCsx|jg|jddD]}}|s/qny/t|}t||}|d|}PWqtk
r}tjd||fd||fGHqXqWtjddGHtj	d|S(s0 setup view based on the config and commandline tViewRAscan't import view '%s' (%s)scan't load %s (%s)s!No view can be imported, abortingi(
Rtgetlistt
__import__tgetattrt	ExceptionR6twarningRPtsystexit(R?R@RAtrequested_viewt
view_modult
view_classtinstanceR^((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pyt
setup_views#

cCsd}y=tjddgdtjjd}tjd|Wntk
rdtjddSX||krtjd	tj	d
dddd
|gndtj
d<ddddddd|gtj}tjd|tj	d
|dS(s check if there is a upgrade already running inside gnu screen,
        if so, reattach
        if not, create new screen window
    s$ubuntu-release-upgrade-screen-windowtscreens-lsRMisscreen returned: '%s'sscreen could not be runNs)found active screen session, re-attachings/usr/bin/screens-ds-rs-pt1tRELEASE_UPGRADER_NO_SCREENs-es\0\0s-Ls-ctscreenrcs-Ssre-exec inside screen: '%s'(
RURVRWRXR6RQRZR9R&texecvtenvironRftargv(t
SCREENNAMEtouttcmd((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pyt%run_new_gnu_screen_window_or_reattachs&"


"
cCst\}}td}t||}ddlm}tjd|t|||}|jrdt	j
kr|jrtnt
||d|j}tj|j|jr|jstjdntjdnt||jrdSdS(	s
 main method t.i(R>s%release-upgrader version '%s' startedRoRii(RRREtDistUpgradeVersionR>R6R9Rltneeds_screenR&Rrtdisable_gnu_screenRwRRtatexittregistert_enableAptCronJobRtdoPartialUpgradeRfRgR_trun(R?targsR@RAR>tviewtapp((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pytmains(	

	
(twarningstfilterwarningstDeprecationWarningR<R|R*R6R&R1RURfRtoptparseRRRtSYSTEM_DIRSRtDistUpgradeConfigParserRRRER_RlRwR(((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeMain.pyt<module>s<						!