Your IP : 172.28.240.42


Current Path : /usr/share/apport/general-hooks/
Upload File :
Current File : //usr/share/apport/general-hooks/ubuntu.pyc


Yc@s@dZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlTddlm
ZdZdZd	Zd
ZdZdZd
ZdZdZdZdZedkr<ddlZeejdkr@ejdejdIJejdnejdZ ej!Z"e"j#e$e e%e"j&Z'e"j(Z)ee)de%e)j&Z+dZ,x~e-e'e+BD]lZ.e.e+kre.e'krde.e)e.fGHe,d7Z,qe.e'kre.e+krde.GHe,d7Z,qqWde,GHndS(sAttach generally useful information, not specific to any package.

Copyright (C) 2009 Canonical Ltd.
Authors: Matt Zimmerman <mdz@canonical.com>,
         Brian Murray <brian@ubuntu.com>

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
the full text of the license.
iN(turljoin(turlopen(t*(tunicode_gettextcCs<t|t|t|t|ytjjd|d<Wntk
rUnX|jddkrt	|d|krt
jd}|j|j
d}|dkrd	||d
<qqnt|xddgD]}||kr||}t|||djd
}g}xU|jdjD]>}||krX|j|q6||kr6|j|q6q6Wd
j|}	qqWtd}
d|krtjd|dtjrt}nt}xBd9D]:}||kr||jdr||d||<qqW|jddjdrAdt
jd<nd|kr|djd}
t|}|rd|
ks||
krd|d<qnd|kr|djd}|rt||d|n|dkrd |dkrd!|d
<qnd|kr<|djd}|r<t ||q<n|jddkrd"|krd|kr|djdd\}}d#|||d"f}||d$<d|kr|d}nd|kr|d}nd}|rd%d&d'd(g}d)}d*}tj||s&tj||rI|d+|krIt"|d,qInd-|krtjd.|}|rtjj#|j$drtd/|d
<nt%|d0n|r||	krtd1|d
<qqqnt&j't
j(j)}t*j+d2d3d4|d5gd6t*j,d7t*j-dkr8t%|d8ndS(:Ntapportt
ApportVersiontProblemTypetPackagetLiveMediaBuilds/cdromi@Bi
sYour system partition has less than %s MB of free space available, which leads to problems using applications and installing updates. Please free some space.tUnreportableReasontDpkgTerminalLogtVarLogDistupgradeApttermlogs
sUTF-8sYour system was initially configured with grub version 2, but you have removed it from your system in favor of grub 1 without configuring it.  To ensure your bootloader configuration is updated whenever a new kernel is available, open a terminal and run:

  sudo apt-get install grub-pc
s-^Not creating /boot/grub/menu.lst as you wishtExecutablePathtInterpreterPaths/target/itsupdate-managert1tAPPORT_IGNORE_OBSOLETE_PACKAGESitcommons
canonical-oemtCrashDBituisupgrade-systems
not installedsYou do not have the upgrade-system package installed. Please report package upgrade failures against the package that failed to install, or against upgrade-manager.tErrorMessagespackage:%s:%s:%stDuplicateSignatures
memtest86+tlinuxsubuntu-metasvirtualbox-osesJ/etc/kernel/post(inst|rm)\.d/zz-update-grub exited with return code [1-9]+s8/usr/sbin/grub-mkconfig.*/etc/default/grub: Syntax errort
SourcePackagetEtcDefaultGrubstrying to overwritesin package (.*) sYAn Ubuntu package has a file conflict with a package that is not a genuine Ubuntu packagespackage-conflicts?You have already encountered this package installation failure.tkillalls-s0s-usunity-panel-servicetstdouttstderrs
running-unity(sExecutablePathR
(.tadd_release_infotadd_kernel_infotadd_cloud_infotadd_proposed_infoRt	packagingtget_versiont
ValueErrortgettcheck_for_disk_errortoststatvfstf_bavailtf_frsizetmatch_error_messagestcheck_attachment_for_errorstsplittdecodet
splitlinestappendtremovetjoint_tretsearcht	MULTILINEtTruetFalset
startswithtenvirontget_oem_projecttattach_conffilestattach_upstart_overridestNonetattach_default_grubtis_distro_packagetgrouptadd_tagtpwdtgetpwuidtgeteuidtpw_namet
subprocesstcalltPIPEtSTDOUT(treportRtsttfree_mbtlogtuntrimmed_dpkg_logttrimmed_logtlinestlinetdpkg_log_without_errortwrong_grub_msgtgrub_hook_failuretftvtoem_projecttpackagetversiontdupe_sigttermlogtUPDATE_BOOTt
ug_failuretmkconfig_failuretconflict_pkgtusername((s)/usr/share/apport/general-hooks/ubuntu.pytadd_infos








		
-


		$"cCsf|jddkrbd|jddkr:d|d<nd|jd	dkrbd
|d<qbndS(NRRs7failed to install/upgrade: corrupted filesystem tarfiletTitleRsRThis failure was caused by a corrupted package download or file system corruption.R	s#is already installed and configuredRtdpkgR(R#(RI((s)/usr/share/apport/general-hooks/ubuntu.pyR)s

c
	Cs|jddkr
t||dd$krdddg}x|D]}||krEtj|||tjrEtjjd}|dks|dkrd	||krd|d
<t	j
jdrtrt
|d<qqd|d
<qEqEWn|dd
kr;||kr;tjd||tjr;d
|d
<q;n|dd%krd}||krtj|||tjrxU||jdD]=}tjd|}|r|jd}t||qqWqn|djdr||krtjd||tj}|r|jd}tjj|}	|	r{|	|d
<|jd|d<|	dkrtrt
|d<qqd|d<qnd|jddkrd |d<n||krtjd!||tjrd |d<nd"|jddkr
d#|d
<q
ndS(&NRRtgrubtgrub2s>^User postinst hook script \[.*update-grub\] exited with valuesU^run-parts: /etc/kernel/post(inst|rm).d/zz-update-grub exited with return code [1-9]+s^/usr/sbin/grub-probe: errors/usr/sbin/update-grubs
grub-probeRs/boot/grub/grub.cfgR	sinitramfs-toolss^update-initramfs: failed for temacs22temacs23semacs-snapshottxemacs21s+^!! Byte-compilation for x?emacs\S+ failed!s
s^!! and attach the file (\S+)islinux-image-s@^run-parts: (/etc/kernel/\S+\.d/\S+) exited with return code \d+iRsgrub-pcsHThis failure was caused by a program which did not originate from Ubuntus7failed to install/upgrade: corrupted filesystem tarfileRaRsRThis failure was caused by a corrupted package download or file system corruption.s/dpkg-deb: error.*is not a debian format archives#is already installed and configuredRb(RcRd(ReRfsemacs-snapshotRg(R#t
trim_dpkg_logR2R3R4RR tget_file_packageR<R%tpathtexistsRSRRR+R?tattach_file_if_existsR7(
RIt
attachmenttgrub_errorst
grub_errortgrub_packagetregexRPtmRjRW((s)/usr/share/apport/general-hooks/ubuntu.pyR*sV
	
((
((

(
c	Csrg}d|kr"d|kr"dSd|kr2dS|d}t}x|D]}|jd}|jds|jds|jdrI|jdd	jd
}|jdd}|j|qIqIW|jd|d}xq|D]i}|jd}d
|krd|krqnx3|D](}tj||r$|}t	}Pq$q$WqqW|rnd||d<ndS(Ns	Dmesg.txtsCurrentDmesg.txtsDf.txts
t/s/usrs/vart it
0123456789s/dev/Rs	I/O errorsjournal commit I/O errors6This failure was caused by a hardware error on /dev/%sR	(
R6tstriptendswithR+treplaceR.R#R2R3R5(	RIt
devs_to_checktdftdevice_errorRPtdevicetdmesgtdevterror_device((s)/usr/share/apport/general-hooks/ubuntu.pyR$s4

-

cCst|dddS(Ns/proc/version_signaturetProcVersionSignature(Rl(RI((s)/usr/share/apport/general-hooks/ubuntu.pyRscCst|ddt|ddtjjdrKtjjd|d<nt|ddtd	d
gdd}|j	drd}n
t
||d
}tjj|rtj|j}t
jdt
j|}t
j
|}d|||df|d<n
d|d<dS(Ns/var/log/installer/media-infotInstallationMedias/cdrom/.disk/infoRtcaspert
CasperVersions/var/lib/ubuntu_dist_channeltDistributionChannelDescriptortlsb_releases-scRtErrors/var/log/dist-upgrade/main.logs%Y-%m-%ds"Upgraded to %s on %s (%d days ago)iQt
UpgradeStatuss/No upgrade log present (probably fresh install)(RlR%RjRkRR R!tcommand_outputR<R7R@tstattst_mtimettimetstrftimetgmtime(RItrelease_codenameRLtmtimethuman_mtimetdelta((s)/usr/share/apport/general-hooks/ubuntu.pyRs$			
c	CsId|krdSy|djd \}}Wntk
rOd|dGHdSXtjdd|gdtjdt}|jd	}|jd	krd
|GHdSt}t}t}xi|j	D][}|j
|drd|krt}nd
|krt}nd|krt}qqqW|rE|rE|rEt|dndS(s#Tag if package comes from -proposedRNis"WARNING: malformed Package field: s	apt-cachetshowpkgRtuniversal_newlinesis$WARNING: apt-cache showpkg %s faileds (s
-proposed_s	-updates_s	-securityspackage-from-proposed(R+R"REtPopenRGR5tcommunicatet
returncodeR6R-R7R@(	RIRWRXt	apt_cachetouttfound_proposedt
found_updatestfound_securityRP((s)/usr/share/apport/general-hooks/ubuntu.pyRs6

					c
Csst}xBdD]:}y tjj|r2t}PnWq
tk
rFq
Xq
W|rod}t|d}yt|ddj}Wn
d}nX|dkrd}qo|j
drYd}t|d	id
d6dd
6dd6dd6dd6}||d<xm|jD]I\}}	y)tt||	ddj||<Wq	d||<q	Xq	Wqod}t|dndS(Nsec2-inits
cloud-inits(http://169.254.169.254/latest/meta-data/sami-idttimeoutitamitec2s
ec2-imagessami-manifest-pathtEc2AMIManifests	kernel-idt	Ec2Kernels
ramdisk-idt
Ec2Ramdisks
instance-typetEc2InstanceTypesplacement/availability-zonetEc2AvailabilityZonetEc2AMItunavailabletuecs
uec-images(sec2-inits
cloud-init(
R6RR R!R5R"RRtreadR<R7R@titems(
RItec2_instancetpkgtmetadata_urlt
ami_id_urlRtcloudtfieldstkeytvalue((s)/usr/share/apport/general-hooks/ubuntu.pyR=sD


	



cCs(|jdd|dcd|7<dS(NtTagsRRt(t
setdefault(RIttag((s)/usr/share/apport/general-hooks/ubuntu.pyR@fscCs<|jdd}|r8|jdr8|jddSdS(sDetermine OEM project name from Distribution Channel Descriptor
    
    Return None if it cannot be determined or does not exist.
    Rscanonical-oem-t-iN(R#R<R7R+(RItdcd((s)/usr/share/apport/general-hooks/ubuntu.pyR9jscCsd|krdSg}tjd}xO|djD]=}|jdsZ|j|rfg}q6n|j|q6Wdj||d<|djsd|d<ndS(s=Trim DpkgTerminalLog to the most recent installation session.R
Ns^\(.* ... \d+ .*\)$s
Log started: s
s//var/log/apt/term.log does not contain any dataR	(R2tcompileR-R7tmatchR.R0Rv(RIROttrim_reRP((s)/usr/share/apport/general-hooks/ubuntu.pyRhtst__main__is-Usage for testing this hook: %s <report file>iis+%s: %ss-%s: (deleted)s%d items changed(/t__doc__tapport.packagingRR2R%tos.pathRARturlparseRturllib2Rtapport.hookutilsRR1R`R)R*R$RRRRR@R9Rht__name__tsystlentargvRtexittreport_filetReportRItloadtopentsettkeystreport_keystcopyt
new_reportR<tnew_report_keystchangedtsortedR(((s)/usr/share/apport/general-hooks/ubuntu.pyt<module>sL<
	x		A			 	"	)