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/DistUpgradeController.pyc


#Uc@sddlZejddeddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlmZmZmZmZmZmZmZmZddlmZddlmZddlZddlmZddlm Z dd	l!m!Z!dd
l"m#Z#ddl$m%Z%m&Z&ddl'Z'ddl(Z(e'j)e(_)ddl(m*Z*m+Z+dd
l,m-Z-m.Z.ddl/m0Z1ddl/m2Z2ddl0Z0ddlm3Z3m4Z4m5Z5ddl6m7Z7dZ8de9fdYZ:de;fdYZ<e=dkrddl>m>Z>e	j?de	j@e>ZAe<eAZBeBjCeBjDndS(iNtignoresapt API not stable yet(tcountry_mirrorturl_downloadabletcheck_and_fix_xbittget_archtiptables_activet
inside_chroott)get_string_with_no_auth_from_source_entrytis_child_of_process_name(tTemplate(turlsplit(tMyCache(tDistUpgradeConfig(tDistUpgradeQuirks(tAptCdrom(t	setupAufstaufsOptionsAndEnvironmentSetup(tSourcesListt	is_mirror(t
get_distrotNoDistroTemplateException(tgettext(tngettext(tCacheExceptionDpkgInterruptedtCacheExceptionLockingFailedtNotEnoughFreeSpaceError(t
run_apports/var/run/reboot-requiredtNoBackportsFoundExceptioncBseZRS((t__name__t
__module__(((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRMstDistUpgradeControllercBseZdZd(d(dZedZdZdZdZ	dZ
dZdZed	Z
d
ZdZdZed(d
ZdZdZdZdZdZddZdZdZdZdZdZdZdZdZdZ dZ!dZ"d Z#e$d!Z%e$d"Z&d#Z'd$Z(d%Z)d&Z*d'Z+RS()s3 this is the controller that does most of the work cCsd}|dkr6tj}tjj|d}n||_||_tjd|tj	dt
jd|jj
||_|jjtdd|_|js|jjdkrt|_n|jj|_|r|j}nd}t|||_t||_d|jjdd|_|jjd	|jjd	d
t|jt|j|j|jjdd|_ |jjdd
|_!|jjdd|_"t#|_$tj%j&dst
jdt'j(jddnt)|_*t+||j|_,dtj%d<dtj%d<dtjdtj%dftj%d<t-d|jj.dd}t'j(jdt|t'j(jdtd-t'j(jd td.t'j(jd"d#t'j(jd$d#t'j(jd%d&|jj/d'd(|_0|jj1dd)|_2g|_3|jj4d*rxg|jj5d*D]}|d+^q\|_3nd,|_6dS(/Ns/usr/share/locale/tmosupdate-managersUsing '%s' views
Reading cachet.tFilest	BackupExttOptionstwithNetworktSourcestFromtTotValidOrigint"RELEASE_UPGRADE_NO_FORCE_OVERWRITEsenable dpkg --force-overwritesDPkg::Options::s--force-overwritet1tRELEASE_UPGRADE_IN_PROGRESStPYCENTRAL_FORCE_OVERWRITEs%s:%ss	/importedtPATHs./imported/invoke-rc.dtNetworkt
MaxRetriessAcquire::Retriess
Dpkg::MaxArgsi@isDpkg::MaxArgBytesisAcquire::http::Timeoutt20sAcquire::ftp::TimeoutsApt::Get::List-CleanuptfalsetDistrotForcedObsoletestValidMirrorstThirdPartyMirrorsiiii(7tNonetostgetcwdtpathtjointdatadirtoptionsRtbindtextdomaint
textdomaintloggingtdebugt	__class__Rt_viewtupdateStatust_tcacheR$tTruet
useNetworkt	cdromPathRtaptcdromRtconfigtgettsources_backup_exttadd_sectiontsettstrRtfromDistttoDisttoriginRtarchtenvironthas_keytapt_pkgtConfigtFalset_partialUpgradeR
tquirksRtgetinttgetlisttforced_obsoletestgetListFromFilet
valid_mirrorstvalid_3p_mirrorsthas_sectiontitemst_aptCronJobPerms(tselftdistUpgradeViewR<R;t	localedirt	cdrompatht
maxRetriestpair((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt__init__Tsh		
		
	


	,cCstjd|jdkr/|jjdn|jj|jjy=t|j	|j
|j|j
j||_|j|_Wnt
k
r}tjddddg}tjjddkr|jd	n|j
jj|t|j	|j
|j|j
j|_nPtk
rn}tjd
||j
jtdtdtjd
nX|j|j_tjdt|jdS(NsopenCache()tPreCacheOpens-dpkg interrupted, calling dpkg --configure -as
/usr/bin/dpkgs--configures-atDEBIAN_FRONTENDtnoninteractives--force-confoldsCache can not be locked (%s)sUnable to get exclusive locksThis usually means that another package management application (like apt-get or aptitude) already running. Please close that application first.is/openCache(), new cache size %i(R?R@RER6RZtruntreleaseLocktunlockListsDirRRJRBtgetOpCacheProgresst	apt_cacheRtwarningR7RTRKtappendtgetTerminaltcallRterrorRDtsystexitRYtpartialUpgradetlen(Rdtlocktetcmd((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt	openCaches:


	
	
cCs2|jjdd}|jjj|kr.tStS(s
      Returns True if this view support upgrades over ssh.
      In theory all views should support it, but for savety
      we do only allow text ssh upgrades (see LP: #322482)
      tViewt
SupportSSH(RJR\RBRARRFRX(Rdt	supported((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_viewSupportsSSHsc	Csjtjjd}tjj|rftjjdrftdrf|jstjd|j	jt
dt
dtjdt
Sd}|j	jt
d	t
d
|}|t
krtjdntjddd
|dt|g}|dkrft
d}t
d|}trMd|}|t
d|7}n|j	j||qfntS(s this will check for server mode and if we run over ssh.
            if this is the case, we will ask and spawn a additional
            daemon (to be sure we have a spare one around in case
            of trouble)
        s"/var/run/release-upgrader-sshd.pids/proctsshdsupgrade over ssh not allloweds.Upgrading over remote connection not supportedsYou are running the upgrade over a remote ssh connection with a frontend that does not support this. Please try a text mode upgrade with 'do-release-upgrade'.

The upgrade will abort now. Please try without ssh.iisContinue running under SSH?sThis session appears to be running under ssh. It is not recommended to perform a upgrade over ssh currently because in case of failure it is harder to recover.

If you continue, an additional ssh daemon will be started at port '%s'.
Do you want to continue?s/usr/sbin/sshds-os
PidFile=%ss-pisStarting additional sshdsTo make recovery in case of failure easier, an additional sshd will be started on port '%s'. If anything goes wrong with the running ssh you can still connect to the additional one.
s-iptables -I INPUT -p tcp --dport %s -j ACCEPTsIf you run a firewall, you may need to temporarily open this port. As this is potentially dangerous it's not done automatically. You can open the port with e.g.:
'%s'(R7R9R:texiststisdirRRR?RwRBRDRxRyRXtaskYesNoQuestiont
subprocessRvRORtinformationRF(RdtpidfiletporttrestsummarytdescrR~((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt	_sshMagics>

	
			
	
		
cCsddlm}ddlm}t}|jdksb|jdksb|jdksb|jdkrkt}n|dtd	|}x'|jr|jjt	j
d
qW|jdkrt
jdtS|jj}|d|jd
|d|jd|j}|jdS(s this is a helper that is run if we are started from a CD
            and we have network - we will then try to fetch a update
            of ourself
        i(tMetaReleaseCore(tDistUpgradeFetcherSelftdapperthardytlucidtprecisetuseDevelopmentReleasetforceLTSg?sNo new dist foundtnew_disttprogressR<tviewN(tMetaReleaseRRRXtreleaseRFtdownloadingRBt
processEventsttimetsleepRR6R?RwtgetFetchProgressR<Rn(RdRRRtmRtfetcher((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_tryUpdateSelf!s,		

	cCstjdddlm}m}tjjdr|}|jt	dy|j
dd}Wn#|k
rtjd|tSXytjd}Wn%t
k
r}tjd	|tSX||tjjd
|fkrtjd||tjjd
|ftSntS(s sanity check that /usr/bin/python points to the default
            python version. Users tend to modify this symlink, which
            breaks stuff in obscure ways (Ubuntu #75557).
        s_pythonSymlinkCheck runi(tSafeConfigParsert
NoOptionErrors!/usr/share/python/debian_defaultstDEFAULTsdefault-versions+no default version for python found in '%s's/usr/bin/pythonsos.readlink failed (%s)s/usr/bins<python symlink points to: '%s', but expected is '%s' or '%s'(R?R@tConfigParserRRR7R9RtreadfptfileRKRXtreadlinktOSErrorRwR:RF(RdRRRJtexpected_defaulttfs_default_versionR}((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_pythonSymlinkCheck@s&
	
!)c		Cstjdddgdtjjdj|_}tjd|||jkpd||j	kstj
d||jf|jj
tdtd	||j	ft
jd
n|jjddtrY|jjdd
}t|s&tj
d|jj
tdtdtStjd|jjtdtd|n|jrS|jjrStjd}tjd|tjdtj|dtjj|drtjjd|dntjj|dr
tjjd|dn|d}tjj|rStjd|tj tj|qSn|j!|j"stj
d|jj
tdtdt
jd
ny|j#Wn%t$k
r}tj
d |tSX|j%j&|jstS|j%j'|_(|j(rd!tj)d"<n
d#tj)d"<|j*sItj
d$tStjjd%rtj
d&|jj
td'td(|j+nd)d*l,m-}x{|D]s}tjj|rtj.|tj/rtj
d+||jj
td,|td-||j+qqW|j0r|jr|jj1d4kr|jj3td.td/d0}||_4|jjd1d2t5|j4tjd3||r|j6qnt7S(5s: initial cache opening, sanity checking, network checking tlsb_releases-cs-ststdoutislsb-release: '%s'sBad upgrade: '%s' != '%s' sCan not upgrades=An upgrade from '%s' to '%s' is not supported with this tool.itAufstEnableFullOverlaytRWDirsaufs setup failedsSandbox setup faileds6It was not possible to create the sandbox environment.srunning in aufs overlay modesSandbox modesThis upgrade is running in sandbox (test) mode. All changes are written to '%s' and will be lost on the next reboot.

*No* changes written to a system directory from now until the next reboot are permanent.s
/backportssusing backports in '%s' shave: %ss/*.udebs
/usr/bin/dpkgsDir::Bin::dpkgs/usr/lib/apt/methodssDir::Bin::methodss/etc/apt/apt.conf.d/01ubuntusadding config '%s's%pythonSymlinkCheck() failed, abortingsKYour python install is corrupted. Please fix the '/usr/bin/python' symlink.sopenCache() failed: '%s'tservertRELEASE_UPGRADE_MODEtdesktopscheckViewDepends() faileds/usr/bin/debsig-verifysdebsig-verify is installeds$Package 'debsig-verify' is installedsThe upgrade can not continue with that package installed.
Please remove it with synaptic or 'apt-get remove debsig-verify' first and run the upgrade again.i(tSYSTEM_DIRSs%s not writablesCan not write to '%s'sIts not possible to write to the system directory '%s' on your system. The upgrade can not continue.
Please make sure that the system directory is writable.s)Include latest updates from the Internet?sThe upgrade system can use the internet to automatically download the latest updates and install them during the upgrade.  If you have a network connection this is highly recommended.

The upgrade will take longer, but when it is complete, your system will be fully up to date.  You can choose not to do this, but you should install the latest updates soon after upgrading.
If you answer 'no' here, the network is not used at all.tYesR#R$s#useNetwork: '%s' (selected by user)N(8RtPopentPIPEtcommunicatetstripRR?R@RPRQRwRBRDRxRyRJtgetWithDefaultRXRKRtinfoRR<thavePrerequistsR7R8tglobR9RRVRWRNtReadConfigFileRRRtSystemErrorREtsanityChecktneedServerModet
serverModeRTtcheckViewDependstaborttDistUpgradeMainRtaccesstW_OKRIR$R6RRGRORRF(	RdRtaufs_rw_dirtbackportsdirtconfR}Rt	systemdirR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytprepareZs#


	



	





(	
	$			cCsQtjd||js+tjdtSd|j|jf}t|tjS(sf
        helper that checks if a sources.list entry points to 
        something downloadable
        sverifySourcesListEntry: %ss'skiping downloadable check (no network)s%s/dists/%s/Release(R?R@RGRFturitdistR(RdtentryR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_sourcesListEntryDownloadables	
cCsvtjd|jjdd}|jjddtsIdtjkr_tjdt}n|t	kr|j
rx]|jjddD]C}||jks|j|jst
|j|jjd	ks|j|jrt
|j|jjd
kr|j|jjd	jdkrtjd|y*t}|j|j|jd
Wnmtk
rtjdd}|d|j7}|d|j7}|d|j7}tddj|nXPqqWn|jjdd}|jgg|D]}d|j|f^q}|jgg|D]}d|j|f^q)}	t|_t}
i|_x|jjD]}|jso|jrqon|jjdr|j |jkrtjd|t	|_qon{|jjdrLt!j"j#d}tj$j%d|t!j&|jd|j dfsotjd|t	|_qoqond|j}
|jr|jjdr|j |
kr|j|_ d g|_'tjd!|qon|jr|jjd"|jrtjd#t	|_qon|jrd$|jkrtjd%xod&t(d'gD]W}t)j)|}||_|j|_ |j*|r,tj+d(|||_Pq,q,Wntjd)t,||j-|j}|p|j.|j}|s|rt	}|js9|j/d*ks9d+|jks9d,|j|j ks9d-|jks9d.|jkrBt}n|j |	krutjd/t,||
|O}
n|j |kr|
|O}
|	|j0|j |_ tjd0t,|nG|j/d*krqon2|rt	|_t	|_tjd1t,|n|j/d2krdd3|jkrd|j1d4ksD|j1d5krdtjd6|j1d7|_nxd8|jd9|jd,|jgD]}|jj2|t3|jr|j |kr|j/d2krx:|j'D],}||krqn|j|j4|qWqqWqo|j |jkr2|j|_ n|j5d:t6d;|j7_5t	|_t	|_tjd<t,|qoWx|jjD]}|js|js|j/d*ks|jjds|j |jkrqn|jj7|j r|j|j|j|j }|rntj+d=t,||j'j8t|tj+d>t,||j|j =qnqqW|
S(?NsrewriteSourcesList()R%t
ComponentstAllowThirdPartyt!RELEASE_UPRADER_ALLOW_THIRD_PARTYs,mirror check skipped, *overriden* via configR2tBaseMetaPkgsiitnows'BaseMetaPkg '%s' has no candidateOrigintmains\get_distro().enable_component("man") failed, overwriting sources.list instead as last resorts"# auto generated by update-managers7deb http://archive.ubuntu.com/ubuntu %s main restricteds?deb http://archive.ubuntu.com/ubuntu %s-updates main restrictedsAdeb http://security.ubuntu.com/ubuntu %s-security main restricteds/etc/apt/sources.listtwtPocketss%s-%sscdrom:s,disabled '%s' cdrom entry (dist == fromDist)sDir::State::listss
%s/%s%s_%s_%stdiststReleases;disabling cdrom source '%s' because it has no  Release files
%s-commercialshttp://archive.canonical.comtpartners transitioned commercial to '%s' s*http://landscape.canonical.com/packages/%ss&commenting landscape.canonical.com outsold-releases.ubuntu.com/s-upgrade from old-releases.ubuntu.com detecteds"http://%sarchive.ubuntu.com/ubuntus http://archive.ubuntu.com/ubuntus%transition from old-release.u.c to %ssexamining: '%s'sdeb-srcs/security.ubuntu.coms%s-securitys/archive.canonical.coms/extras.ubuntu.coms%entry '%s' is already set to new distsentry '%s' updated to new dists&entry '%s' was disabled (unknown dist)tdebsports.ubuntu.comtpowerpctsparcs-moving %s source entry to 'ports.ubuntu.com' s%http://ports.ubuntu.com/ubuntu-ports/s%ss
%s-updatest sdisabled on upgrade to %ss(entry '%s' was disabled (unknown mirror)s)fixing components inconsistency from '%s'sto new entry '%s'(9R?R@RJR\RRXR7RTRsRFRGREt	candidateR{toriginstarchiveRtget_sourcestsourcestenable_componentRRQtopentwriteRPtsources_disabledtfound_componentstlisttinvalidtdisabledRt
startswithRRVRWtfind_dirR9Rt
URItoFileNametcompsRtcopyRRRtisMirrortisThirdPartyMirrorttypetindexRSt
setdefaultRNtaddtcommentRDRUtextend(Rdtmirror_checktsync_componentstpkgnametdistrotstpocketstxt	fromDiststtoDiststfoundToDistRtlistdirtcdistRt
test_entrytvalidMirrortthirdPartyMirrortvalidTotdtcomptcomponent_diff((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytrewriteSourcesLists

	 	

$$		$	




	



				

		

" 		!$cCs8tjdtdd|_|jdts{tjd|jjt	dt	d|j
|jf}|rntdd|_|jdtrx|j
rxt	d}t	d|j
|jf}|jj||s|jntjd	d
}ddg}|jjd
||j||jjd
||jd||jjd
d|jd|qxq{|jn|jj|j|jjytj}|jWnQtk
rtjd|jjt	dt	dtjddgtSX|jr4|jjt	dt	dntS(NsupdateSourcesList()tmatcherPathR RsNo valid mirror foundsVWhile scanning your repository information no mirror entry for the upgrade was found. This can happen if you run a internal mirror or if the mirror information is out of date.

Do you want to rewrite your 'sources.list' file anyway? If you choose 'Yes' here it will update all '%s' to '%s' entries.
If you select 'No' the upgrade will cancel.sGenerate default sources?sAfter scanning your 'sources.list' no valid entry for '%s' was found.

Should default entries for '%s' be added? If you select 'No', the upgrade will cancel.s!generate new default sources.lists http://archive.ubuntu.com/ubuntuRt
restrictedRs-updatess"http://security.ubuntu.com/ubuntu/s	-securitys<Repository information invalid after updating (we broke it!)sRepository information invalidslUpgrading the repository information resulted in a invalid file so a bug reporting process is being started.s
apport-bugsupdate-managersThird party sources disabledsSome third party entries in your sources.list were disabled. You can re-enable them after the upgrade with the 'software-properties' tool or your package manager.(R?R@RRRRFRwRBRRDRPRQRXRGRRRtbackupRLtsaveRVt
SourceListtread_main_listRRRRR(RdRtprimtseconRRtsourceslist((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytupdateSourcesListsP

			

 




	cCsctjdg}g}g}g}g}x|jD]}|jrW|j|jq5|jrs|j|jq5|jr|j|jq5|jr|j	r|j|jq5|jr5|j
r5|j|jq5q5Wtjddj|tjddj|tjddj|tjddj|tjddj|dS(Ns$About to apply the following changessKeep at same version: %sRsUpgradable, but held- back: %ss
Remove: %ssInstall: %ssUpgrade: %s(R?R@REtmarked_installRttnametmarked_upgradet
marked_deletetis_installedt
is_upgradabletmarked_keepR:(Rdtinsttuptrmtheldtkeeptpkg((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_logChangess,
			cCsitjd|jjdt|jjdkrbtjd|jj|j	|j
nt|jjdkr|jj}tddt|}tddt|d	j|}|j	j
||tS|jj|_|jj|j|j|j|_|jr+|jj|_ntjd
dj|jtjddj|jtS(
NtdoPostInitialUpdatetPostInitialUpdateis-packages in reqReinstall state, trying to fixsPackage in inconsistent statesPackages in inconsistent statesThe package '%s' is in an inconsistent state and needs to be reinstalled, but no archive can be found for it. Please reinstall the package manually or remove it from the system.sThe packages '%s' are in an inconsistent state and need to be reinstalled, but no archive can be found for them. Please reinstall the packages manually or remove them from the system.s, sForeign: %sRsObsolete: %s(R?R@RZRnR{REtreqReinstallPkgsRstfixReqReinstRBRRR:RwRXt_getObsoletesPkgst
obsolete_pkgst_getForeignPkgsRRRPRQtforeign_pkgsRtinstalledTasksttasksRF(Rdt	reqreinsttheaderR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyR*s.


$	cCs"tjd||js+tjdtS|jjj|jj}d}|dk	re|}n|j
jdd}xe||kry|jj|Wn=t
tfk
r}tjd||f|d7}q}nXtSWtjd|r|jjtd	td
d|ntS(Ns"running doUpdate() (showErrors=%s)sBdoUpdate() will not use the network because self.useNetwork==falseiR.R/sHIOError/SystemError in cache.update(): '%s'. Retrying (currentRetry: %s)isdoUpdate() failed completelysError during updatesA problem occurred during the update. This is usually some sort of network problem, please check your network connection and retry.s%s(R?R@RGRFREt_listRRBRR6RJR[tupdateRtIOErrorRwRDRX(Rdt
showErrorstforceRetriesRtcurrentRetryRhR}((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytdoUpdate?s0	
	

	cCstd}td}|jjddtrAtjdtS|j}y|jj	|WnWt
k
r}x@|jD]5}|jj
|||j|j|j|jfq}WtSXtS(s: this checks if we have enough free space on /var and /usrsNot enough free disk spacesThe upgrade has aborted. The upgrade needs a total of %s free space on disk '%s'. Please free at least an additional %s of disk space on '%s'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.t	FreeSpacet	SkipChecks,free space check skipped via config override(RDRJRRXR?RsRFt _is_apt_btrfs_snapshot_supportedREtcheckFreeSpaceRtfree_space_required_listRBRwt
size_totaltdirtsize_needed(Rdterr_sumterr_longtwith_snapshotsR}trequired((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_checkFreeSpace`s 
cCsi|jjtd|jj|j|j|js;tS|jr`|jj|j	s`tSn|jj
}|jj|j|jj|j
stS|jj|jj|_t|jdkr.|jjtjddjg|jD]}|j^qtjd|jn|jj|jjtd||j|jj}|S(NsCalculating the changesis
demoted: '%s'Rsfound components: %ss!Do you want to start the upgrade?(RBRCRDREtdistUpgradeRRYRXtinstallTasksR3tget_changesRR)RItget_installed_demoted_packagestinstalled_demotionsR{tsortR?R@R:RRtconfirmChangestrequiredDownload(RdtchangesRR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytaskDistUpgrades0!	




3
cCsCtjjdr?tjdt|jtjddndS(Ns/etc/cron.daily/aptsdisabling apt cron job (%s)i(R7R9RR?R@toctRctchmod(Rd((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_disableAptCronJobscCs9tjjdr5tjdtjd|jndS(Ns/etc/cron.daily/aptsenabling apt cron job(R7R9RR?R@RURc(Rd((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_enableAptCronJobs
c
Cs|jd}|jj}|jjddd}|ry!tjdjdd}Wnt	j
dd}nX|jjjd||fn|jj
dd	}t}x||krmy;tj|jj}tj|}|jj||Wnctjjk
r2}	t	jd
t}Pn7tk
rh}	t	jd|	|f|d7}qnXtSW|r|jjtd
tdn3t	jd|jjtdtdd|	|j|jdS(NiR2tSlideshowUrlRDtgetdefaultlocaletens%s#locale=%sR.R/s
user canceleds:IOError in cache.commit(): '%s'. Retrying (currentTry: %s)isUpgrade canceledswThe upgrade will cancel now and the original system state will be restored. You can resume the upgrade at a later time.s+giving up on fetching after maximum retriessCould not download the upgradessThe upgrade has aborted. Please check your Internet connection or installation media and try again. All files downloaded so far have been kept.s%s(RVRBRRJRR6tlocaleRYtsplitR?t	exceptiontgetHtmlViewRR[RXRVtPackageManagerREt	_depcachetAcquiret_fetch_archivestapttFetchCancelledExceptionRRFR8RwRRDRWR(
RdR;t	fprogressturltlangRht
user_canceledtpmRR}((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytdoDistUpgradeFetchingsH
!

#


	
s/etc/default/apportcCstjddddgdS(s enable apport tservicetapporttstarts
force_start=1N(RRv(Rdtfname((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytenableApportscCsnyddl}Wntk
r$dSXy|j}|j}WntjdtSXtjd||S(s' check if apt-btrfs-snapshot is usable iNsfailed to check btrfs supports!apt btrfs snapshots supported: %s(tapt_btrfs_snapshottImportErrortAptBtrfsSnapshottsnapshots_supportedR?R]RXR@(RdRpt	apt_btrfsR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyR?s

cCs_|jsdSddl}|j}d|j}|j|}tjd||fdS(s2 create btrfs snapshot (if btrfs layout is there) Nisrelease-upgrade-%s-s#creating snapshot '%s' (success=%s)(R?RpRrRQtcreate_btrfs_root_snapshotR?R(RdRpRttprefixR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt _maybe_create_apt_btrfs_snapshots
cCs|jjddtr%|jnd}|jj}|jj|j}|jjdd}|j	s|j
jd|jnt}x||krBy*|jj
||}tjd|Wnhtk
ro}tjd|tjjd	rtd	j}tjd
|ddg}x|D]}t|j|r4tjd
|jtd}	|	dt|7}	|	td7}	|jjtd|	|jq4q4Wntd}	|j	sts|	td|7}	qn|jjtd|	dddg}
tjjddkrK|
jdn|jj j!|
|jtSt"k
r}tjd||f|d7}qnt#k
r3}tj$d|j%dkr4|jtd}	|	dt|7}	|	td7}	|jjtd|	|jq4nX|jt&SWtjd|jjtdtd d!||jdS("NR2tEnableApportiR.R/tStartUpgradescache.commit() returned %ss#SystemError from cache.commit(): %ss%/var/run/update-manager-apt-exceptionsfound exception: '%s's;E:Internal Error, Could not perform immediate configurations E:Couldn't configure pre-depend s-detected preconfigure error, restorting statesError during commits
'%s'
sRestoring original system statesCould not install the upgradessrThe upgrade has aborted. Your system could be in an unusable state. A recovery will run now (dpkg --configure -a).s

Please report this bug in a browser at http://bugs.launchpad.net/ubuntu/+source/update-manager/+filebug and attach the files in /var/log/dist-upgrade/ to the bug report.
%stdpkgs--configures-aRlRms--force-confolds:IOError in cache.commit(): '%s'. Retrying (currentTry: %s)iscache.commit()is+giving up on fetching after maximum retriessCould not download the upgradessdThe upgrade has aborted. Please check your Internet connection or installation media and try again. s%s('RJRRXRoRBRtgetInstallProgressRER[RYRZRnRwtcommitR?R@RRwR7R9RRtreadRORRWRDRRRTRKRtRuRvR8RR]terrnoRF(RdR;Ret	iprogressRhRR}tpre_configure_errorst
preconf_errortmsgR~((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt
doDistUpgrades|
	
	


			





	cCs\|j|jjd|jj}|jj|j|j|j}t	j
ddj|t	j
ddj|xG|jj
ddD]0}||krt	jd|t}PqqW|jjddtst	j
d	tSxa|jj
dd
D]J}|jj|r|j|jr|jj|jj
|dqqW|jj|jjt	j
d|j|jr||j}n%tg|jD]}|j^q}|t|jO}|jj}t	j
d
dj||t|O}|jjddts<t	j
dt}nt	j
d|t	j
d|jj}xt|D]z\}}	|j|t t!|d|	|j"krv|jj#|jj$|	||j"st	j
d|	qqvqvWt	j
d|j%|jj&}
t	j
ddjg|
D]}|j^q0t'd}t'dt'dg}t!|
dkr2|jj(||
gd|t)r2|jj*}
|jj+|j}y|jj,|
|Wq2t-t.fk
r.}t	jd||jjt'dt'dd|q2Xn|jjd|j/sX|j0ntS(NtPostUpgradesObsolete: %sRsForeign: %sR2RsXthe BaseMetaPkg '%s' is in the obsolete list, something is wrong, ignoring the obsoletestRemoveObsoletessSkipping obsolete RemovaltMetaPkgsR3sforced_obsoletes: %ssUnused dependencies: %ss0Skipping RemoveObsoletes as stated in the configsremove_candidates: '%s's Start checking for obsolete pkgsgY@s:'%s' scheduled for remove but not safe to remove, skippings!Finish checking for obsolete pkgss1The following packages are marked for removal: %ssRemove obsolete packages?t_Keept_Removeis,cache.commit() in doPostUpgrade() failed: %ssError during commits[A problem occurred during the clean-up. Please see the below message for more information. s%stPostCleanup(1RRZRnRER.R0RRRPRQR?R@R:RJR\RwRNRRFRUR R]RtidentifyObsoleteKernelsRGR/RNRt_getUnusedDependenciesRBRqt	enumerateR7tfloatR{R1RttryMarkObsoleteForRemovaltdoneRLRDRPRXRR{R|RR8RYtrunPostInstallScripts(Rdtnow_obsoletetnow_foreignR(tremove_candidatestptunused_dependenciesRtiRRRRtactionsReRR}((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt
doPostUpgradewsv
!	
"&	%

!


0!		
cCsx|jjddD]}tjj|sEtjd|qntjd|y-t||j	j
j|gdtWqt
k
r}tjd||fqXqWdS(s| 
        scripts that are run in any case after the distupgrade finished 
        whether or not it was successful
        R2tPostInstallScriptss!PostInstallScript: '%s' not foundsRunning PostInstallScript: '%s'thiddens(got error from PostInstallScript %s (%s)N(RJR\R7R9RR?RsR@RRBRuRvRFt	ExceptionRw(RdtscriptR}((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRs
#cCstjdt|dr2|jj|jnt|drW|jj|jn|jj	t
d|jj|jt
jddS(s2 abort the upgrade, cleanup (as much as possible) sabort calledRRIsRestoring original system stateiN(R?R@thasattrRtrestore_backupRLRIt
restoreBackupRBRCRDRRRxRy(Rd((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRs


c	Csxtj|D]}tjd|x|D]}|d}|d}|d}|jj|sytjd|tS|j|}|j}|dkr.tj
|||tkr.tSq.WqWtjd|tS(s+ check if a given depends can be satisfied schecking: '%s' iiis_checkDep: '%s' not in cachesdepends '%s' is not satisfiedN(RVtParseDependsR?R@RERURwRXtinstalledVersionR6tCheckDepRF(	Rdtdepstrtor_grouptdeptdepnametvertoperR#tinstver((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt	_checkDeps 




	cCstjdt}|jjdd}|j|jj|jjjdxj|D]b}tjd|||j	|M}|sT|jj
tdtd|tj
dqTqTW|S(s  check if depends are satisfied scheckViewDepends()RtDependss
depends: '%s's!Required depends is not installeds/The required dependency '%s' is not installed. i(R?R@RFRJR\RRBRARRRwRDRxRy(RdRtdependsR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRs


cCs#|jjdd}d}tjjdd}|jjdd}x||kr|jdt|jx=|D]5}|j	j
|sutjd	|t
|ququW|j|rPntjd
tjjdd|d7}qHW||krtjd
tStjjd|tS(NtPreRequiststPackagesisAcquire::http::No-CacheR1R.R/R9sCan not find backport '%s's>setting a cache control header to turn off caching temporarilyttrueis+pre-requists item is NOT trusted, giving up(RJR\RVRWtfindR[R<RXRRERUR?RwRt_allBackportsAuthenticatedR@RNRF(Rdt
backportslistRtnoCacheRhR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_verifyBackportss*



cCstjjdttkr,tjdtSy#|jjdd}|rNtSWnt	j
k
renXxP|D]H}|j|}|jstSx%|jj
D]}|jrPqqWtSqmWtS(NsAPT::Get::AllowUnauthenticatedsIskip authentication check because of APT::Get::AllowUnauthenticated==trueR2tAllowUnauthenticated(RVRWtfind_bRXRFR?RsRJt
getbooleanRRRERRttrusted(RdRtbRR(tcand((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyR:s$


		c
Cs|jd}t|\}}}}}d|krL|jdd}nd|||f}xj|jD]_}|jd}t||rtS|jdd}	|j|	ritjd|tSqiWt	S(s  check if uri is a known mirror t/t@is	%s://%s%ss//s)found apt-cacher/apt-torrent style uri %s(
trstripR
R\R_RRFtendswithR?R@RX(
RdRtraw_uritschemetnetlocR9tquerytfragmenttmirrortmirror_host_part((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRPscCsI|jd}x3|jD](}|jd}t||rtSqWtS(s2 check if uri is a whitelisted third-party mirror R(RR`RRFRX(RdRR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRfscCsd}tdd}x|jD]}|js|jr=qn|jdkr|jtkr|j|jrd|jkrd|j	|j
kr|jjdr|jjdrd	|j|j	f}||kr||7}qqqW|S(
s7 get sources.list snippet lines for the current mirror tRR RRs
%s-updatesshttp://security.ubuntu.comshttp://archive.ubuntu.comsdeb %s %s-updates main
(RRRRRRXRRRRPRR(RdtdumbtlinesRRtnew_line((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_getPreReqMirrorLinesos cCstjd|t|d}|j|}xPt|D]B}t|}|jd|}|j|tjd|q<W|jtS(s9 add prerequists based on template into the path outfile s*writing prerequists sources.list at: '%s' RRsadding '%s' prerequists(	R?R@RRR	tsafe_substituteRtcloseRF(RdttemplatetoutRtoutfiletmirrorlinestlinetoutline((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt_addPreRequistsSourcesLists

cCs
tjdt}tjjtjd}tjj|sPtj|n|j	j
dd}|jr4|jr4tjdtjj|jj
dtjjd}t}xXtj|dD]C}tjd	||f|jtjj|jd
dqWt|j|sJtjdt||ftS|jjtjd
dgtj|ddtjdtj}d$}x6|d$kr|j }|j!j"t#j$dqW|j!j"dt|jj%tj&d|tjd|j'd|dkr*tS|j(Sd}|j	j)d|d|j*rn|d|j*}n|j	j+d|}tjj|stjd|tStjjtjj,d|}	tjjtjj,d|}
|j-||
y|j.Wn_t/k
rk}|j-||
dty|j.Wn$t/k
rf}tj0d|nXtSXx|D]}|j|}
|jj1j2|
j3}|stjd|tj4|	tS|j5d$krtjd|tj4|	tStjd||
j6dtdtqsWt}y1|jj7|j!j8|j!j9|j}WnSt:k
r}tjd |t}n*t;k
r}tjd!|t}nX|tkrtj0d"nytj4|
Wn$t<k
r}tjd#|nX|j(S(%s5 download the backports specified in DistUpgrade.cfg sgetRequiredBackports()t	backportsRRs#Searching for pre-requists on CDROMs*dists/stable/main/dist-upgrader/binary-%s/sAPT::Architectures*_*.debsfound pre-req '%s' to '%s'RDis%Expected backports: '%s' but got '%s's
/usr/bin/dpkgs-iRtstderrg{Gz?tfinisheds'installing backport debs exit code '%s'sdpkg output:
%sRs-%sssourceslist not found '%s'sDir::Etc::sourcepartsRsno backport for '%s' foundsNo candidate for '%s'sNo ver.FileList for '%s'smarking '%s' for installt	auto_insttauto_fixsfetchArchives returned '%s'sinstallArchives returned '%s's+_fetchArchives for backports returned Falses(failed to unlink pre-requists file: '%s'N(=R?R@RFR7R9R:R8RtmkdirRJR\RIRGRgRVRWRRNRRtbasenameR\tissubsetRwRXRERoRRRtSTDOUTR6tpollRBt
pulseProgressRRtgetLockRRtsetupRequiredBackportst
has_optionRSRKRRRRRsR`tGetCandidateVert_pkgtunlinktFileListtmark_installR|RR{R8RR(RdRRRRt
found_pkgsRtconf_optiontprereq_templatetoutpathRR}RR(R((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytgetRequiredBackportss

	*



 !!



	
cCsdtjd<tjtjddtjdg}|jrP|j	dn
|j	dtj
dttjd	tjtjd	|tjdS(
Ns$/usr/lib/release-upgrader-python-aptt
PYTHONPATHs/var/log/dist-upgrade/main.logs&/var/log/dist-upgrade/main_pre_req.logs--have-prerequistss--with-networks--without-networksrestarting upgraderi(
R7RTR?tshutdowntshutilRRxtargvRGRtRRtexecve(Rdtargs((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRs

		

c	Cs\|jjtd|jjtj|jstjd|jjtdtdt	j
ddgtjdn|j
jdr|jr|jjtkrtjd	|js|jjtd
tdt	j
ddg|jqn|jdtd
d|j|jsE|jn|jjtj|jjtd|js|jn|jr|jj|jr|jjtdtdtjdn|js|jn|jjtd|j|jj|_|j j!x|j
j"ddD]}|jj#|sv|jj$|j|rCtjd||jjtdtd|t	j
ddg|jqCqCW|jjtd|j%s|jn|jjtj&|jjtd|j's?|jn|jjtj(|jjtd|j)s|j*|jj+tdtdtjdn|jjtj,|jjtd|j-|jr|jj.n|jjtj/|jjtdt0rX|jj1rXt	j
dtjdnt2S(NsChecking package managersself.prepared() failedsPreparing the upgrade failedsXPreparing the system for the upgrade failed so a bug reporting process is being started.s
apport-bugsupdate-manageriRsneed backportss$Getting upgrade prerequisites failedsThe system was unable to get the prerequisites for the upgrade. The upgrade will abort now and restore the original system state.

Additionally, a bug reporting process is being started.R9R:sUpdating repository informationsFailed to add the cdroms+Sorry, adding the cdrom was not successful.R2Rs@No '%s' available/downloadable after sources.list rewrite+updatesInvalid package informationsAfter updating your package information, the essential package '%s' could not be located. This may be because you have no official mirrors listed in your software sources, or because of excessive load on the mirror you are using. See /etc/apt/sources.list for the current list of configured software sources.
In the case of an overloaded mirror, you may want to try the upgrade again later.sCalculating the changestFetchingt	UpgradingsUpgrade completesKThe upgrade has completed but there were errors during the upgrade process.sSearching for obsolete softwaresSystem upgrade is complete.s/sbin/rebooti(3RBRCRDtsetSteptDistUpgradeViewtSTEP_PREPARERR?RwRRRxRyRJRaR<RRXR@RRR<RR*tSTEP_MODIFY_SOURCESRRIRRLRERRRZt+ensure_recommends_are_installed_on_desktopsR\RUtanyVersionDownloadableRSt
STEP_FETCHRjtSTEP_INSTALLRRRtSTEP_CLEANUPRtcomment_out_cdrom_entrytSTEP_REBOOTRtconfirmRestartRF(RdR(((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytfullUpgrade#s

	




	



	




	

cCs|jj|jS(N(RBRR(Rd((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRns
cCsddlm}m}m}m}m}m}|jj||jj	||jj	|t
|_|j|j
stS|jstS|jj||jjtd|jstS|jj||jjtd|js|jjtdtdtS|jj||js[|jjtdtdtStjjtr|jjrtjdqn|jjtdtdt
S(	s, partial upgrade mode, useful for repairing i(RRRRRRRRsUpgrade completesKThe upgrade has completed but there were errors during the upgrade process.s/sbin/reboots"The partial upgrade was completed.(tDistUpgrade.DistUpgradeViewRRRRRRRBRthideStepRFRYRR*RXRSRCRDRjRRRR7R9RtREBOOT_REQUIRED_FILERRR(RdRRRRRR((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pytdoPartialUpgrades>.	



N(,RRt__doc__R6RjRFRRRRRRRRRR)R*R<RIRSRVRWRjRoR?RwRRRRRRRRRRRXRRRRRRnR(((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyRQsN`'		;			~		O		%!		'			C		
	e	b		
								y			t__main__(tDistUpgradeViewTexttlevel(Etwarningstfilterwarningst
FutureWarningRcRVRxR7RR[R?RRRRRtutilsRRRRRRRRtstringR	turlparseR
RtDistUpgradeCacheRtDistUpgradeConfigParserRR
tDistUpgradeAptCdromRtDistUpgradeAufsRRtdistinfoRtDistInfoRRRRRtDistUpgradeGettextRRDRRRRtDistUpgradeApportRRRRtobjectRRRtbasicConfigtDEBUGtvtdcRVRW(((sE/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeController.pyt<module>s`: