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


Oc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZm
Z
ddlmZddlmZmZddlmZddlmZdefdYZdS(	iN(tPIPEtPopen(tmd5(tlsmodtget_arch(tgettext(t
PluginManagertDistUpgradeQuirkscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$d%Z&d&Z'd'Z(d(Z)d)Z*d*Z+d+Z,d,Z-d-Z.d.Z/d/Z0d0Z1d1Z2d2Z3d3Z4d4Z5d5Z6d6Z7d7Z8d$d8Z9d9Z:d:Z;d;Z<d<d=Z=d>Z>d?Z?d@Z@dAdBZAdLdCZCdDZDdEZEdFZFdGZGdHdIZHdJZIdKZJRS(Ms
    This class collects the various quirks handlers that can
    be hooked into to fix/work around issues that the individual
    releases have
    cCsq||_|j|_||_tddgdtjdj|_t|_	t
|jdg|_dS(Ntunames-rtstdoutis	./plugins(t
controllert_viewtconfigRRtcommunicatetstripRRtarchRtplugin_manager(tselfR
R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyt__init__0s		+cCs|jjrtjddSx|d|jjdd|fd|jjdd|fgD]>}x5|jj|D]!}tjd||j	qxWq_Wd	|}t
||d}|dk	rtjd
||nd|jjdd|f}t
||d}|dk	r<tjd
||nd|jjdd|f}t
||d}|dk	rtjd
||ndS(s
        Run the specific quirks handler, the follow handlers are supported:
        - PreCacheOpen: run *before* the apt cache is opened the first time
                        to set options that affect the cache
        - PostInitialUpdate: run *before* the sources.list is rewritten but
                             after a initial apt-get update
        - PostDistUpgradeCache: run *after* the dist-upgrade was calculated
                                in the cache
        - StartUpgrade: before the first package gets installed (but the
                        download is finished)
        - PostUpgrade: run *after* the upgrade is finished successfully and 
                       packages got installed
        - PostCleanup: run *after* the cleanup (orphaned etc) is finished
        s)not running quirks in partialUpgrade modeNs%s%stSourcestTos	from_%s%stFromsrunning quirks plugin %ss%ssquirks: running %s(R
t_partialUpgradetloggingtinfoRtgetRtget_pluginstdebugtdo_cleanup_crufttgetattrtNone(Rt
quirksNamet	conditiontplugintfuncnametfunc((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytrun<s2
&


cCstjddS(s3 run before the apt cache is opened the first time srunning Quirks.PreCacheOpenN(RR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytPreCacheOpenoscCsntjdtjjjddkrjtjdtjjjddtjjjdtdndS(Ns"running Quirks.oneiricPreCacheOpensApt::Architecturetamd64s5multiarch: enabling i386 as a additional architecturesApt::Architectures::ti386sAPT::Cache-Starti0iii(RRtapttapt_pkgRtfindtsettstr(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytoneiricPreCacheOpenss


cCstjddS(s run after cleanup srunning Quirks.PostCleanupN(RR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytPostCleanupscCs%tjd|j|jdS(s5 this works around quirks for dapper->hardy upgrades s,running Controller.from_dapperQuirks handlerN(RRt
_rewriteFstabt_checkAdminGroup(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytfrom_dapperPostUpgrades

cCstjd|jdS(s4 this applies rules for the hardy->intrepid upgrade s)running Controller.intrepidQuirks handlerN(RRt_addRelatimeToFstab(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytintrepidPostUpgrades
cCstjddS(s@ this function works around quirks in the feisty->gutsy upgrade s&running Controller.gutsyQuirks handlerN(RR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytgutsyPostUpgradescCs%tjd|j|jdS(s? this function works around quirks in the edgy->feisty upgrade s'running Controller.feistyQuirks handlerN(RRR/R0(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytfeistyPostUpgrades

cCs%tjd|j|jdS(sA this function works around quirks in the jaunty->karmic upgrade s,running Controller.karmicPostUpgrade handlerN(RRt_ntfsFstabFixupt_checkLanguageSupport(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytkarmicPostUpgrades

cCs5tjdtjjj|j|jdS(s Quirks that are run before the sources.list is updated to the
            new distribution when upgrading from a lucid system (either
            to maverick or the new LTS)
        s
running %sN(RRtsyst	_getframetf_codetco_namet_test_and_fail_on_non_i686t_test_and_warn_on_i8xx(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytfrom_lucidPostInitialUpdates
cCs|jdS(N(R>(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytoneiricPostInitialUpdatescCs?tjdtjjj|j|j|jdS(sA quirks that are run before the sources.list is updated to lucid s
running %sN(	RRR9R:R;R<t_test_and_fail_on_non_arm_v6t_test_and_warn_if_vservert'_test_and_warn_on_dropped_fglrx_support(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytlucidPostInitialUpdates

cCs,|j|j|j|jdS(N(thardyPostDistUpgradeCachetgutsyPostDistUpgradeCachetfeistyPostDistUpgradeCachetedgyPostDistUpgradeCache(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytfrom_dapperPostDistUpgradeCaches


cCstjdtjjj|j|j|jrytj	d|j
j	tdtd|jj
n|j|j|j|jdS(s: this function works around quirks in upgrades from hardy s
running %ssevms in use in /etc/fstabsevms in usesYour system uses the 'evms' volume manager in /proc/mounts. The 'evms' software is no longer supported, please switch it off and run the upgrade again when this is done.N(RRR9R:R;R<t_kernel386TransitionCheckt_kubuntuDesktopTransitiont_usesEvmsInMountsterrorRt_R
tabortt_checkAndInstallBroadcomt"_dealWithLanguageSupportTransitiont_test_and_warn_on_old_nvidiat#_test_and_warn_on_nvidia_and_no_sse(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytfrom_hardyPostDistUpgradeCaches






cCs|jdS(so
        this function works around quirks in the 
        maverick -> natty cache upgrade calculation
        N(t%_add_kdegames_card_extra_if_installed(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytnattyPostDistUpgradeCachescCs|j|jdS(sg
        this function works around quirks in the 
        lucid->maverick upgrade calculation
        N(t_add_extras_repositoryt_gutenprint_fixup(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytmaverickPostDistUpgradeCaches
cCs,|j|j|j|jdS(sg 
        this function works around quirks in the 
        jaunty->karmic upgrade calculation
        N(RPRQRJt_mysqlClusterCheck(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytkarmicPostDistUpgradeCaches


cCsMtjdtjjjxudgD]j}|jjj|r'|jj|j	r'|jj|j
r'tjd||jj|jq'q'WxddgD]}|jjj|r|jj|j	r|jj|j
rtjd||jjjdr.tjd|jjdjn|jj|jqqWd	S(
si 
        this function works around quirks in the 
        intrepid->jaunty upgrade calculation
        s
running %sspidgin-libnotifysforcing '%s' upgradetgwenviewtdigikamsforcing libkipi '%s' upgradetlibkipi0sremoving  libkipi0)N(
RRR9R:R;R<R
tcachethas_keytis_installedtmarked_upgradetmark_upgradetmark_delete(Rtpkg((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytjauntyPostDistUpgradeCaches 
cCstjdtjjjd}d}|jjj|r|jj|j	r|jjj|r|jjj
|dndS(s] 
        this function works around quirks in the 
        hardy->intrepid upgrade 
        s
running %sskdelibs4-devskdelibs5-devs'kdelibs4-dev -> kdelibs5-dev transitionN(RRR9R:R;R<R
R_R`Ratmark_install(Rtfromptto((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytintrepidPostDistUpgradeCache
scCsDtjdtjjj|jjjdr|jjdj	r|jjdj
rxMdD]E}|jjj|r`|jj|j	r`|jj|jq`q`W|jjdjn|j
|jjdddkr@xX|jjD]G}|jjdr|j	r|j
r|jjj|jdqqWnd	S(
sc 
        this function works around quirks in the 
        {dapper,gutsy}->hardy upgrade 
        s
running %stnautilusslink-monitor-applettOptionstwithNetworktTrueslanguage-support-sextra language-support- kickN(RRR9R:R;R<R
R_R`RaRbRdRgt_checkAndRemoveEvmsRRtnamet
startswith(RtbrokenRe((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyREs
(
	
c
Cstjdtjjjy|jjd\}}}|dks_|dks_|dkrd}|jj	|j
p|jj	|jstjd||jj	|jqnWn$t
k
r}tjd|nXyxttjtd	D]}|d
ks|jdr!qny"|j\}}}	}
}}Wn't
k
rl}tjd|qnXd
|	krtjd||jj	djPqqWWn$t
k
r}tjd|nXdS(s@ this function works around quirks in the feisty->gutsy upgrade s
running %st-t
lowlatencyt686tk7slinux-image-genericsSelecting new kernel '%s's2problem while transitioning lowlatency kernel (%s)s/proc/mountstt#scan't parse line '%s'tnfss=found nfs mount in line '%s', marking nfs-common for install s
nfs-commons9problem while transitioning util-linux -> nfs-common (%s)N(RRR9R:R;R<RtsplitR
R_Ratmarked_installRgt	ExceptiontwarningtmaptstringRtopenRqRM(
Rtversiontbuildtflavourtkerneltetlinetdevicetmount_pointtfstypetoptionstatb((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRF7s6&"cCstjdtjjjxdgD]\}}|jjj|r'|jjj|r'|jj|j	r|jj|j
ry$|jjj|d||fWqtk
r}tj
d|||fqXqq'q'WdS(s? this function works around quirks in the edgy->feisty upgrade s
running %ssndiswrapper-utils-1.8sndiswrapper-utils-1.9s%s->%s quirk upgrade rules#Failed to apply %s->%s install (%s)N(sndiswrapper-utils-1.8sndiswrapper-utils-1.9(RRR9R:R;R<R
R_R`RaR{RgtSystemErrorR}(RtfrRiR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRGWs*'$cCstjdtjjjxN|jjD]@}|jj	dr|j
r|jrd|jtd}|jjj
|r|jj|jr|jj|jry|jjj|dWqtk
r}tjd||fqXqn|jj	dr*|j
r*|jr*y|jjj|jdWqjtk
rf}tjd|j|fqjXq*q*Wxd	d
dgD]}|jjj
|r~|jj|j
r~|jj|jr~|jj|jr~y|jjj|d|Wq!tk
r}tjd
||fq!Xq~q~W|jjj
dr|jjd}|j|jkrd|jkrx|jjD]}d|jkrxxn|jD]`\}}|jjjj|}|r|jrtjd|jjjj|j|PqqWqxqxWqnxdgD]\}	}
|jjj
|	r|jjj
|
r|jj|	j
r|jj|
jry$|jjj|
d|	|
fWqtk
r}tjd|	|
|fqXqqqWdS(s? this function works around quirks in the dapper->edgy upgrade s
running %ss
python2.4-spython-spython2.4->python upgrade rules2Failed to apply python2.4->python install: %s (%s)sxserver-xorg-input-sxserver-xorg-input fixup rulesFailed to apply fixup: %s (%s)thpijstbzrttomboys%s quirk upgrade rulesFailed to apply %s install (%s)slibgl1-mesa-dris+cvs2006s~2006s@Forcing downgrade of libgl1-mesa-dri for xgl.compz.info installssxserver-xorg-driver-allsxserver-xorg-video-alls%s->%s quirk upgrade rules#Failed to apply %s->%s install (%s)N(sxserver-xorg-driver-allsxserver-xorg-video-all(RRR9R:R;R<R
R_RpRqRaRbtlenR`tcandidateDownloadableR{RgRtisUpgradabletcandidateVersiontinstalledVersiont_pkgtVersionListtVerStrtFileListt_listt	FindIndext	IsTrustedRt	_depcachetSetCandidateVer(RRetbasepkgRtpkgnametvertVerFileItertindext	indexfileRRi((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRHds^	
!	
%('"
*'$cCstjdtjjj|jjjdr|jjdj	r|jjjdr|jjdj	rtjd|jjj
d|jjjdndS(sA this function works around quirks in the breezy->dapper upgrade s
running %ss
nvidia-glxsnvidia-settingss+nvidia-settings and nvidia-glx is installedN(RRR9R:R;R<R
R_R`Ratmark_removeRg(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytdapperPostDistUpgradeCaches((
cCsT|j|j|j|j|j|j|j|jdS(N(t
_applyPatchest_removeOldApportCrashest_removeBadMaintainerScriptst_killUpdateNotifiert_killKBluetootht_killScreensavert_pokeScreensavert_stopDocvertConverter(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytStartUpgrades






cCstjdtjjdrtjjdrd}tjj|sZtj|ntjd|tjd|tjtjj	|ddnt
jjj
dd	kr|jd
dndS(Nsoneiric StartUpgrade quirkss/usr/sbin/update-grubs%/etc/kernel/postinst.d/zz-update-grubs/etc/kernel/postinst.dscopying zz-update-grub into %sszz-update-grubisApt::ArchitectureR&tforeign_archR'(RRtostpathtexiststmakedirstshutiltcopytchmodtjoinR(R)RR*t_enable_multiarch(Rt	targetdir((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytoneiricStartUpgrades
"cCstjd|jdS(Nsfrom_hardyStartUpgrade quirks(RRt
_stopApparmor(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytfrom_hardyStartUpgrades
cCst|jd}tjj|rpd}tt|jj|krptj	d|tj
|qpndS(Ns/var/lib/dpkg/info/hal.postinstt 146145275900af343d990a4dea968d7csremoving bad script '%s'(t_createPycentralPkgRemoveRRRRRtreadt	hexdigestRRtunlink(Rtaptmd5sum((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pytjauntyStartUpgrades
$cCst}y"tjddgdtj}Wntk
r?|SXxA|jdjdD]&}|rZ|j|jdqZqZW|S(s8 return a set of pci ids of the system (using lspci -n) tlspcis-nR	is
i(R+t
subprocessRRtOSErrorR
Rztadd(RRtpR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyt_get_pci_idss	"
 cCsdddddddg}|j}t|j|r||jjtdtd	}|tkr||jjq|ndS(
Ns	8086:7121s	8086:7125s	8086:1132s	8086:3577s	8086:2562s	8086:3582s	8086:2572sFYour graphics hardware may not be fully supported in Ubuntu 12.04 LTS.sThe support in Ubuntu 12.04 LTS for your Intel graphics hardware is limited and you may encounter problems after the upgrade. For more information see https://wiki.ubuntu.com/X/Bugs/UpdateManagerWarningForI8xx Do you want to continue with the upgrade?(	RR+tintersectionRtaskYesNoQuestionRNtFalseR
RO(RtI8XX_PCI_IDSRtres((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR>s			cCs|jj}xdddgD]}|j|r||jr|jdrtjd||jstjd|j	j
tdtd}|tkr|jj
n|jj|jqqqWd	S(
s The current 
        snvidia-glx-180snvidia-glx-185snvidia-glx-195tnvidiasfound %s video drivers7nvidia driver that needs SSE but cpu has no SSE supportshUpgrading may reduce desktop effects, and performance in games and other graphically intensive programs.sThis computer is currently using the NVIDIA 'nvidia' graphics driver. No version of this driver is available that works with your video card in Ubuntu 10.04 LTS.

Do you want to continue?N(R
R_R`R{t_checkVideoDriverRRt_cpuHasSSESupportR}RRRNRROt	mark_keep(RR_RR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRSs

cCs|jj}xddgD]}|j|r||jr|jdrtjd||jjt	dt	d}|t
kr|jjn|jj|jqqWdS(s? nvidia-glx-71 and -96 are no longer in the archive since 8.10 s
nvidia-glx-71s
nvidia-glx-96Rsfound %s video drivershUpgrading may reduce desktop effects, and performance in games and other graphically intensive programs.sThis computer is currently using the NVIDIA 'nvidia' graphics driver. No version of this driver is available that works with your video card in Ubuntu 10.04 LTS.

Do you want to continue?N(
R
R_R`R{RRRRRRNRROR(RR_RR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRRs
cCs|jdr|jdr|jjtdtd}|tkr\|jjntj	d|jj
jdd}|jd|jd|jd	|jd
|jd|jd|jj
j
ddd
j|ndS(si
        Some cards are no longer supported by fglrx. Check if that
        is the case and warn
        tfglrxshUpgrading may reduce desktop effects, and performance in games and other graphically intensive programs.sThis computer is currently using the AMD 'fglrx' graphics driver. No version of this driver is available that works with your hardware in Ubuntu 10.04 LTS.

Do you want to continue?sCremove xorg-driver-fglrx,xorg-driver-fglrx-envy,fglrx-kernel-sourcetDistrotPostUpgradePurgesxorg-driver-fglrxsxorg-driver-fglrx-envysfglrx-kernel-sourcesfglrx-amdccclesxorg-driver-fglrx-devtlibamdxvba1t,N(Rt_supportInModaliasesRRRNRR
RORRRtgetlisttappendR+R(RRtl((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRC6s






cCsw|jdkrstjd|jsstjdtd}td}|jj|||jjqsndS(s
        Test and fail if the cpu is not i686 or more or if its a newer
        CPU but does not have the cmov feature (LP: #587186)
        R'schecking for i586 CPUsnot a i686 or no cmovsNo i686 CPUsYour system uses an i586 CPU or a CPU that does not have the 'cmov' extension. All packages were built with optimizations requiring i686 as the minimal architecture. It is not possible to upgrade your system to a new Ubuntu release with this hardware.N(	RRRt_cpu_is_i686_and_has_cmovRMRNRR
RO(Rtsummarytmsg((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR=Ws

s
/proc/cpuinfocCstjj|s'tjd|tSt|j}tj	d|tj
rbtjdtStj	d|tj
}|rd|j
djkrtjd|j
dtjdtSntS(	Nscannot open %s ?!?s^cpu family\s*:\s*[345]\s*s found cpu family [345], no i686+s^flags\s*:\s*(.*)tcmovisfound flags '%s'scan not find cmov in flags(RRRRRMRnRRtretsearcht	MULTILINERRtgroupRz(Rtcpuinfo_pathtcpuinfotmatch((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRls

cCsQ|jdkrM|jsM|jjtdtd|jjqMndS(s 
        Test and fail if the cpu is not a arm v6 or greater,
        from 9.10 on we do no longer support those CPUs
        tarmelsNo ARMv6 CPUsYour system uses an ARM CPU that is older than the ARMv6 architecture. All packages in karmic were built with optimizations requiring ARMv6 as the minimal architecture. It is not possible to upgrade your system to a new Ubuntu release with this hardware.N(Rt_checkArmCPURRMRNR
RO(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRAs

cCsyytjddWn^tjd|jjtdtd}|tkrd|jj	n|jj
nXdS(sd
        upstart and vserver environments are not a good match, warn
        if we find one
        iis
no init foundsNo init availablesYour system appears to be a virtualised environment without an init daemon, e.g. Linux-VServer. Ubuntu 10.04 LTS cannot function within this type of environment, requiring an update to your virtual machine configuration first.

Are you sure you want to continue?N(RtkillRtwarnRRRNRR
ROt
processEvents(RR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRBs
		cCst}d}d}|jj|dr|t}xL|jj|dD]2}||jjj|oq|jj|jM}qCWn|rtj	d||f|jj|j
ndS(sy
        check if a key depends of kubuntu-kde4-desktop is installed
        and transition in this case as well
        skubuntu-kde4-desktopskubuntu-desktoptKeyDependenciess(transitioning %s to %s (via key depends)N(RRRRnR
R_R`RaRRRg(Rt
deps_foundtfrompkgttopkgRe((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRKscCsAtjd|jjjdr=|jjdjr=tjddddddg}tjd	||d
kr$tjdxdD]}|jjj|d
|jjj	}xhddgD]Z}|jr|j
|jrtjd|jt
}t}|j|j||qqWqWq=|jjjddndS(si
        check if ndb clustering is used and do not upgrade mysql
        if it is (LP: #450837)
        RZsmysql-servertegreps-qs-is-rs7^[^#]*ndb.connectstring|^[:space:]*\[[:space:]*ndb_mgmds/etc/mysql/segrep returned %sis.mysql clustering in use, do not upgrade to 5.1smysql-clientsclustering in usesmysql-server-5.0smysql-client-5.0smarking '%s' manual installedsno clustering in useN(smysql-serversmysql-client(RRR
R_R`RaRtcallRRtIsAutoInstalledRRpRRntMark_installRc(RtretRetdepcachetautoInstDepstfromUser((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRZs(


$cCsbtjdtjjds0tjdtStd}tj	d|j
tjr^tStS(sE
        parse /proc/cpuinfo and search for ARMv6 or greater
        schecking for ARM CPU versions
/proc/cpuinfoscannot open /proc/cpuinfo ?!?s^Processor\s*:\s*ARMv[45](
RRRRRRMRRRRRRRn(RR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRs

c	Cstjdx|jjD]}|jjj}|jjdr|jrx|jD]}xx|j	D]m}|jj|j}|jrd|j
|jrdtjd|jt}t
}|j|j||qdqdWqTWqqWdS(s
        In karmic the language-support-translations-* metapackages
        are gone and the direct dependencies will get marked for
        auto removal - mark them as manual instead
        s*language-support-translations-* transitionslanguage-support-translationssmarking '%s' manual installedN(RRR
R_RRpRqRatinstalledDependenciestor_dependenciesRRRRnRg(RReRtdp_ortdpnametdpRR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRQs
	cCstjjds#tjddStjdgdtj}x|jdj	D]}|j
jj|rU|j
j|j
rUtjd|d}d	}xUdD]J}tjjtjj||rtjtjj|||dSqWqUqUWdS(
s
        check if the language support is fully installed and if
        not generate a update-notifier note on next login
        s/usr/bin/check-language-supports#no check-language-support availableNscheck-language-supportR	is%language support package '%s' missings/usr/share/language-support/s/var/lib/update-notifier/user.ds&incomplete-language-support-gnome.notes#incomplete-language-support-qt.note(s&incomplete-language-support-gnome.notes#incomplete-language-support-qt.note(RRRRRRRRR
RzR
R_R`RaRRR(RRRtbasettarget((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR7s

!cCs9tjddtkr5|jjjddndS(sr
        check for the 'wl' kernel module and install bcmwl-kernel-source
        if the module is loaded
        schecking for 'wl' moduletwlsbcmwl-kernel-sources'wl' module found in lsmodN(RRRR
R_Rg(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRPs
cCs9tjjdr5tjdtjddgndS(s, /etc/init.d/apparmor stop (see bug #559433)s/etc/init.d/apparmors/etc/init.d/apparmor stoptstopN(RRRRRRR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRs
cCs9tjjdr5tjdtjddgndS(s5 /etc/init.d/docvert-converter stop (see bug #450569)s/etc/init.d/docvert-converters"/etc/init.d/docvert-converter stopRN(RRRRRRR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRs
cCs<tjjdr8tjdtjdddgndS(skill update-notifiers/usr/bin/killallskilling update-notifiertkillalls-qsupdate-notifierN(RRRRRRR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR"s
cCs?tjjdr;tjdtjddddgndS(s3killall kblueplugd kbluetooth (riddel requested it)s/usr/bin/killallskilling kblueplugd kbluetooth4Rs-qt
kblueplugdtkbluetooth4N(RRRRRRR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR(s
cCs<tjjdr8tjdtjdddgndS(skillall gnome-screensaver s/usr/bin/killallskilling gnome-screensaverRs-qsgnome-screensaverN(RRRRRRR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR-s
cCs{tjjdrwtjjdrwtjdy,tjddt	|_
tj|j
WqwtjdqwXndS(Ns/usr/bin/xdg-screensavertDISPLAYs#setup poke timer for the scrensaversMwhile true; do /usr/bin/xdg-screensaver reset >/dev/null 2>&1; sleep 30; donetshells failed to setup screensaver poke(RRRtenvironRRRRRRnt_poketatexittregistert_stopPokeScreensavert	exception(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR2s$
cCsW|jrSt}y |jj|jj}WntjdnXd|_|SdS(Nsfailed to stop screensaver poke(R
Rt	terminatetwaitRRR(RR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR
<s	
	cCsTddg}xA|D]9}tjj|rtjd|tj|qqWdS(s4 remove bad/broken maintainer scripts (last resort) s'/var/lib/dpkg/info/apache2-common.prerms'/var/lib/dpkg/info/pango-libthai.postrmsremoving bad script '%s'N(RRRRRR(Rtbad_scriptsR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRFs	
cCs@tjdtjjds/tjdntdddS(s
        intrepid->jaunty, create /var/lib/pycentral/pkgremove flag file
        to help python-central so that it removes all preinst links
        on upgrade
        sadding pkgremove files/var/lib/pycentral/s/var/lib/pycentrals/var/lib/pycentral/pkgremovetwN(RRRRRRR(R((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRRs
cCsgy<x5tjdD]$}tjd|tj|qWWn$tk
rb}tjd|nXdS(s remove old apport crash files s/var/crash/*.crashsremoving old crash file '%s's+error during unlink of old crash files (%s)N(tglobRRRRR|R}(RtfR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR]scCsPtjj|stSx3t|D]%}|jdr#d|kr#tSq#WtS(s5 helper that checks if the given cpu has sse support tflagss sse(RRRRRRqRn(RRR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRfscCstjdxtdD]}|j}|dks|jdrMqny"|j\}}}}}}Wn%tk
rtjd|qnXd|krtjd|tSqWt	S(s' check if evms is used in /proc/mounts srunning _usesEvmsInMountss/proc/mountsRwRxscan't parse line '%s'tevmss)found evms device in line '%s', skipping (
RRRRRqRzR|RMRnR(RRRRRRRR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRLos
"
c	Cstjd|jrtSxhdddddddd	d
g	D]E}|jjj|r?|jj|jr?|jj|jq?q?Wt	S(s/ check if evms is in use and if not, remove it srunning _checkAndRemoveEvmsRslibevms-2.5slibevms-devsevms-ncursessevms-hasevms-bootdebugsevms-guisevms-clislinux-patch-evms(
RRRLRR
R_R`RaRdRn(RRe((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRos

(c	Cstjdt}g}x#tdD]}|j}|dksS|jdrf|j|q&ny"|j\}}}}}}	Wn2tk
rtj	d||j|q&nXd|ksd|kr.d|kr.d	|kr.tjd
||j
|d|}tjd|t}n|j|q&W|rtjd
tdd}
|
jdj
||
jd|
jtjddntS(s= add the relatime option to ext2/ext3 filesystems on upgrade t_addRelatimes
/etc/fstabRwRxscan't parse line '%s'text2text3tnoatimetrelatimesadding 'relatime' to line '%s' s%s,relatimesreplaced line is '%s' swriting new /etc/fstabs/etc/fstab.intrepidRs
(RRRRRRqRRzR|RMtreplaceRntwriteRtcloseRtrename(RtreplacedtlinesRRRRRRRR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR2s>

"

	


s
/etc/fstabc
Cstjdt}g}x#t|D]}|j}|dksS|jdrf|j|q&ny"|j\}}}}}	}
Wn2tk
rtj	d||j|q&nXd|kr.|
dkr.tjd||ddkr|d d	}n
tj	d
tjd|t
}n|j|q&W|rd}tjd
t||d}|jdj||jd|j
tj|||nt
S(s-change PASS 1 to 0 for ntfs entries (#441242)R6RwRxscan't parse line '%s'tntfst1s%changing PASS for ntfs to 0 for '%s' it0sunexpected value in linesreplaced line is '%s' s.jauntyswriting new /etc/fstabRs
(RRRRRRqRRzR|RMRnRRRRR(
RtfstabR R!RRRRRtfdumptfpasstsuffixR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR6s>

"


	


cCstjdd}g}x5tdD]'}|j}|dksS|jdrf|j|q&ny"|j\}}}}}}	Wn2tk
rtjd||j|q&nXd|kr@|dkr@t	j
jdr@t	j
jd|kr@tjd	||j
|d}tjd
||d7}n|j|q&W|dkrtjdtjdd
tdd}
|
jdj||
jd|
jntS(s> convert /dev/{hd?,scd0} to /dev/cdrom for the feisty upgrade s_rewriteFstab()is
/etc/fstabRwRxscan't parse line '%s'tiso9660s
/dev/cdromsreplacing '%s' sreplaced line is '%s' iswriting new /etc/fstabs/etc/fstab.edgyRs
(RRRRRqRRzR|RMRRRtrealpathRRRRRRRn(RR R!RRRRRRRR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR/s>

"






cCs/tjdddl}y|jdj}Wn:tk
rk}tjd|tjdddgnXy|jdj}Wn%tk
r}tjd|dSXt	j
jd	r+t	j
d	|kr+t	j
d	}tjd
|ddd
d|g}tj|}tjd||fndS(s6 check if the current sudo user is in the admin group R0iNtadminsSystem has no admin group (%s)taddgroups--systems"adding the admin group failed (%s)t	SUDO_USERs"SUDO_USER=%s is not in admin grouptusermods-as-Gscmd: %s returned %i(
RRtgrptgetgrnamtgr_memtKeyErrorR}RRRR	R`R(RR/tadmin_groupRt
admin_usertcmdR((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR0s&

cCs|d}tjj|stSxYt|D]K}|jddj}|jjdr)|j	d|r)t
Sq)WtS(s2 check if the given driver is in use in xorg.conf s/etc/X11/xorg.confRxitdrivers"%s"(RRRRRRzRtlowerRqtendswithRn(RRptXORGRts((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR#ss	./patchesc	Cstjj|s#tjddSxtj|D]}d|kr\tjd|q3ntjd|tj|dd\}}}|jdd}tjd	|||ftjj|stjd
|q3nt	j
}|jt|j
|j|kr.tjd|q3n)|j|krWtjd|q3nd
dlm}y4||tjj|||tjd|Wq3tk
rtjd|q3Xq3WdS(s
        helper that applies the patches in patchdir. the format is
        _path_to_file.md5sum
        
        and it will apply the diff to that file if the md5sum
        matches
        sno patchdirNt.sskipping '%s' (no '.')s'check if patch '%s' needs to be appliediRNt/starget for '%s' is '%s' -> '%s'starget '%s' does not exists%already at target hash, skipping '%s's(unexpected target md5sum, skipping: '%s'i(tpatchsapplied '%s' successfullysed failed for '%s'(RRRRRtlistdirRtrsplitRthashlibRtupdateRRRRtDistUpgradePatcherR=RRR|R(	RtpatchdirRtencoded_pathRt
result_md5sumRRR=((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR0s:
	
c	Cs|s|j}n||jjks;|jj|jrLtjdtS|jj|}x|j|jjD]\}}xr|D]j}t	j
d|}|rd|jd|jdf}|j|krtj
d|tSqqWqrWtj
d|tS(s 
        Check if pkgname will work on this hardware

        This helper will check with the modaliasesdir if the given 
        pkg will work on this hardware (or the hardware given
        via the lspci argument)
        scan not find '%s' in cachespci:v0000(.+)d0000(.+)sv.*s%s:%siis%found system pciid '%s' in modaliasess4checking for %s support in modaliases but none found(RR
R_t	candidateRRRt!_parse_modaliases_from_pkg_headertrecordRRRR7RRn(	RRRRetmodulet
pciid_listtpciidtmtmatchid((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR_s"	
"
"cCsd|krgSg}x|djdD]k}|jd}|sKq*n|jd\}}|j|g|jdD]}|j^qyfq*W|S(sB return a list of (module1, (pciid, ...), (module2, (pciid, ...)))t
Modaliasest)s, t(R(RzRR(Rt	pkgrecordtmodulesRLRItpciidstx((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRG{s9cCstjdxddgD]}|jjj|r|jj|jr|jjj}ddg}xI|D]>}||krmtjd|jjj|drdSqmqmWqqWdS(	s~ test if the current kernel is 386 and if the system is 
            capable of using a generic one instead (#353534)
        RJs	linux-386slinux-image-386s
linux-genericslinux-image-genericsC386 kernel installed, but generic kernel  will work on this machines386 -> generic transitionN(RRR
R_R`RatgetKernelsFromBaseInstallerRg(RRtworking_kernelst
upgrade_to((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRJs


cCstjd|jj}d|kr6tjddS|djpM|djsatjddSyddl}|jj}xg|D]&}d|j	krtjdPqqWtj
d|jd	d
|jjdgd|j
Wntjd
nXdS(NRWsubuntu-extras-keyrings-no ubuntu-extras-keyring, no need to add repos2ubuntu-extras-keyring not installed/marked_installisextras.ubuntu.coms*found extras.ubuntu.com, no need to add its/no extras.ubuntu.com, adding it to sources.listtdebshttp://extras.ubuntu.com/ubuntutmains!Third party developers repositoryserror adding extras.ubuntu.com(RRR
R_R{t	installedtaptsources.sourceslisttsourceslisttSourcesListturiRRttoDisttsaveR(RR_t
aptsourcestsourcestentry((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRWs.







cCspyU|jj}d|krT|djrTd|krTtjd|jddnWntjdnXdS(s foomatic-db-gutenprint get removed during the upgrade,
            replace it with the compressed ijsgutenprint-ppds
            (context is foomatic-db vs foomatic-db-compressed-ppds)
        sfoomatic-db-gutenprintsijsgutenprint-ppdssinstalling ijsgutenprint-ppdss1foomatic-db-gutenprint -> ijsgutenprint-ppds rules_gutenprint_fixup failedN(R
R_t
marked_deleteRRRgR(RR_((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRXs

R'cCs^d}tjj|sZytjdWntk
r<nXt|djd|ndS(s5 enable multiarch via /etc/dpkg/dpkg.cfg.d/multiarch s/etc/dpkg/dpkg.cfg.d/multiarchs/etc/dpkg/dpkg.cfg.d/Rsforeign-architecture %s
N(RRRRRRR(RRtcfg((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRs
cCstyY|jj}d|kp$d|ks+dS|djsE|djrX|jddnWntjdnXdS(s test if kdegames-card-data is installed and if so,
            add kdegames-card-data-extra so that users do not 
            loose functionality (LP: #745396)
        skdegames-card-dataskdegames-card-data-extraNs,kdegames-card-data -> k-c-d-extra transitions,_add_kdegames_card_extra_if_installed failed(R
R_RaR{RgRR(RR_((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyRUs

cCsZddl}|jjsV|jjjdsVtjd|jjjddqVndS(s^ ensure that on a desktop install recommends are installed 
            (LP: #759262)
        iNsApt::Install-RecommendssFApt::Install-Recommends was disabled, enabling it just for the upgradeR#(	R(R
t
serverModeR)Rtfind_bRRR+(RR(((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyt+ensure_recommends_are_installed_on_desktopss

N(Kt__name__t
__module__t__doc__RR$R%R-R.R1R3R4R5R8R?R@RDRIRTRVRYR[RfRjRERFRGRHRRRRRRR>RSRRRCR=RRARBRKRZRRQR7RPRRRRRRR
RRRRRLRoR2R6R/R0RRRRRGRJRWRXRRURh(((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyR)s		3									
											 	
	=	
										!					 	
			
						
	
								$&	/		
/				
	(R(RRRRtos.pathRR@RRR9RRRRtutilsRRtDistUpgradeGettextRRNtcomputerjanitor.pluginRtobjectR(((sA/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeQuirks.pyt<module>s"