Merge lp:~mterry/update-manager/split-release-upgrader into lp:update-manager

Proposed by Michael Terry
Status: Merged
Merged at revision: 2509
Proposed branch: lp:~mterry/update-manager/split-release-upgrader
Merge into: lp:update-manager
Prerequisite: lp:~mterry/update-manager/drop-auto-tester
Diff against target: 21114 lines (+200/-19816)
123 files modified
.bzr-builddeb/default.conf (+0/-3)
DistUpgrade/Changelog (+0/-188)
DistUpgrade/DevelReleaseAnnouncement (+0/-58)
DistUpgrade/DistUpgrade.cfg (+0/-117)
DistUpgrade/DistUpgrade.cfg.dapper (+0/-56)
DistUpgrade/DistUpgrade.cfg.hardy (+0/-106)
DistUpgrade/DistUpgrade.cfg.lucid (+0/-114)
DistUpgrade/DistUpgrade.ui (+0/-1605)
DistUpgrade/DistUpgradeApport.py (+0/-91)
DistUpgrade/DistUpgradeAptCdrom.py (+0/-308)
DistUpgrade/DistUpgradeAufs.py (+0/-253)
DistUpgrade/DistUpgradeCache.py (+0/-1235)
DistUpgrade/DistUpgradeConfigParser.py (+0/-85)
DistUpgrade/DistUpgradeController.py (+0/-1793)
DistUpgrade/DistUpgradeFetcherCore.py (+0/-313)
DistUpgrade/DistUpgradeFetcherSelf.py (+0/-32)
DistUpgrade/DistUpgradeGettext.py (+0/-83)
DistUpgrade/DistUpgradeMain.py (+0/-237)
DistUpgrade/DistUpgradePatcher.py (+0/-105)
DistUpgrade/DistUpgradeQuirks.py (+0/-1270)
DistUpgrade/DistUpgradeVersion.py (+0/-1)
DistUpgrade/DistUpgradeView.py (+0/-436)
DistUpgrade/DistUpgradeViewGtk.py (+0/-749)
DistUpgrade/DistUpgradeViewGtk3.py (+0/-749)
DistUpgrade/DistUpgradeViewKDE.py (+0/-873)
DistUpgrade/DistUpgradeViewNonInteractive.py (+0/-329)
DistUpgrade/DistUpgradeViewText.py (+0/-279)
DistUpgrade/EOLReleaseAnnouncement (+0/-62)
DistUpgrade/README (+0/-90)
DistUpgrade/ReleaseAnnouncement (+0/-56)
DistUpgrade/TODO (+0/-65)
DistUpgrade/additional_pkgs.cfg (+0/-2)
DistUpgrade/apt-autoinst-fixup.py (+0/-69)
DistUpgrade/build-dist.sh (+0/-53)
DistUpgrade/build-exclude.txt (+0/-9)
DistUpgrade/build-tarball.sh (+0/-41)
DistUpgrade/cdromupgrade (+0/-40)
DistUpgrade/crashdialog.ui (+0/-142)
DistUpgrade/dialog_changes.ui (+0/-213)
DistUpgrade/dialog_conffile.ui (+0/-142)
DistUpgrade/dialog_error.ui (+0/-119)
DistUpgrade/dist-upgrade.py (+0/-10)
DistUpgrade/etc-default-apport (+0/-7)
DistUpgrade/get_kernel_list.sh (+0/-29)
DistUpgrade/imported/invoke-rc.d (+0/-455)
DistUpgrade/imported/invoke-rc.d.diff (+0/-24)
DistUpgrade/mirrors.cfg (+0/-830)
DistUpgrade/patches/README (+0/-17)
DistUpgrade/patches/_usr_bin_pycompile.b17cebfbf18d152702278b15710d5095.97c07a02e5951cf68cb3f86534f6f917 (+0/-80)
DistUpgrade/prerequists-sources.dapper-ports.list (+0/-4)
DistUpgrade/prerequists-sources.dapper.list (+0/-4)
DistUpgrade/prerequists-sources.list (+0/-6)
DistUpgrade/removal_blacklist.cfg (+0/-19)
DistUpgrade/screenrc (+0/-3)
DistUpgrade/window_main.ui (+0/-267)
DistUpgrade/xorg_fix_proprietary.py (+0/-179)
DistUpgrade/zz-update-grub (+0/-19)
README.dist-upgrade (+0/-34)
check-new-release-gtk (+0/-210)
data/do-release-upgrade.8 (+0/-35)
data/gtkbuilder/UpgradePromptDialog.ui (+0/-343)
data/meta-release (+0/-7)
data/release-upgrades (+0/-17)
debian/91-release-upgrade (+0/-5)
debian/control (+4/-20)
debian/python-update-manager.install (+0/-6)
debian/python3-update-manager.install (+0/-1)
debian/release-upgrade-motd (+0/-40)
debian/rules (+1/-25)
debian/source_update-manager.py (+7/-26)
debian/update-manager-core.dirs (+0/-3)
debian/update-manager-core.install (+0/-5)
debian/update-manager-core.links (+0/-1)
debian/update-manager-core.manpages (+0/-1)
debian/update-manager-core.postinst (+0/-44)
debian/update-manager-core.preinst (+0/-41)
debian/update-manager-kde.install (+0/-1)
debian/update-manager.install (+0/-1)
do-release-upgrade (+0/-131)
kubuntu-devel-release-upgrade (+0/-2)
po/POTFILES.in (+0/-18)
po/POTFILES.skip (+0/-2)
po/update-manager.pot (+187/-1626)
pre-build.sh (+0/-48)
setup.py (+1/-9)
tests/Makefile (+0/-3)
tests/patchdir/dotdot_expected (+0/-2)
tests/patchdir/dotdot_orig (+0/-1)
tests/patchdir/fail_orig (+0/-1)
tests/patchdir/foo_orig (+0/-2)
tests/patchdir/fstab_orig (+0/-17)
tests/patchdir/patchdir_dotdot.8cf8463b34caa8ac871a52d5dd7ad1ef.cddc4be46bedd91db15ddb9f7ddfa804 (+0/-4)
tests/patchdir/patchdir_fail.ed04abbc6ee688ee7908c9dbb4b9e0a2.deadbeefdeadbeefdeadbeff (+0/-1)
tests/patchdir/patchdir_foo.f41121a903eafadf258962abc57c8644.52f83ff6877e42f613bcd2444c22528c (+0/-1)
tests/patchdir/patchdir_fstab.a1b72f1370f4f847f602fd0e239265d2.c56d2d038afb651920c83106ec8dfd09 (+0/-13)
tests/patchdir/patchdir_pycompile.b17cebfbf18d152702278b15710d5095.97c07a02e5951cf68cb3f86534f6f917 (+0/-80)
tests/patchdir/pycompile_orig (+0/-281)
tests/test-data-cdrom/.disk/base_components (+0/-2)
tests/test-data-cdrom/.disk/cd_type (+0/-1)
tests/test-data-cdrom/.disk/info (+0/-1)
tests/test-data-cdrom/.disk/udeb_include (+0/-4)
tests/test-data-cdrom/README.diskdefines (+0/-9)
tests/test-data-cdrom/cdromupgrade (+0/-32)
tests/test-data-cdrom/dists/intrepid/Release (+0/-27)
tests/test-data-cdrom/dists/intrepid/Release.gpg (+0/-7)
tests/test-data-cdrom/dists/intrepid/main/binary-amd64/Release (+0/-6)
tests/test-data-cdrom/dists/intrepid/main/debian-installer/binary-amd64/Packages.gz (+0/-1)
tests/test-data-cdrom/dists/intrepid/restricted/binary-amd64/Release (+0/-6)
tests/test-data/fstab.ntfs.orig (+0/-22)
tests/test-data/xorg.conf.orig (+0/-89)
tests/test_cdrom.py (+0/-131)
tests/test_end_of_life.py (+0/-65)
tests/test_kernel_from_baseinstaller.py (+0/-42)
tests/test_prerequists.py (+0/-160)
tests/test_quirks.py (+0/-181)
tests/test_sources_list.py (+0/-324)
tests/test_xorg_fix_intrepid.py (+0/-46)
utils/demoted.cfg.dapper (+0/-243)
utils/demoted.cfg.hardy (+0/-568)
utils/demotions.py (+0/-129)
utils/est_kernel_size.py (+0/-15)
utils/update-base-installer.sh (+0/-51)
utils/update_mirrors.py (+0/-22)
To merge this branch: bzr merge lp:~mterry/update-manager/split-release-upgrader
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Michael Vogt Pending
Review via email: mp+109211@code.launchpad.net

This proposal supersedes a proposal from 2012-06-07.

Description of the change

This drops all the bits from https://code.launchpad.net/~ubuntu-core-dev/ubuntu-release-upgrader/split/+merge/109209

It will need a further change to update-notifier to notice the new paths for check-new-release, but that's a separate merge.

(resubmitted so I could set a pre-req branch on lp:~mterry/update-manager/drop-auto-tester)

To post a comment you must log in.
2449. By Michael Terry

merge from trunk

2450. By Michael Terry

whoops, and drop a couple references to DistUpgrade added in trunk

2451. By Michael Terry

merge from trunk again

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

The removal of the whole code seems fine to me and from my small testing, it seems you didn't forget to remove anything in the package.

I have a small dummy question though, debian/rules were already using dh --with python2 and you still use the same, even if you ship a python3 package? (python3-update-manager). Do you know what's the plan for that?

Apart from that all, looks good. I'll let gary looking at the update-release-manager side :)

review: Approve
2452. By Michael Terry

merge from trunk

Revision history for this message
Michael Terry (mterry) wrote :

The --with python2 is because there's still a python-update-manager package for python2. I'm not sure who uses it, but it's there for the moment.

2453. By Michael Terry

add python3-distupgrade Depend to python3-update-manager

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

@Michael: I meant, there is no --with python3? ;)

Revision history for this message
Michael Terry (mterry) wrote :

It's using python2 and python3:
 dh $@ --with=python2,python3

2454. By Michael Terry

drop release-upgrader-specific test

2455. By Michael Terry

drop python2 package, since it isn't needed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzr-builddeb/default.conf'
--- .bzr-builddeb/default.conf 2011-10-07 08:20:22 +0000
+++ .bzr-builddeb/default.conf 2012-06-27 19:20:36 +0000
@@ -1,5 +1,2 @@
1[BUILDDEB]1[BUILDDEB]
2native = true2native = true
3
4[HOOKS]
5pre-build = ./pre-build.sh
63
=== removed directory 'DistUpgrade'
=== removed file 'DistUpgrade/Changelog'
--- DistUpgrade/Changelog 2007-02-14 22:43:51 +0000
+++ DistUpgrade/Changelog 1970-01-01 00:00:00 +0000
@@ -1,188 +0,0 @@
12007-02-14:
2 - automatically generate the .py file from the .ui files
32007-02-14:
4 - fix the $dist-proposed handling
5 - fix in $dist-commercial handling (LP#66783)
6 - updated demotions
72007-02-13:
8 - fix in the reboot code (lp: #84538)
9 - make some string more distro neutral
102007-02-07:
11 - add support for the cdrom upgrader to update itself
122007-02-05:
13 - use the new python-apt aptsources api
14 - server mode has magic to deal with runing under ssh
152007-02-02:
16 - merged the KDE frontend (thanks Riddell)
17 - added tasks support
18 - add dist-upgrade --mode=server
192007-02-01:
20 - fix apport integration
212007-01-29:
22 - fixes in the InstallProgress.error() method
23 - DistUpgrade/DistUpgradeView.py: fix InstallProgress refactoring
24 - updated obsoletes
25 - auto-generate the codename for the upgrade based on the build-system coden (lp: #77620)
26 - various bugfixes
27 - apport support
282006-12-12:
29 - rewrote the _checkFreeSpace() and add better checking
30 for /boot (#70683)
312006-11-28:
32 - add quirks rule to install ndiswrapper-utils-1.9 if 1.8 is
33 installed
342006-11-27:
35 - fix caption in main glade file
36 - use "Dpkg::StopOnError","False" option
372006-11-23:
38 - initial feisty upload
392006-10-28:
40 - catch errors when load_icon() does not work
412006-10-27:
42 - reset self.read so that we do not loop endlessly when dpkg
43 sends unexpected data (lp: #68553)
442006-10-26:
45 - make sure that xserver-xorg-video-all get installed if
46 xserver-xorg-driver-all was installed before (lp: #58424)
472006-10-21:
48 - comment out old cdrom sources
49 - demotions updated
502006-10-21:
51 - fix incorrect arguments in fixup logging (lp: #67311)
52 - more error logging
53 - fix upgrade problems for people with unofficial compiz
54 repositories (lp: #58424)
55 - rosetta i18n updates
56 - uploaded
572006-10-17:
58 - ensure bzr, tomboy and xserver-xorg-input-* are properly
59 upgraded
60 - don't fail if dpkg sents unexpected status lines (lp: #66013)
612006-10-16:
62 - remove leftover references to ubuntu-base and
63 use ubuntu-minimal and ubuntu-standard instead
64 - updated translations from rosetta
652006-10-13:
66 - log held-back as well
672006-10-12:
68 - check if cdrom.lst actually exists before copying it
692006-10-11:
70 - keep pixbuf loader reference around so that we
71 have one after the upgrade when the old
72 /usr/lib/gtk-2.0/loader/2.4.0/ loader is gone.
73 This fixes the problem of missing stock-icons
74 after the upgrade. Also revalidate the theme
75 in each step.
762006-10-10:
77 - fix time calculation
78 - fix kubuntu upgrade case
792006-10-06:
80 - fix source.list rewrite corner case bug (#64159)
812006-10-04:
82 - improve the space checking/logging
832006-09-29:
84 - typo fix (thanks to Jane Silber) (lp: #62946)
852006-09-28:
86 - bugfix in the cdromupgrade script
872006-09-27:
88 - uploaded a version that only reverts the backport fetching
89 but no other changes compared to 2006-09-23
902006-09-27:
91 - embarrassing bug cdromupgrade.sh
922006-09-26:
93 - comment out the getRequiredBackport code because we will
94 not use Breaks for the dapper->edgy upgrade yet
95 (see #54234 for the rationale)
96 - updated demotions.cfg for dapper->edgy
97 - special case the packages affected by the Breaks changes
98 - make sure that no translations get lost during the upgrade
99 (thanks to mdz for pointing this out)
100 - bugfixes
1012006-09-23:
102 - support fetching backports of selected packages first and
103 use them for the upgrade (needed to support Breaks)
104 - fetch/use apt/dpkg/python-apt backports for the upgrade
1052006-09-06:
106 - increased the "free-space-savety-buffer" to 100MB
1072006-09-05:
108 - added "RemoveEssentialOk" option and put "sysvinit" into it
1092006-09-04:
110 - set Debug::pkgDepCache::AutoInstall as debug option too
111 - be more robust against failure from the locales
112 - remove libgl1-mesa (no longer needed on edgy)
1132006-09-03:
114 - fix in the cdromupgrade script path detection
1152006-09-01:
116 - make the cdromupgrade wrapper work with the compressed version
117 of the upgrader as put onto the CD
118 - uploaded
1192006-08-30:
120 - fixes to the cdromupgrade wrapper
1212006-08-29:
122 - always enable the "main" component to make sure it is available
123 - add download estimated time
124 - add --cdrom switch to make cdrom based dist-upgrades possible
125 - better error reporting
126 - moved the logging into the /var/log/dist-upgrade/ dir
127 - change the obsoletes calculation when run without network and
128 consider demotions as obsoletes then (because we can't really
129 use the "pkg.downloadable" hint without network)
130 - uploaded
1312006-08-18:
132 - sort the demoted software list
1332006-07-31:
134 - updated to edgy
135 - uploadedd
1362006-05-31:
137 - fix bug in the free space calculation (#47092)
138 - updated ReleaseAnnouncement
139 - updated translations
140 - fix a missing bindtextdomain
141 - fix a incorrect ngettext usage
142 - added quirks handler to fix nvidia-glx issue (#47017)
143 Thanks to the amazing Kiko for helping improve this!
1442006-05-24:
145 - if the initial "update()" fails, just exit, don't try
146 to restore the old sources.list (nothing was modified yet)
147 Ubuntu: #46712
148 - fix a bug in the sourcesList rewriting (ubuntu: #46245)
149 - expand the terminal when no libgnome2-perl is installed
150 because debconf might want to ask questions (ubuntu: #46214)
151 - disable the breezy cdrom source to make removal of demoted
152 packages work properly (ubuntu: #46336)
153 - translations updated from rosetta
154 - fixed a bug in the demotions calculation (ubuntu: #46245)
155 - typos fixed and translations unfuzzied (ubuntu: #46792,#46464)
156 - upload
1572006-05-12:
158 - space checking improved (ubuntu: #43948)
159 - show software that was demoted from main -> universe
160 - improve the remaining time reporting
161 - translation updates
162 - upload
1632006-05-09:
164 - upload
1652006-05-08:
166 - fix error when asking for media-change (ubuntu: 43442,43728)
1672006-05-02:
168 - upload
1692006-04-28:
170 - add more sanity checking, if no valid mirror is found in the
171 sources.list ask for "dumb" rewrite
172 - if nothing valid was found after a dumb rewrite, add official
173 sources
174 - don't report install TIMEOUT over and over in the log
175 - report what package caused a install TIMEOUT
1762006-04-27:
177 - add a additonal sanity check after the rewriting of the sources.list
178 (check for BaseMetaPkgs still in the cache)
179 - on abort reopen() the cache to force writing a new
180 /var/cache/apt/pkgcache.bin
181 - use a much more compelte mirror list (based on the information
182 from https://wiki.ubuntu.com/Archive)
1832006-04-25:
184 - make sure that DistUpgradeView.getTerminal().call() actually
185 waits until the command has finished (dpkg --configure -a)
1862006-04-18:
187 - add logging to the sources.list modification code
188 - general logging improvements (thanks to Xavier Poinsard)
1890
=== removed file 'DistUpgrade/DevelReleaseAnnouncement'
--- DistUpgrade/DevelReleaseAnnouncement 2012-05-11 15:03:22 +0000
+++ DistUpgrade/DevelReleaseAnnouncement 1970-01-01 00:00:00 +0000
@@ -1,58 +0,0 @@
1= Welcome to the Ubuntu 'Quantal Quetzal' development release =
2
3''This is still a BETA release.''
4''Do not install it on production machines.''
5
6Thanks for your interest in this development release of Ubuntu.
7The Ubuntu developers are moving very quickly to bring you the
8absolute latest and greatest software the Open Source Community has to
9offer. This development release brings you a taste of the newest features
10for the next version of Ubuntu.
11
12== Testing ==
13
14Please help to test this development snapshot and report problems back to the
15developers. For more information about testing Ubuntu, please read:
16
17 http://www.ubuntu.com/testing
18
19
20== Reporting Bugs ==
21
22This development release of Ubuntu contains bugs. If you want to help
23out with bugs, the Bug Squad is always looking for help. Please read the
24following information about reporting bugs:
25
26 http://help.ubuntu.com/community/ReportingBugs
27
28Then report bugs using apport in Ubuntu. For example:
29
30 ubuntu-bug linux
31
32will open a bug report in Launchpad regarding the linux package. Your
33comments, bug reports, patches and suggestions will help fix bugs and improve
34future releases.
35
36
37== Participate in Ubuntu ==
38
39If you would like to help shape Ubuntu, take a look at the list of
40ways you can participate at
41
42 http://www.ubuntu.com/community/participate/
43
44
45== More Information ==
46
47You can find out more about Ubuntu on the Ubuntu website and Ubuntu
48wiki.
49
50 http://www.ubuntu.com/
51 http://wiki.ubuntu.com/
52
53
54To sign up for Ubuntu development announcements, please
55subscribe to Ubuntu's development announcement list at:
56
57 http://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-announce
58
590
=== removed symlink 'DistUpgrade/DistUpgrade'
=== target was u'.'
=== removed file 'DistUpgrade/DistUpgrade.cfg'
--- DistUpgrade/DistUpgrade.cfg 2012-06-11 12:47:59 +0000
+++ DistUpgrade/DistUpgrade.cfg 1970-01-01 00:00:00 +0000
@@ -1,117 +0,0 @@
1[View]
2# the views will be tried in this order, if one fails to import, the next
3# is tried
4View=DistUpgradeViewGtk3,DistUpgradeViewGtk,DistUpgradeViewKDE,DistUpgradeViewText
5#View=DistUpgradeViewNonInteractive
6#Depends= python-apt (>= 0.6.0), apt (>= 0.6)
7# the views below support upgrades over ssh connection
8SupportSSH=DistUpgradeViewText,DistUpgradeViewNonInteractive
9
10# Distro contains global information about the upgrade
11[Distro]
12# the meta-pkgs we support
13MetaPkgs=ubuntu-desktop, kubuntu-desktop, xubuntu-desktop, ubuntustudio-desktop, ichthux-desktop, mythbuntu-desktop, ubuntu-netbook, kubuntu-netbook, lubuntu-desktop
14BaseMetaPkgs=ubuntu-minimal, ubuntu-standard
15Demotions=demoted.cfg
16RemoveEssentialOk=sysvinit, sysvutils, belocs-locales-bin
17RemovalBlacklistFile=removal_blacklist.cfg
18# if those packages were installed, make sure to keep them installed
19KeepInstalledPkgs=gnumeric, hpijs, xserver-xorg-video-all
20KeepInstalledSection=translations
21RemoveObsoletes=yes
22ForcedObsoletes=ksplash-engine-moodin, powernowd, laptop-mode-tools
23# hints for for stuff that should be done early
24PostUpgradePurge=ltsp-client, ltspfsd, linux-restricted-modules-common
25PostUpgradeRemove=libflashsupport, kvm-source, gtk-qt-engine, libparted1.8-12, usplash, printconf, foomatic-db-gutenprint, ebox-printers, kbluetooth, kde-plasmoid-cwp
26PostUpgradeUpgrade=brasero,edubuntu-desktop
27#PostUpgradeInstall=apt
28PostInstallScripts=./xorg_fix_proprietary.py
29EnableApport=yes
30# this supported blacklisting certain versions to ensure we do not upgrade
31# - blcr-dkms fails to build on kernel 2.6.35
32BadVersions=blcr-dkms_0.8.2-13
33# ubiquity slideshow
34#SlideshowUrl=http://people.canonical.com/~mvo/ubiquity-slideshow-upgrade/slides/
35
36[KernelRemoval]
37Version=3.2.0
38BaseNames=linux-image,linux-headers,linux-image-debug,linux-backport-modules,linux-header-lbm
39Types=386,ec2,generic,rt,server,virtual
40
41# information about the individual meta-pkgs
42[ubuntu-desktop]
43KeyDependencies=gdm, ubuntu-artwork, ubuntu-sounds
44# those pkgs will be marked remove right after the distUpgrade in the cache
45PostUpgradeRemove=xscreensaver, gnome-cups-manager, powermanagement-interface, deskbar-applet, nautilus-cd-burner
46ForcedObsoletes=desktop-effects, cups-pdf, gnome-app-install, policykit-gnome, gnome-mount
47
48[kubuntu-desktop]
49KeyDependencies=kdm, kubuntu-artwork
50PostUpgradeRemove=powermanagement-interface, guidance-power-manager, kde-guidance-powermanager
51# those packages are marked as obsolete right after the upgrade
52ForcedObsoletes=ivman, cups-pdf, gtk-qt-engine
53
54[kubuntu-netbook]
55KeyDependencies=kdm, kubuntu-netbook-default-settings
56
57[ubuntu-netbook]
58KeyDependencies=gdm, ubuntu-netbook-default-settings
59
60[xubuntu-desktop]
61KeyDependencies=xubuntu-artwork, xubuntu-default-settings, xfwm4
62PostUpgradeRemove=notification-daemon
63ForcedObsoletes=cups-pdf
64
65[ubuntustudio-desktop]
66KeyDependencies=ubuntustudio-default-settings, ubuntustudio-look
67
68[ichthux-desktop]
69KeyDependencies=ichthux-artwork, ichthux-default-settings
70
71[mythbuntu-desktop]
72KeyDependencies=mythbuntu-artwork, mythbuntu-default-settings
73
74[lubuntu-desktop]
75KeyDependencies=lubuntu-core, lubuntu-default-settings
76#Remove previous gnome component from lubuntu to avoid pulling gnome depends on upgrade (LP: #945215)
77PostUpgradeRemove=gnome-bluetooth, gnome-power-manager
78
79[Files]
80BackupExt=distUpgrade
81LogDir=/var/log/dist-upgrade/
82
83[Sources]
84From=precise
85To=quantal
86ValidOrigin=Ubuntu
87ValidMirrors = mirrors.cfg
88Components=main,restricted,universe,multiverse
89Pockets=security,updates,proposed,backports
90;AllowThirdParty=False
91
92;[PreRequists]
93;Packages=release-upgrader-apt,release-upgrader-dpkg
94;SourcesList=prerequists-sources.list
95;SourcesList-ia64=prerequists-sources.ports.list
96;SourcesList-hppa=prerequists-sources.ports.list
97
98[Aufs]
99; this is a xor option, either full or chroot overlay
100;EnableFullOverlay=yes
101;EnableChrootOverlay=yes
102; sync changes from the chroot back to the real system
103;EnableChrootRsync=yes
104; what chroot dir to use
105;ChrootDir=/tmp/upgrade-chroot
106; the RW dir to use (either for full overlay or chroot overlay)
107;RWDir=/tmp/upgrade-rw
108
109[Network]
110MaxRetries=3
111
112[NonInteractive]
113ForceOverwrite=yes
114RealReboot=no
115DebugBrokenScripts=no
116DpkgProgressLog=no
117;TerminalTimeout=2400
1180
=== removed file 'DistUpgrade/DistUpgrade.cfg.dapper'
--- DistUpgrade/DistUpgrade.cfg.dapper 2008-06-24 20:17:19 +0000
+++ DistUpgrade/DistUpgrade.cfg.dapper 1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
1[View]
2View=DistUpgradeViewGtk,DistUpgradeViewKDE, DistUpgradeViewText
3
4# Distro contains global information about the upgrade
5[Distro]
6# the meta-pkgs we support
7MetaPkgs=ubuntu-desktop, kubuntu-desktop, edubuntu-desktop, xubuntu-desktop
8BaseMetaPkgs=ubuntu-minimal, ubuntu-standard, bash
9PostUpgradePurge=xorg-common, libgl1-mesa, ltsp-client, ltspfsd, python2.3
10Demotions=demoted.cfg.dapper
11RemoveEssentialOk=sysvinit
12RemovalBlacklistFile=removal_blacklist.cfg
13PostInstallScripts=/usr/lib/udev/migrate-fstab-to-uuid.sh
14KeepInstalledPkgs=lvm2
15KeepInstalledSection=translations
16RemoveObsoletes=yes
17ForcedObsoletes=esound, esound-common, slocate, ksplash-engine-moodin
18
19# information about the individual meta-pkgs
20[ubuntu-desktop]
21KeyDependencies=gdm, gnome-panel, ubuntu-artwork
22# those pkgs will be marked remove right after the distUpgrade in the cache
23PostUpgradeRemove=xchat, xscreensaver, gnome-cups-manager
24
25[kubuntu-desktop]
26KeyDependencies=kdm, kicker, kubuntu-artwork-usplash
27# those packages are marked as obsolete right after the upgrade
28ForcedObsoletes=ivman, slocate
29
30[edubuntu-desktop]
31KeyDependencies=edubuntu-artwork, tuxpaint
32
33[xubuntu-desktop]
34KeyDependencies=xubuntu-artwork-usplash, xubuntu-default-settings, xfwm4
35
36
37[Files]
38BackupExt=distUpgrade
39LogDir=/var/log/dist-upgrade
40
41[PreRequists]
42Packages=release-upgrader-apt,release-upgrader-dpkg
43SourcesList=prerequists-sources.dapper.list
44SourcesList-ia64=prerequists-sources.dapper-ports.list
45SourcesList-hppa=prerequists-sources.dapper-ports.list
46
47[Sources]
48From=dapper
49To=hardy
50ValidOrigin=Ubuntu
51ValidMirrors = mirrors.cfg
52
53[Network]
54MaxRetries=3
55
56
570
=== removed file 'DistUpgrade/DistUpgrade.cfg.hardy'
--- DistUpgrade/DistUpgrade.cfg.hardy 2010-04-12 09:08:58 +0000
+++ DistUpgrade/DistUpgrade.cfg.hardy 1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
1[View]
2# the views will be tried in this order, if one fails to import, the next
3# is tried
4View=DistUpgradeViewGtk,DistUpgradeViewKDE,DistUpgradeViewText
5#View=DistUpgradeViewNonInteractive
6#Depends= python-apt (>= 0.6.0), apt (>= 0.6)
7# the views below support upgrades over ssh connection
8SupportSSH=DistUpgradeViewText,DistUpgradeViewNonInteractive
9
10# Distro contains global information about the upgrade
11[Distro]
12# the meta-pkgs we support
13MetaPkgs=ubuntu-desktop, kubuntu-desktop, edubuntu-desktop, xubuntu-desktop, ubuntustudio-desktop, ichthux-desktop, mythbuntu-desktop, kubuntu-kde4-desktop
14BaseMetaPkgs=ubuntu-minimal, ubuntu-standard
15Demotions=demoted.cfg.hardy
16RemoveEssentialOk=sysvinit, sysvutils, belocs-locales-bin
17RemovalBlacklistFile=removal_blacklist.cfg
18# if those packages were installed, make sure to keep them installed
19KeepInstalledPkgs=gnumeric, hpijs, xserver-xorg-video-all
20KeepInstalledSection=translations
21RemoveObsoletes=yes
22ForcedObsoletes=ksplash-engine-moodin, powernowd, laptop-mode-tools
23# libflashsupport is now oboselete and causes problems so we remove it
24# early
25PostUpgradePurge=ltsp-client, ltspfsd, linux-restricted-modules-common
26PostUpgradeRemove=libflashsupport, slocate, gtk-qt-engine, libparted1.8-12, usplash
27#PostUpgradeInstall=apt
28PostInstallScripts=./xorg_fix_proprietary.py
29# this supported blacklisting certain versions to ensure we do not upgrade
30# - the openoffice.org-filter-binfilter causes a pre-depends cycle error
31# (#516727)
32BadVersions=openoffice.org-filter-binfilter_1:3.2.0~rc4-1ubuntu1
33EnableApport=no
34
35[KernelRemoval]
36Version=2.6.24
37BaseNames=linux-image,linux-headers,linux-image-debug,linux-ubuntu-modules,linux-header-lum,linux-backport-modules,linux-header-lbm,linux-restricted-modules
38Types=386,generic,rt,server,virtual
39
40# information about the individual meta-pkgs
41[ubuntu-desktop]
42KeyDependencies=gdm, usplash-theme-ubuntu, ubuntu-artwork, ubuntu-sounds
43# those pkgs will be marked remove right after the distUpgrade in the cache
44PostUpgradeRemove=xscreensaver, gnome-cups-manager, powermanagement-interface, deskbar-applet, nautilus-cd-burner, tracker
45ForcedObsoletes=desktop-effects, cups-pdf
46
47[kubuntu-desktop]
48KeyDependencies=kdm, kubuntu-artwork-usplash
49PostUpgradeRemove=powermanagement-interface,adept
50# those packages are marked as obsolete right after the upgrade
51ForcedObsoletes=ivman, cups-pdf, guidance-power-manager, gtk-qt-engine
52
53[kubuntu-kde4-desktop]
54KeyDependencies=kdebase-bin-kde4, kubuntu-artwork-usplash, kwin-kde4
55
56[edubuntu-desktop]
57KeyDependencies=edubuntu-artwork, tuxpaint
58
59[xubuntu-desktop]
60KeyDependencies=xubuntu-artwork-usplash, xubuntu-default-settings, xfwm4
61PostUpgradeRemove=notification-daemon
62ForcedObsoletes=cups-pdf
63
64[ubuntustudio-desktop]
65KeyDependencies=ubuntustudio-default-settings, ubuntustudio-look, usplash-theme-ubuntustudio
66
67[ichthux-desktop]
68KeyDependencies=ichthux-artwork-usplash, ichthux-default-settings
69
70[mythbuntu-desktop]
71KeyDependencies=mythbuntu-artwork-usplash,mythbuntu-default-settings
72
73[Files]
74BackupExt=distUpgrade
75LogDir=/var/log/dist-upgrade/
76
77[Sources]
78From=hardy
79To=lucid
80ValidOrigin=Ubuntu
81ValidMirrors = mirrors.cfg
82Components=main,restricted,universe,multiverse
83
84;[PreRequists]
85;Packages=release-upgrader-apt,release-upgrader-dpkg
86;SourcesList=prerequists-sources.list
87;SourcesList-ia64=prerequists-sources.ports.list
88;SourcesList-hppa=prerequists-sources.ports.list
89
90[Aufs]
91; this is a xor option, either full or chroot overlay
92;EnableFullOverlay=yes
93;EnableChrootOverlay=yes
94; sync changes from the chroot back to the real system
95;EnableChrootRsync=yes
96; what chroot dir to use
97;ChrootDir=/tmp/upgrade-chroot
98; the RW dir to use (either for full overlay or chroot overlay)
99;RWDir=/tmp/upgrade-rw
100
101[Network]
102MaxRetries=3
103
104[NonInteractive]
105ForceOverwrite=no
106RealReboot=no
1070
=== removed file 'DistUpgrade/DistUpgrade.cfg.lucid'
--- DistUpgrade/DistUpgrade.cfg.lucid 2012-04-17 19:05:26 +0000
+++ DistUpgrade/DistUpgrade.cfg.lucid 1970-01-01 00:00:00 +0000
@@ -1,114 +0,0 @@
1[View]
2# the views will be tried in this order, if one fails to import, the next
3# is tried
4View=DistUpgradeViewGtk,DistUpgradeViewGtk3,DistUpgradeViewKDE,DistUpgradeViewText
5#View=DistUpgradeViewNonInteractive
6#Depends= python-apt (>= 0.6.0), apt (>= 0.6)
7# the views below support upgrades over ssh connection
8SupportSSH=DistUpgradeViewText,DistUpgradeViewNonInteractive
9
10# Distro contains global information about the upgrade
11[Distro]
12# the meta-pkgs we support
13MetaPkgs=ubuntu-desktop, kubuntu-desktop, xubuntu-desktop, ubuntustudio-desktop, ichthux-desktop, mythbuntu-desktop, ubuntu-netbook, kubuntu-netbook
14BaseMetaPkgs=ubuntu-minimal, ubuntu-standard
15Demotions=demoted.cfg
16RemoveEssentialOk=sysvinit, sysvutils, belocs-locales-bin
17RemovalBlacklistFile=removal_blacklist.cfg
18# if those packages were installed, make sure to keep them installed
19KeepInstalledPkgs=gnumeric, hpijs, xserver-xorg-video-all
20KeepInstalledSection=translations
21RemoveObsoletes=yes
22ForcedObsoletes=ksplash-engine-moodin, powernowd, laptop-mode-tools
23# hints for for stuff that should be done early
24PostUpgradePurge=ltsp-client, ltspfsd, linux-restricted-modules-common
25PostUpgradeRemove=libflashsupport, kvm-source, gtk-qt-engine, libparted1.8-12, usplash, printconf, foomatic-db-gutenprint, ebox-printers, kbluetooth, kde-plasmoid-cwp
26PostUpgradeUpgrade=brasero,edubuntu-desktop
27#PostUpgradeInstall=apt
28PostInstallScripts=./xorg_fix_proprietary.py
29EnableApport=yes
30# this supported blacklisting certain versions to ensure we do not upgrade
31# - blcr-dkms fails to build on kernel 2.6.35
32BadVersions=blcr-dkms_0.8.2-13
33# ubiquity slideshow
34#SlideshowUrl=http://people.canonical.com/~mvo/ubiquity-slideshow-upgrade/slides/
35# useful for e.g. testing
36;AllowUnauthenticated=yes
37
38[KernelRemoval]
39Version=2.6.32
40BaseNames=linux-image,linux-headers,linux-image-debug,linux-backport-modules,linux-header-lbm
41Types=386,ec2,generic,rt,server,virtual
42
43# information about the individual meta-pkgs
44[ubuntu-desktop]
45KeyDependencies=gdm, ubuntu-artwork, ubuntu-sounds
46# those pkgs will be marked remove right after the distUpgrade in the cache
47PostUpgradeRemove=xscreensaver, gnome-cups-manager, powermanagement-interface, deskbar-applet, nautilus-cd-burner
48ForcedObsoletes=desktop-effects, cups-pdf, gnome-app-install, policykit-gnome, gnome-mount
49
50[kubuntu-desktop]
51KeyDependencies=kdm, kubuntu-artwork
52PostUpgradeRemove=powermanagement-interface, guidance-power-manager, kde-guidance-powermanager
53# those packages are marked as obsolete right after the upgrade
54ForcedObsoletes=ivman, cups-pdf, gtk-qt-engine
55
56[kubuntu-netbook]
57KeyDependencies=kdm, kubuntu-netbook-default-settings
58
59[ubuntu-netbook]
60KeyDependencies=gdm, ubuntu-netbook-default-settings
61
62[xubuntu-desktop]
63KeyDependencies=xubuntu-artwork, xubuntu-default-settings, xfwm4
64PostUpgradeRemove=notification-daemon
65ForcedObsoletes=cups-pdf
66
67[ubuntustudio-desktop]
68KeyDependencies=ubuntustudio-default-settings, ubuntustudio-look
69
70[ichthux-desktop]
71KeyDependencies=ichthux-artwork, ichthux-default-settings
72
73[mythbuntu-desktop]
74KeyDependencies=mythbuntu-artwork, mythbuntu-default-settings
75
76[Files]
77BackupExt=distUpgrade
78LogDir=/var/log/dist-upgrade/
79
80[Sources]
81From=lucid
82To=precise
83ValidOrigin=Ubuntu
84ValidMirrors = mirrors.cfg
85Components=main,restricted,universe,multiverse
86Pockets=security,updates,proposed,backports
87;AllowThirdParty=False
88
89[PreRequists]
90Packages=libapt-pkg4.12,libapt-inst1.4,release-upgrader-python-apt
91SourcesList=prerequists-sources.list
92;SourcesList-ia64=prerequists-sources.ports.list
93;SourcesList-hppa=prerequists-sources.ports.list
94
95[Aufs]
96; this is a xor option, either full or chroot overlay
97;EnableFullOverlay=yes
98;EnableChrootOverlay=yes
99; sync changes from the chroot back to the real system
100;EnableChrootRsync=yes
101; what chroot dir to use
102;ChrootDir=/tmp/upgrade-chroot
103; the RW dir to use (either for full overlay or chroot overlay)
104;RWDir=/tmp/upgrade-rw
105
106[Network]
107MaxRetries=3
108
109[NonInteractive]
110ForceOverwrite=yes
111RealReboot=no
112DebugBrokenScripts=no
113DpkgProgressLog=no
114;TerminalTimeout=2400
1150
=== removed file 'DistUpgrade/DistUpgrade.ui'
--- DistUpgrade/DistUpgrade.ui 2012-05-11 15:03:22 +0000
+++ DistUpgrade/DistUpgrade.ui 1970-01-01 00:00:00 +0000
@@ -1,1605 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<interface>
3 <!-- interface-requires gtk+ 2.6 -->
4 <object class="GtkDialog" id="dialog_cancel">
5 <property name="can_focus">False</property>
6 <property name="border_width">6</property>
7 <property name="resizable">False</property>
8 <property name="window_position">center-on-parent</property>
9 <property name="type_hint">dialog</property>
10 <property name="skip_taskbar_hint">True</property>
11 <property name="skip_pager_hint">True</property>
12 <property name="urgency_hint">True</property>
13 <child internal-child="vbox">
14 <object class="GtkBox" id="vbox11">
15 <property name="visible">True</property>
16 <property name="can_focus">False</property>
17 <property name="spacing">12</property>
18 <child internal-child="action_area">
19 <object class="GtkButtonBox" id="hbuttonbox5">
20 <property name="visible">True</property>
21 <property name="can_focus">False</property>
22 <property name="layout_style">end</property>
23 <child>
24 <object class="GtkButton" id="button_cancel">
25 <property name="label" translatable="yes">_Cancel Upgrade</property>
26 <property name="visible">True</property>
27 <property name="can_focus">True</property>
28 <property name="can_default">True</property>
29 <property name="receives_default">False</property>
30 <property name="use_action_appearance">False</property>
31 <property name="use_underline">True</property>
32 </object>
33 <packing>
34 <property name="expand">False</property>
35 <property name="fill">False</property>
36 <property name="position">0</property>
37 </packing>
38 </child>
39 <child>
40 <object class="GtkButton" id="button_resume">
41 <property name="label" translatable="yes">_Resume Upgrade</property>
42 <property name="visible">True</property>
43 <property name="can_focus">True</property>
44 <property name="can_default">True</property>
45 <property name="has_default">True</property>
46 <property name="receives_default">False</property>
47 <property name="use_action_appearance">False</property>
48 <property name="use_underline">True</property>
49 </object>
50 <packing>
51 <property name="expand">False</property>
52 <property name="fill">False</property>
53 <property name="position">1</property>
54 </packing>
55 </child>
56 </object>
57 <packing>
58 <property name="expand">False</property>
59 <property name="fill">True</property>
60 <property name="pack_type">end</property>
61 <property name="position">0</property>
62 </packing>
63 </child>
64 <child>
65 <object class="GtkHBox" id="hbox11">
66 <property name="visible">True</property>
67 <property name="can_focus">False</property>
68 <property name="border_width">6</property>
69 <property name="spacing">12</property>
70 <child>
71 <object class="GtkImage" id="image8">
72 <property name="visible">True</property>
73 <property name="can_focus">False</property>
74 <property name="xalign">0</property>
75 <property name="yalign">0</property>
76 <property name="stock">gtk-dialog-question</property>
77 <property name="icon-size">6</property>
78 </object>
79 <packing>
80 <property name="expand">False</property>
81 <property name="fill">True</property>
82 <property name="position">0</property>
83 </packing>
84 </child>
85 <child>
86 <object class="GtkLabel" id="label29">
87 <property name="visible">True</property>
88 <property name="can_focus">False</property>
89 <property name="xalign">0</property>
90 <property name="yalign">0</property>
91 <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;Cancel the running upgrade?&lt;/big&gt;&lt;/b&gt;
92
93The system could be in an unusable state if you cancel the upgrade. You are strongly adviced to resume the upgrade.</property>
94 <property name="use_markup">True</property>
95 <property name="wrap">True</property>
96 </object>
97 <packing>
98 <property name="expand">False</property>
99 <property name="fill">False</property>
100 <property name="position">1</property>
101 </packing>
102 </child>
103 </object>
104 <packing>
105 <property name="expand">False</property>
106 <property name="fill">True</property>
107 <property name="position">1</property>
108 </packing>
109 </child>
110 </object>
111 </child>
112 <action-widgets>
113 <action-widget response="-6">button_cancel</action-widget>
114 <action-widget response="-5">button_resume</action-widget>
115 </action-widgets>
116 </object>
117 <object class="GtkDialog" id="dialog_changes">
118 <property name="can_focus">False</property>
119 <property name="border_width">6</property>
120 <property name="window_position">center-on-parent</property>
121 <property name="default_width">500</property>
122 <property name="default_height">550</property>
123 <property name="type_hint">dialog</property>
124 <property name="skip_taskbar_hint">True</property>
125 <property name="skip_pager_hint">True</property>
126 <property name="urgency_hint">True</property>
127 <child internal-child="vbox">
128 <object class="GtkBox" id="vbox2">
129 <property name="visible">True</property>
130 <property name="can_focus">False</property>
131 <property name="spacing">6</property>
132 <child internal-child="action_area">
133 <object class="GtkButtonBox" id="hbuttonbox1">
134 <property name="visible">True</property>
135 <property name="can_focus">False</property>
136 <property name="layout_style">end</property>
137 <child>
138 <object class="GtkButton" id="button_cancel_changes">
139 <property name="label">gtk-cancel</property>
140 <property name="visible">True</property>
141 <property name="can_focus">True</property>
142 <property name="can_default">True</property>
143 <property name="receives_default">False</property>
144 <property name="use_action_appearance">False</property>
145 <property name="use_stock">True</property>
146 </object>
147 <packing>
148 <property name="expand">False</property>
149 <property name="fill">False</property>
150 <property name="position">0</property>
151 </packing>
152 </child>
153 <child>
154 <object class="GtkButton" id="button_confirm_changes">
155 <property name="label" translatable="yes">_Start Upgrade</property>
156 <property name="visible">True</property>
157 <property name="can_focus">True</property>
158 <property name="can_default">True</property>
159 <property name="receives_default">False</property>
160 <property name="use_action_appearance">False</property>
161 <property name="use_underline">True</property>
162 </object>
163 <packing>
164 <property name="expand">False</property>
165 <property name="fill">False</property>
166 <property name="position">1</property>
167 </packing>
168 </child>
169 </object>
170 <packing>
171 <property name="expand">False</property>
172 <property name="fill">True</property>
173 <property name="pack_type">end</property>
174 <property name="position">0</property>
175 </packing>
176 </child>
177 <child>
178 <object class="GtkHBox" id="hbox12">
179 <property name="visible">True</property>
180 <property name="can_focus">False</property>
181 <property name="border_width">6</property>
182 <property name="spacing">12</property>
183 <child>
184 <object class="GtkImage" id="image9">
185 <property name="visible">True</property>
186 <property name="can_focus">False</property>
187 <property name="xalign">0</property>
188 <property name="yalign">0</property>
189 <property name="stock">gtk-dialog-question</property>
190 <property name="icon-size">6</property>
191 </object>
192 <packing>
193 <property name="expand">False</property>
194 <property name="fill">True</property>
195 <property name="position">0</property>
196 </packing>
197 </child>
198 <child>
199 <object class="GtkVBox" id="vbox3">
200 <property name="visible">True</property>
201 <property name="can_focus">False</property>
202 <property name="spacing">12</property>
203 <child>
204 <object class="GtkLabel" id="label_summary">
205 <property name="visible">True</property>
206 <property name="can_focus">True</property>
207 <property name="xalign">0</property>
208 <property name="use_markup">True</property>
209 <property name="wrap">True</property>
210 <property name="selectable">True</property>
211 </object>
212 <packing>
213 <property name="expand">False</property>
214 <property name="fill">True</property>
215 <property name="position">0</property>
216 </packing>
217 </child>
218 <child>
219 <object class="GtkLabel" id="label_changes">
220 <property name="visible">True</property>
221 <property name="can_focus">False</property>
222 <property name="xalign">0</property>
223 <property name="use_markup">True</property>
224 <property name="wrap">True</property>
225 </object>
226 <packing>
227 <property name="expand">False</property>
228 <property name="fill">True</property>
229 <property name="position">1</property>
230 </packing>
231 </child>
232 <child>
233 <object class="GtkExpander" id="expander_details">
234 <property name="visible">True</property>
235 <property name="can_focus">True</property>
236 <property name="spacing">6</property>
237 <child>
238 <object class="GtkScrolledWindow" id="scrolledwindow1">
239 <property name="height_request">200</property>
240 <property name="visible">True</property>
241 <property name="can_focus">True</property>
242 <property name="shadow_type">in</property>
243 <child>
244 <object class="GtkTreeView" id="treeview_details">
245 <property name="visible">True</property>
246 <property name="can_focus">True</property>
247 <property name="headers_visible">False</property>
248 </object>
249 </child>
250 </object>
251 </child>
252 <child type="label">
253 <object class="GtkLabel" id="label4">
254 <property name="visible">True</property>
255 <property name="can_focus">False</property>
256 <property name="label" translatable="yes">Details</property>
257 </object>
258 </child>
259 </object>
260 <packing>
261 <property name="expand">True</property>
262 <property name="fill">True</property>
263 <property name="position">2</property>
264 </packing>
265 </child>
266 </object>
267 <packing>
268 <property name="expand">True</property>
269 <property name="fill">True</property>
270 <property name="position">1</property>
271 </packing>
272 </child>
273 </object>
274 <packing>
275 <property name="expand">True</property>
276 <property name="fill">True</property>
277 <property name="position">1</property>
278 </packing>
279 </child>
280 </object>
281 </child>
282 <action-widgets>
283 <action-widget response="-6">button_cancel_changes</action-widget>
284 <action-widget response="-8">button_confirm_changes</action-widget>
285 </action-widgets>
286 </object>
287 <object class="GtkDialog" id="dialog_conffile">
288 <property name="can_focus">False</property>
289 <property name="border_width">5</property>
290 <property name="resizable">False</property>
291 <property name="modal">True</property>
292 <property name="window_position">center-on-parent</property>
293 <property name="type_hint">dialog</property>
294 <child internal-child="vbox">
295 <object class="GtkBox" id="vbox12">
296 <property name="visible">True</property>
297 <property name="can_focus">False</property>
298 <property name="spacing">12</property>
299 <child internal-child="action_area">
300 <object class="GtkButtonBox" id="hbuttonbox6">
301 <property name="visible">True</property>
302 <property name="can_focus">False</property>
303 <property name="layout_style">end</property>
304 <child>
305 <object class="GtkButton" id="button9">
306 <property name="visible">True</property>
307 <property name="can_focus">True</property>
308 <property name="can_default">True</property>
309 <property name="has_default">True</property>
310 <property name="receives_default">False</property>
311 <property name="use_action_appearance">False</property>
312 <child>
313 <object class="GtkAlignment" id="alignment2">
314 <property name="visible">True</property>
315 <property name="can_focus">False</property>
316 <property name="xscale">0</property>
317 <property name="yscale">0</property>
318 <child>
319 <object class="GtkHBox" id="hbox13">
320 <property name="visible">True</property>
321 <property name="can_focus">False</property>
322 <property name="spacing">2</property>
323 <child>
324 <object class="GtkImage" id="image10">
325 <property name="visible">True</property>
326 <property name="can_focus">False</property>
327 <property name="stock">gtk-cancel</property>
328 </object>
329 <packing>
330 <property name="expand">False</property>
331 <property name="fill">False</property>
332 <property name="position">0</property>
333 </packing>
334 </child>
335 <child>
336 <object class="GtkLabel" id="label30">
337 <property name="visible">True</property>
338 <property name="can_focus">False</property>
339 <property name="label" translatable="yes">_Keep</property>
340 <property name="use_underline">True</property>
341 </object>
342 <packing>
343 <property name="expand">False</property>
344 <property name="fill">False</property>
345 <property name="position">1</property>
346 </packing>
347 </child>
348 </object>
349 </child>
350 </object>
351 </child>
352 </object>
353 <packing>
354 <property name="expand">False</property>
355 <property name="fill">False</property>
356 <property name="position">0</property>
357 </packing>
358 </child>
359 <child>
360 <object class="GtkButton" id="button10">
361 <property name="visible">True</property>
362 <property name="can_focus">True</property>
363 <property name="can_default">True</property>
364 <property name="receives_default">False</property>
365 <property name="use_action_appearance">False</property>
366 <child>
367 <object class="GtkAlignment" id="alignment3">
368 <property name="visible">True</property>
369 <property name="can_focus">False</property>
370 <property name="xscale">0</property>
371 <property name="yscale">0</property>
372 <child>
373 <object class="GtkHBox" id="hbox14">
374 <property name="visible">True</property>
375 <property name="can_focus">False</property>
376 <property name="spacing">2</property>
377 <child>
378 <object class="GtkImage" id="image11">
379 <property name="visible">True</property>
380 <property name="can_focus">False</property>
381 <property name="stock">gtk-ok</property>
382 </object>
383 <packing>
384 <property name="expand">False</property>
385 <property name="fill">False</property>
386 <property name="position">0</property>
387 </packing>
388 </child>
389 <child>
390 <object class="GtkLabel" id="label31">
391 <property name="visible">True</property>
392 <property name="can_focus">False</property>
393 <property name="label" translatable="yes">_Replace</property>
394 <property name="use_underline">True</property>
395 </object>
396 <packing>
397 <property name="expand">False</property>
398 <property name="fill">False</property>
399 <property name="position">1</property>
400 </packing>
401 </child>
402 </object>
403 </child>
404 </object>
405 </child>
406 </object>
407 <packing>
408 <property name="expand">False</property>
409 <property name="fill">False</property>
410 <property name="position">1</property>
411 </packing>
412 </child>
413 </object>
414 <packing>
415 <property name="expand">False</property>
416 <property name="fill">True</property>
417 <property name="pack_type">end</property>
418 <property name="position">0</property>
419 </packing>
420 </child>
421 <child>
422 <object class="GtkHBox" id="hbox15">
423 <property name="visible">True</property>
424 <property name="can_focus">False</property>
425 <property name="border_width">6</property>
426 <property name="spacing">12</property>
427 <child>
428 <object class="GtkImage" id="image12">
429 <property name="visible">True</property>
430 <property name="can_focus">False</property>
431 <property name="xalign">0</property>
432 <property name="yalign">0</property>
433 <property name="stock">gtk-dialog-question</property>
434 <property name="icon-size">6</property>
435 </object>
436 <packing>
437 <property name="expand">False</property>
438 <property name="fill">False</property>
439 <property name="position">0</property>
440 </packing>
441 </child>
442 <child>
443 <object class="GtkVBox" id="vbox13">
444 <property name="visible">True</property>
445 <property name="can_focus">False</property>
446 <property name="spacing">12</property>
447 <child>
448 <object class="GtkLabel" id="label_conffile">
449 <property name="visible">True</property>
450 <property name="can_focus">False</property>
451 <property name="xalign">0</property>
452 <property name="use_markup">True</property>
453 <property name="wrap">True</property>
454 </object>
455 <packing>
456 <property name="expand">False</property>
457 <property name="fill">False</property>
458 <property name="position">0</property>
459 </packing>
460 </child>
461 </object>
462 <packing>
463 <property name="expand">True</property>
464 <property name="fill">True</property>
465 <property name="position">1</property>
466 </packing>
467 </child>
468 </object>
469 <packing>
470 <property name="expand">False</property>
471 <property name="fill">True</property>
472 <property name="position">1</property>
473 </packing>
474 </child>
475 <child>
476 <object class="GtkExpander" id="expander3">
477 <property name="visible">True</property>
478 <property name="can_focus">True</property>
479 <child>
480 <object class="GtkVBox" id="vbox14">
481 <property name="visible">True</property>
482 <property name="can_focus">False</property>
483 <child>
484 <object class="GtkScrolledWindow" id="scrolledwindow5">
485 <property name="visible">True</property>
486 <property name="can_focus">True</property>
487 <property name="shadow_type">in</property>
488 <child>
489 <object class="GtkTextView" id="textview_conffile">
490 <property name="height_request">300</property>
491 <property name="visible">True</property>
492 <property name="can_focus">True</property>
493 <property name="editable">False</property>
494 <property name="cursor_visible">False</property>
495 </object>
496 </child>
497 </object>
498 <packing>
499 <property name="expand">False</property>
500 <property name="fill">False</property>
501 <property name="position">0</property>
502 </packing>
503 </child>
504 </object>
505 </child>
506 <child type="label">
507 <object class="GtkLabel" id="label33">
508 <property name="visible">True</property>
509 <property name="can_focus">False</property>
510 <property name="label" translatable="yes">Difference between the files</property>
511 </object>
512 </child>
513 </object>
514 <packing>
515 <property name="expand">False</property>
516 <property name="fill">True</property>
517 <property name="position">2</property>
518 </packing>
519 </child>
520 </object>
521 </child>
522 <action-widgets>
523 <action-widget response="-9">button9</action-widget>
524 <action-widget response="-8">button10</action-widget>
525 </action-widgets>
526 </object>
527 <object class="GtkDialog" id="dialog_error">
528 <property name="can_focus">False</property>
529 <property name="border_width">6</property>
530 <property name="resizable">False</property>
531 <property name="window_position">center-on-parent</property>
532 <property name="type_hint">dialog</property>
533 <property name="skip_taskbar_hint">True</property>
534 <property name="skip_pager_hint">True</property>
535 <property name="urgency_hint">True</property>
536 <child internal-child="vbox">
537 <object class="GtkBox" id="vbox6">
538 <property name="visible">True</property>
539 <property name="can_focus">False</property>
540 <property name="spacing">12</property>
541 <child internal-child="action_area">
542 <object class="GtkButtonBox" id="hbuttonbox3">
543 <property name="visible">True</property>
544 <property name="can_focus">False</property>
545 <property name="layout_style">end</property>
546 <child>
547 <object class="GtkButton" id="button_bugreport">
548 <property name="label" translatable="yes">_Report Bug</property>
549 <property name="can_focus">True</property>
550 <property name="can_default">True</property>
551 <property name="has_default">True</property>
552 <property name="receives_default">False</property>
553 <property name="use_action_appearance">False</property>
554 <property name="use_underline">True</property>
555 </object>
556 <packing>
557 <property name="expand">False</property>
558 <property name="fill">False</property>
559 <property name="position">0</property>
560 </packing>
561 </child>
562 <child>
563 <object class="GtkButton" id="button6">
564 <property name="label">gtk-close</property>
565 <property name="visible">True</property>
566 <property name="can_focus">True</property>
567 <property name="can_default">True</property>
568 <property name="has_default">True</property>
569 <property name="receives_default">False</property>
570 <property name="use_action_appearance">False</property>
571 <property name="use_stock">True</property>
572 </object>
573 <packing>
574 <property name="expand">False</property>
575 <property name="fill">False</property>
576 <property name="position">1</property>
577 </packing>
578 </child>
579 </object>
580 <packing>
581 <property name="expand">False</property>
582 <property name="fill">True</property>
583 <property name="pack_type">end</property>
584 <property name="position">0</property>
585 </packing>
586 </child>
587 <child>
588 <object class="GtkHBox" id="hbox8">
589 <property name="visible">True</property>
590 <property name="can_focus">False</property>
591 <property name="border_width">6</property>
592 <property name="spacing">12</property>
593 <child>
594 <object class="GtkImage" id="image5">
595 <property name="visible">True</property>
596 <property name="can_focus">False</property>
597 <property name="xalign">0</property>
598 <property name="yalign">0</property>
599 <property name="stock">gtk-dialog-error</property>
600 <property name="icon-size">6</property>
601 </object>
602 <packing>
603 <property name="expand">False</property>
604 <property name="fill">True</property>
605 <property name="position">0</property>
606 </packing>
607 </child>
608 <child>
609 <object class="GtkVBox" id="vbox7">
610 <property name="visible">True</property>
611 <property name="can_focus">False</property>
612 <property name="spacing">12</property>
613 <child>
614 <object class="GtkLabel" id="label_error">
615 <property name="visible">True</property>
616 <property name="can_focus">True</property>
617 <property name="xalign">0</property>
618 <property name="use_markup">True</property>
619 <property name="wrap">True</property>
620 <property name="selectable">True</property>
621 </object>
622 <packing>
623 <property name="expand">False</property>
624 <property name="fill">True</property>
625 <property name="position">0</property>
626 </packing>
627 </child>
628 <child>
629 <object class="GtkScrolledWindow" id="scroll_error">
630 <property name="width_request">400</property>
631 <property name="height_request">200</property>
632 <property name="can_focus">True</property>
633 <property name="shadow_type">in</property>
634 <child>
635 <object class="GtkTextView" id="textview_error">
636 <property name="visible">True</property>
637 <property name="can_focus">True</property>
638 <property name="pixels_above_lines">4</property>
639 <property name="pixels_below_lines">4</property>
640 <property name="editable">False</property>
641 <property name="left_margin">4</property>
642 <property name="right_margin">4</property>
643 </object>
644 </child>
645 </object>
646 <packing>
647 <property name="expand">True</property>
648 <property name="fill">True</property>
649 <property name="position">1</property>
650 </packing>
651 </child>
652 </object>
653 <packing>
654 <property name="expand">True</property>
655 <property name="fill">True</property>
656 <property name="position">1</property>
657 </packing>
658 </child>
659 </object>
660 <packing>
661 <property name="expand">False</property>
662 <property name="fill">True</property>
663 <property name="position">1</property>
664 </packing>
665 </child>
666 </object>
667 </child>
668 <action-widgets>
669 <action-widget response="-8">button_bugreport</action-widget>
670 <action-widget response="-7">button6</action-widget>
671 </action-widgets>
672 </object>
673 <object class="GtkDialog" id="dialog_information">
674 <property name="can_focus">False</property>
675 <property name="border_width">6</property>
676 <property name="resizable">False</property>
677 <property name="window_position">center-on-parent</property>
678 <property name="type_hint">dialog</property>
679 <property name="skip_taskbar_hint">True</property>
680 <property name="skip_pager_hint">True</property>
681 <property name="urgency_hint">True</property>
682 <child internal-child="vbox">
683 <object class="GtkBox" id="vbox15">
684 <property name="visible">True</property>
685 <property name="can_focus">False</property>
686 <property name="spacing">12</property>
687 <child internal-child="action_area">
688 <object class="GtkButtonBox" id="hbuttonbox7">
689 <property name="visible">True</property>
690 <property name="can_focus">False</property>
691 <property name="layout_style">end</property>
692 <child>
693 <object class="GtkButton" id="button12">
694 <property name="label">gtk-close</property>
695 <property name="visible">True</property>
696 <property name="can_focus">True</property>
697 <property name="can_default">True</property>
698 <property name="has_default">True</property>
699 <property name="receives_default">False</property>
700 <property name="use_action_appearance">False</property>
701 <property name="use_stock">True</property>
702 </object>
703 <packing>
704 <property name="expand">False</property>
705 <property name="fill">False</property>
706 <property name="position">0</property>
707 </packing>
708 </child>
709 </object>
710 <packing>
711 <property name="expand">False</property>
712 <property name="fill">True</property>
713 <property name="pack_type">end</property>
714 <property name="position">0</property>
715 </packing>
716 </child>
717 <child>
718 <object class="GtkHBox" id="hbox16">
719 <property name="visible">True</property>
720 <property name="can_focus">False</property>
721 <property name="border_width">6</property>
722 <property name="spacing">12</property>
723 <child>
724 <object class="GtkImage" id="image13">
725 <property name="visible">True</property>
726 <property name="can_focus">False</property>
727 <property name="xalign">0</property>
728 <property name="yalign">0</property>
729 <property name="stock">gtk-dialog-info</property>
730 <property name="icon-size">6</property>
731 </object>
732 <packing>
733 <property name="expand">False</property>
734 <property name="fill">True</property>
735 <property name="position">0</property>
736 </packing>
737 </child>
738 <child>
739 <object class="GtkVBox" id="vbox16">
740 <property name="visible">True</property>
741 <property name="can_focus">False</property>
742 <property name="spacing">12</property>
743 <child>
744 <object class="GtkLabel" id="label_information">
745 <property name="visible">True</property>
746 <property name="can_focus">True</property>
747 <property name="xalign">0</property>
748 <property name="use_markup">True</property>
749 <property name="wrap">True</property>
750 <property name="selectable">True</property>
751 </object>
752 <packing>
753 <property name="expand">False</property>
754 <property name="fill">True</property>
755 <property name="position">0</property>
756 </packing>
757 </child>
758 <child>
759 <object class="GtkScrolledWindow" id="scroll_information">
760 <property name="width_request">400</property>
761 <property name="height_request">200</property>
762 <property name="can_focus">True</property>
763 <property name="shadow_type">in</property>
764 <child>
765 <object class="GtkTextView" id="textview_information">
766 <property name="visible">True</property>
767 <property name="can_focus">True</property>
768 <property name="pixels_above_lines">4</property>
769 <property name="pixels_below_lines">4</property>
770 <property name="editable">False</property>
771 <property name="left_margin">4</property>
772 <property name="right_margin">4</property>
773 </object>
774 </child>
775 </object>
776 <packing>
777 <property name="expand">True</property>
778 <property name="fill">True</property>
779 <property name="position">1</property>
780 </packing>
781 </child>
782 </object>
783 <packing>
784 <property name="expand">True</property>
785 <property name="fill">True</property>
786 <property name="position">1</property>
787 </packing>
788 </child>
789 </object>
790 <packing>
791 <property name="expand">False</property>
792 <property name="fill">True</property>
793 <property name="position">1</property>
794 </packing>
795 </child>
796 </object>
797 </child>
798 <action-widgets>
799 <action-widget response="-5">button12</action-widget>
800 </action-widgets>
801 </object>
802 <object class="GtkDialog" id="dialog_obsolete">
803 <property name="can_focus">False</property>
804 <property name="border_width">6</property>
805 <property name="resizable">False</property>
806 <property name="window_position">center-on-parent</property>
807 <property name="default_width">500</property>
808 <property name="default_height">400</property>
809 <property name="type_hint">dialog</property>
810 <property name="skip_taskbar_hint">True</property>
811 <property name="skip_pager_hint">True</property>
812 <property name="urgency_hint">True</property>
813 <child internal-child="vbox">
814 <object class="GtkBox" id="vbox8">
815 <property name="visible">True</property>
816 <property name="can_focus">False</property>
817 <property name="spacing">6</property>
818 <child internal-child="action_area">
819 <object class="GtkButtonBox" id="hbuttonbox4">
820 <property name="visible">True</property>
821 <property name="can_focus">False</property>
822 <property name="layout_style">end</property>
823 <child>
824 <object class="GtkButton" id="button7">
825 <property name="label">gtk-cancel</property>
826 <property name="visible">True</property>
827 <property name="can_focus">True</property>
828 <property name="can_default">True</property>
829 <property name="receives_default">False</property>
830 <property name="use_action_appearance">False</property>
831 <property name="use_stock">True</property>
832 </object>
833 <packing>
834 <property name="expand">False</property>
835 <property name="fill">False</property>
836 <property name="position">0</property>
837 </packing>
838 </child>
839 <child>
840 <object class="GtkButton" id="button8">
841 <property name="label" translatable="yes">_Continue</property>
842 <property name="visible">True</property>
843 <property name="can_focus">True</property>
844 <property name="can_default">True</property>
845 <property name="receives_default">False</property>
846 <property name="use_action_appearance">False</property>
847 <property name="use_underline">True</property>
848 </object>
849 <packing>
850 <property name="expand">False</property>
851 <property name="fill">False</property>
852 <property name="position">1</property>
853 </packing>
854 </child>
855 </object>
856 <packing>
857 <property name="expand">False</property>
858 <property name="fill">True</property>
859 <property name="pack_type">end</property>
860 <property name="position">0</property>
861 </packing>
862 </child>
863 <child>
864 <object class="GtkVBox" id="vbox9">
865 <property name="visible">True</property>
866 <property name="can_focus">False</property>
867 <property name="border_width">6</property>
868 <property name="spacing">12</property>
869 <child>
870 <object class="GtkHBox" id="hbox9">
871 <property name="visible">True</property>
872 <property name="can_focus">False</property>
873 <property name="spacing">12</property>
874 <child>
875 <object class="GtkImage" id="image6">
876 <property name="visible">True</property>
877 <property name="can_focus">False</property>
878 <property name="xalign">0</property>
879 <property name="yalign">0</property>
880 <property name="stock">gtk-dialog-warning</property>
881 <property name="icon-size">6</property>
882 </object>
883 <packing>
884 <property name="expand">False</property>
885 <property name="fill">True</property>
886 <property name="position">0</property>
887 </packing>
888 </child>
889 <child>
890 <object class="GtkVBox" id="vbox10">
891 <property name="visible">True</property>
892 <property name="can_focus">False</property>
893 <property name="spacing">12</property>
894 <child>
895 <object class="GtkLabel" id="label26">
896 <property name="visible">True</property>
897 <property name="can_focus">False</property>
898 <property name="xalign">0</property>
899 <property name="yalign">0</property>
900 <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;Start the upgrade?&lt;/big&gt;&lt;/b&gt;</property>
901 <property name="use_markup">True</property>
902 <property name="wrap">True</property>
903 </object>
904 <packing>
905 <property name="expand">False</property>
906 <property name="fill">False</property>
907 <property name="position">0</property>
908 </packing>
909 </child>
910 <child>
911 <object class="GtkLabel" id="label27">
912 <property name="visible">True</property>
913 <property name="can_focus">False</property>
914 <property name="xalign">0</property>
915 <property name="yalign">0</property>
916 <property name="wrap">True</property>
917 </object>
918 <packing>
919 <property name="expand">False</property>
920 <property name="fill">False</property>
921 <property name="position">1</property>
922 </packing>
923 </child>
924 <child>
925 <object class="GtkExpander" id="expander2">
926 <property name="visible">True</property>
927 <property name="can_focus">True</property>
928 <child>
929 <object class="GtkScrolledWindow" id="scrolledwindow4">
930 <property name="width_request">400</property>
931 <property name="height_request">200</property>
932 <property name="visible">True</property>
933 <property name="can_focus">True</property>
934 <property name="shadow_type">in</property>
935 <child>
936 <object class="GtkTreeView" id="treeview2">
937 <property name="visible">True</property>
938 <property name="can_focus">True</property>
939 <property name="headers_visible">False</property>
940 </object>
941 </child>
942 </object>
943 </child>
944 <child type="label">
945 <object class="GtkLabel" id="label25">
946 <property name="visible">True</property>
947 <property name="can_focus">False</property>
948 <property name="label" translatable="yes">Details</property>
949 </object>
950 </child>
951 </object>
952 <packing>
953 <property name="expand">False</property>
954 <property name="fill">False</property>
955 <property name="position">2</property>
956 </packing>
957 </child>
958 </object>
959 <packing>
960 <property name="expand">False</property>
961 <property name="fill">False</property>
962 <property name="position">1</property>
963 </packing>
964 </child>
965 </object>
966 <packing>
967 <property name="expand">False</property>
968 <property name="fill">False</property>
969 <property name="position">0</property>
970 </packing>
971 </child>
972 </object>
973 <packing>
974 <property name="expand">False</property>
975 <property name="fill">True</property>
976 <property name="position">1</property>
977 </packing>
978 </child>
979 </object>
980 </child>
981 <action-widgets>
982 <action-widget response="-6">button7</action-widget>
983 <action-widget response="-8">button8</action-widget>
984 </action-widgets>
985 </object>
986 <object class="GtkDialog" id="dialog_restart">
987 <property name="can_focus">False</property>
988 <property name="border_width">6</property>
989 <property name="resizable">False</property>
990 <property name="window_position">center-on-parent</property>
991 <property name="type_hint">dialog</property>
992 <property name="skip_taskbar_hint">True</property>
993 <property name="skip_pager_hint">True</property>
994 <property name="urgency_hint">True</property>
995 <child internal-child="vbox">
996 <object class="GtkBox" id="dialog-vbox1">
997 <property name="visible">True</property>
998 <property name="can_focus">False</property>
999 <property name="spacing">12</property>
1000 <child internal-child="action_area">
1001 <object class="GtkButtonBox" id="dialog-action_area1">
1002 <property name="visible">True</property>
1003 <property name="can_focus">False</property>
1004 <property name="layout_style">end</property>
1005 <child>
1006 <object class="GtkButton" id="button_restart">
1007 <property name="visible">True</property>
1008 <property name="can_focus">True</property>
1009 <property name="can_default">True</property>
1010 <property name="receives_default">False</property>
1011 <property name="use_action_appearance">False</property>
1012 <child>
1013 <object class="GtkAlignment" id="alignment1">
1014 <property name="visible">True</property>
1015 <property name="can_focus">False</property>
1016 <property name="xscale">0</property>
1017 <property name="yscale">0</property>
1018 <child>
1019 <object class="GtkHBox" id="hbox6">
1020 <property name="visible">True</property>
1021 <property name="can_focus">False</property>
1022 <property name="spacing">2</property>
1023 <child>
1024 <object class="GtkImage" id="image3">
1025 <property name="visible">True</property>
1026 <property name="can_focus">False</property>
1027 <property name="stock">gtk-refresh</property>
1028 </object>
1029 <packing>
1030 <property name="expand">False</property>
1031 <property name="fill">False</property>
1032 <property name="position">0</property>
1033 </packing>
1034 </child>
1035 <child>
1036 <object class="GtkLabel" id="label20">
1037 <property name="visible">True</property>
1038 <property name="can_focus">False</property>
1039 <property name="label" translatable="yes">_Restart Now</property>
1040 <property name="use_underline">True</property>
1041 </object>
1042 <packing>
1043 <property name="expand">False</property>
1044 <property name="fill">False</property>
1045 <property name="position">1</property>
1046 </packing>
1047 </child>
1048 </object>
1049 </child>
1050 </object>
1051 </child>
1052 </object>
1053 <packing>
1054 <property name="expand">False</property>
1055 <property name="fill">False</property>
1056 <property name="position">0</property>
1057 </packing>
1058 </child>
1059 <child>
1060 <object class="GtkButton" id="button_restart1">
1061 <property name="label">gtk-close</property>
1062 <property name="visible">True</property>
1063 <property name="can_focus">True</property>
1064 <property name="can_default">True</property>
1065 <property name="receives_default">False</property>
1066 <property name="use_action_appearance">False</property>
1067 <property name="use_stock">True</property>
1068 </object>
1069 <packing>
1070 <property name="expand">False</property>
1071 <property name="fill">False</property>
1072 <property name="position">1</property>
1073 </packing>
1074 </child>
1075 </object>
1076 <packing>
1077 <property name="expand">False</property>
1078 <property name="fill">True</property>
1079 <property name="pack_type">end</property>
1080 <property name="position">0</property>
1081 </packing>
1082 </child>
1083 <child>
1084 <object class="GtkHBox" id="hbox5">
1085 <property name="visible">True</property>
1086 <property name="can_focus">False</property>
1087 <property name="border_width">6</property>
1088 <property name="spacing">12</property>
1089 <child>
1090 <object class="GtkImage" id="image2">
1091 <property name="visible">True</property>
1092 <property name="can_focus">False</property>
1093 <property name="xalign">0</property>
1094 <property name="yalign">0</property>
1095 <property name="stock">gtk-dialog-info</property>
1096 <property name="icon-size">6</property>
1097 </object>
1098 <packing>
1099 <property name="expand">False</property>
1100 <property name="fill">True</property>
1101 <property name="position">0</property>
1102 </packing>
1103 </child>
1104 <child>
1105 <object class="GtkLabel" id="label19">
1106 <property name="visible">True</property>
1107 <property name="can_focus">False</property>
1108 <property name="xalign">0</property>
1109 <property name="yalign">0</property>
1110 <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;Restart the system to complete the upgrade&lt;/big&gt;&lt;/b&gt;
1111
1112Please save your work before continuing.</property>
1113 <property name="use_markup">True</property>
1114 </object>
1115 <packing>
1116 <property name="expand">False</property>
1117 <property name="fill">False</property>
1118 <property name="position">1</property>
1119 </packing>
1120 </child>
1121 </object>
1122 <packing>
1123 <property name="expand">False</property>
1124 <property name="fill">True</property>
1125 <property name="position">1</property>
1126 </packing>
1127 </child>
1128 </object>
1129 </child>
1130 <action-widgets>
1131 <action-widget response="-8">button_restart</action-widget>
1132 <action-widget response="-5">button_restart1</action-widget>
1133 </action-widgets>
1134 </object>
1135 <object class="GtkWindow" id="window_main">
1136 <property name="visible">True</property>
1137 <property name="can_focus">False</property>
1138 <property name="border_width">6</property>
1139 <property name="title" translatable="yes">Distribution Upgrade</property>
1140 <property name="resizable">False</property>
1141 <property name="window_position">center</property>
1142 <property name="urgency_hint">True</property>
1143 <signal name="delete-event" handler="on_window_main_delete_event" swapped="no"/>
1144 <child>
1145 <object class="GtkVBox" id="vbox5">
1146 <property name="visible">True</property>
1147 <property name="can_focus">False</property>
1148 <property name="spacing">12</property>
1149 <child>
1150 <object class="GtkVBox" id="vbox_main">
1151 <property name="visible">True</property>
1152 <property name="can_focus">False</property>
1153 <property name="border_width">6</property>
1154 <property name="spacing">12</property>
1155 <child>
1156 <object class="GtkLabel" id="label_title">
1157 <property name="visible">True</property>
1158 <property name="can_focus">False</property>
1159 <property name="xalign">0</property>
1160 <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;Upgrading Ubuntu to version 12.10&lt;/big&gt;&lt;/b&gt;</property>
1161 <property name="use_markup">True</property>
1162 </object>
1163 <packing>
1164 <property name="expand">False</property>
1165 <property name="fill">False</property>
1166 <property name="position">0</property>
1167 </packing>
1168 </child>
1169 <child>
1170 <object class="GtkHBox" id="hbox3">
1171 <property name="visible">True</property>
1172 <property name="can_focus">False</property>
1173 <child>
1174 <object class="GtkLabel" id="label17">
1175 <property name="visible">True</property>
1176 <property name="can_focus">False</property>
1177 <property name="label" translatable="yes"> </property>
1178 </object>
1179 <packing>
1180 <property name="expand">False</property>
1181 <property name="fill">False</property>
1182 <property name="position">0</property>
1183 </packing>
1184 </child>
1185 <child>
1186 <object class="GtkTable" id="table_steps">
1187 <property name="visible">True</property>
1188 <property name="can_focus">False</property>
1189 <property name="n_rows">6</property>
1190 <property name="n_columns">2</property>
1191 <property name="column_spacing">6</property>
1192 <property name="row_spacing">6</property>
1193 <child>
1194 <object class="GtkLabel" id="label_step1">
1195 <property name="visible">True</property>
1196 <property name="can_focus">False</property>
1197 <property name="xalign">0</property>
1198 <property name="label" translatable="yes">Preparing to upgrade</property>
1199 </object>
1200 <packing>
1201 <property name="left_attach">1</property>
1202 <property name="right_attach">2</property>
1203 <property name="x_options">GTK_FILL</property>
1204 <property name="y_options"></property>
1205 </packing>
1206 </child>
1207 <child>
1208 <object class="GtkLabel" id="label_step2">
1209 <property name="visible">True</property>
1210 <property name="can_focus">False</property>
1211 <property name="xalign">0</property>
1212 <property name="label" translatable="yes">Setting new software channels</property>
1213 </object>
1214 <packing>
1215 <property name="left_attach">1</property>
1216 <property name="right_attach">2</property>
1217 <property name="top_attach">1</property>
1218 <property name="bottom_attach">2</property>
1219 <property name="x_options">GTK_FILL</property>
1220 <property name="y_options"></property>
1221 </packing>
1222 </child>
1223 <child>
1224 <object class="GtkLabel" id="label_step3">
1225 <property name="visible">True</property>
1226 <property name="can_focus">False</property>
1227 <property name="xalign">0</property>
1228 <property name="label" translatable="yes">Getting new packages</property>
1229 </object>
1230 <packing>
1231 <property name="left_attach">1</property>
1232 <property name="right_attach">2</property>
1233 <property name="top_attach">2</property>
1234 <property name="bottom_attach">3</property>
1235 <property name="x_options">GTK_FILL</property>
1236 <property name="y_options"></property>
1237 </packing>
1238 </child>
1239 <child>
1240 <object class="GtkHBox" id="hbox17">
1241 <property name="visible">True</property>
1242 <property name="can_focus">False</property>
1243 <child>
1244 <object class="GtkArrow" id="arrow_step1">
1245 <property name="can_focus">False</property>
1246 </object>
1247 <packing>
1248 <property name="expand">True</property>
1249 <property name="fill">True</property>
1250 <property name="position">0</property>
1251 </packing>
1252 </child>
1253 <child>
1254 <object class="GtkImage" id="image_step1">
1255 <property name="width_request">18</property>
1256 <property name="height_request">18</property>
1257 <property name="can_focus">False</property>
1258 </object>
1259 <packing>
1260 <property name="expand">True</property>
1261 <property name="fill">True</property>
1262 <property name="position">1</property>
1263 </packing>
1264 </child>
1265 </object>
1266 <packing>
1267 <property name="x_options">GTK_FILL</property>
1268 <property name="y_options">GTK_FILL</property>
1269 </packing>
1270 </child>
1271 <child>
1272 <object class="GtkHBox" id="hbox18">
1273 <property name="visible">True</property>
1274 <property name="can_focus">False</property>
1275 <child>
1276 <object class="GtkArrow" id="arrow_step2">
1277 <property name="can_focus">False</property>
1278 </object>
1279 <packing>
1280 <property name="expand">True</property>
1281 <property name="fill">True</property>
1282 <property name="position">0</property>
1283 </packing>
1284 </child>
1285 <child>
1286 <object class="GtkImage" id="image_step2">
1287 <property name="width_request">18</property>
1288 <property name="height_request">18</property>
1289 <property name="can_focus">False</property>
1290 </object>
1291 <packing>
1292 <property name="expand">True</property>
1293 <property name="fill">True</property>
1294 <property name="position">1</property>
1295 </packing>
1296 </child>
1297 </object>
1298 <packing>
1299 <property name="top_attach">1</property>
1300 <property name="bottom_attach">2</property>
1301 <property name="x_options">GTK_FILL</property>
1302 <property name="y_options">GTK_FILL</property>
1303 </packing>
1304 </child>
1305 <child>
1306 <object class="GtkHBox" id="hbox19">
1307 <property name="visible">True</property>
1308 <property name="can_focus">False</property>
1309 <child>
1310 <object class="GtkArrow" id="arrow_step3">
1311 <property name="can_focus">False</property>
1312 </object>
1313 <packing>
1314 <property name="expand">True</property>
1315 <property name="fill">True</property>
1316 <property name="position">0</property>
1317 </packing>
1318 </child>
1319 <child>
1320 <object class="GtkImage" id="image_step3">
1321 <property name="width_request">18</property>
1322 <property name="height_request">18</property>
1323 <property name="can_focus">False</property>
1324 </object>
1325 <packing>
1326 <property name="expand">True</property>
1327 <property name="fill">True</property>
1328 <property name="position">1</property>
1329 </packing>
1330 </child>
1331 </object>
1332 <packing>
1333 <property name="top_attach">2</property>
1334 <property name="bottom_attach">3</property>
1335 <property name="x_options">GTK_FILL</property>
1336 <property name="y_options">GTK_FILL</property>
1337 </packing>
1338 </child>
1339 <child>
1340 <object class="GtkLabel" id="label_step6">
1341 <property name="visible">True</property>
1342 <property name="can_focus">False</property>
1343 <property name="xalign">0</property>
1344 <property name="label" translatable="yes">Restarting the computer</property>
1345 </object>
1346 <packing>
1347 <property name="left_attach">1</property>
1348 <property name="right_attach">2</property>
1349 <property name="top_attach">5</property>
1350 <property name="bottom_attach">6</property>
1351 <property name="x_options">GTK_FILL</property>
1352 <property name="y_options"></property>
1353 </packing>
1354 </child>
1355 <child>
1356 <object class="GtkHBox" id="hbox21">
1357 <property name="visible">True</property>
1358 <property name="can_focus">False</property>
1359 <child>
1360 <object class="GtkArrow" id="arrow_step6">
1361 <property name="can_focus">False</property>
1362 </object>
1363 <packing>
1364 <property name="expand">True</property>
1365 <property name="fill">True</property>
1366 <property name="position">0</property>
1367 </packing>
1368 </child>
1369 <child>
1370 <object class="GtkImage" id="image_step6">
1371 <property name="width_request">18</property>
1372 <property name="height_request">18</property>
1373 <property name="can_focus">False</property>
1374 </object>
1375 <packing>
1376 <property name="expand">True</property>
1377 <property name="fill">True</property>
1378 <property name="position">1</property>
1379 </packing>
1380 </child>
1381 </object>
1382 <packing>
1383 <property name="top_attach">5</property>
1384 <property name="bottom_attach">6</property>
1385 <property name="x_options">GTK_FILL</property>
1386 <property name="y_options">GTK_FILL</property>
1387 </packing>
1388 </child>
1389 <child>
1390 <object class="GtkHBox" id="hbox20">
1391 <property name="visible">True</property>
1392 <property name="can_focus">False</property>
1393 <child>
1394 <object class="GtkArrow" id="arrow_step5">
1395 <property name="can_focus">False</property>
1396 </object>
1397 <packing>
1398 <property name="expand">True</property>
1399 <property name="fill">True</property>
1400 <property name="position">0</property>
1401 </packing>
1402 </child>
1403 <child>
1404 <object class="GtkImage" id="image_step5">
1405 <property name="width_request">18</property>
1406 <property name="height_request">18</property>
1407 <property name="can_focus">False</property>
1408 </object>
1409 <packing>
1410 <property name="expand">True</property>
1411 <property name="fill">True</property>
1412 <property name="position">1</property>
1413 </packing>
1414 </child>
1415 </object>
1416 <packing>
1417 <property name="top_attach">4</property>
1418 <property name="bottom_attach">5</property>
1419 <property name="x_options">GTK_FILL</property>
1420 <property name="y_options">GTK_FILL</property>
1421 </packing>
1422 </child>
1423 <child>
1424 <object class="GtkLabel" id="label_step5">
1425 <property name="visible">True</property>
1426 <property name="can_focus">False</property>
1427 <property name="xalign">0</property>
1428 <property name="label" translatable="yes">Cleaning up</property>
1429 </object>
1430 <packing>
1431 <property name="left_attach">1</property>
1432 <property name="right_attach">2</property>
1433 <property name="top_attach">4</property>
1434 <property name="bottom_attach">5</property>
1435 <property name="x_options">GTK_FILL</property>
1436 <property name="y_options"></property>
1437 </packing>
1438 </child>
1439 <child>
1440 <object class="GtkLabel" id="label_step4">
1441 <property name="visible">True</property>
1442 <property name="can_focus">False</property>
1443 <property name="xalign">0</property>
1444 <property name="label" translatable="yes">Installing the upgrades</property>
1445 </object>
1446 <packing>
1447 <property name="left_attach">1</property>
1448 <property name="right_attach">2</property>
1449 <property name="top_attach">3</property>
1450 <property name="bottom_attach">4</property>
1451 <property name="x_options">GTK_FILL</property>
1452 <property name="y_options"></property>
1453 </packing>
1454 </child>
1455 <child>
1456 <object class="GtkHBox" id="hbox22">
1457 <property name="visible">True</property>
1458 <property name="can_focus">False</property>
1459 <child>
1460 <object class="GtkArrow" id="arrow_step4">
1461 <property name="can_focus">False</property>
1462 </object>
1463 <packing>
1464 <property name="expand">True</property>
1465 <property name="fill">True</property>
1466 <property name="position">0</property>
1467 </packing>
1468 </child>
1469 <child>
1470 <object class="GtkImage" id="image_step4">
1471 <property name="width_request">18</property>
1472 <property name="height_request">18</property>
1473 <property name="can_focus">False</property>
1474 </object>
1475 <packing>
1476 <property name="expand">True</property>
1477 <property name="fill">True</property>
1478 <property name="position">1</property>
1479 </packing>
1480 </child>
1481 </object>
1482 <packing>
1483 <property name="top_attach">3</property>
1484 <property name="bottom_attach">4</property>
1485 <property name="x_options">GTK_FILL</property>
1486 <property name="y_options">GTK_FILL</property>
1487 </packing>
1488 </child>
1489 </object>
1490 <packing>
1491 <property name="expand">True</property>
1492 <property name="fill">True</property>
1493 <property name="position">1</property>
1494 </packing>
1495 </child>
1496 </object>
1497 <packing>
1498 <property name="expand">True</property>
1499 <property name="fill">True</property>
1500 <property name="position">1</property>
1501 </packing>
1502 </child>
1503 <child>
1504 <object class="GtkVBox" id="vbox22">
1505 <property name="visible">True</property>
1506 <property name="can_focus">False</property>
1507 <property name="spacing">4</property>
1508 <child>
1509 <object class="GtkProgressBar" id="progressbar_cache">
1510 <property name="width_request">350</property>
1511 <property name="visible">True</property>
1512 <property name="can_focus">False</property>
1513 <property name="pulse_step">0.10000000149</property>
1514 <property name="text"> </property>
1515 <property name="ellipsize">end</property>
1516 </object>
1517 <packing>
1518 <property name="expand">False</property>
1519 <property name="fill">False</property>
1520 <property name="position">0</property>
1521 </packing>
1522 </child>
1523 <child>
1524 <object class="GtkLabel" id="label_status">
1525 <property name="visible">True</property>
1526 <property name="can_focus">False</property>
1527 <property name="xalign">0</property>
1528 <property name="wrap">True</property>
1529 <property name="ellipsize">end</property>
1530 </object>
1531 <packing>
1532 <property name="expand">False</property>
1533 <property name="fill">False</property>
1534 <property name="position">1</property>
1535 </packing>
1536 </child>
1537 </object>
1538 <packing>
1539 <property name="expand">True</property>
1540 <property name="fill">True</property>
1541 <property name="position">2</property>
1542 </packing>
1543 </child>
1544 <child>
1545 <object class="GtkHBox" id="hbox23">
1546 <property name="visible">True</property>
1547 <property name="can_focus">False</property>
1548 <child>
1549 <object class="GtkExpander" id="expander_terminal">
1550 <property name="visible">True</property>
1551 <property name="sensitive">False</property>
1552 <property name="can_focus">True</property>
1553 <property name="spacing">4</property>
1554 <child>
1555 <object class="GtkHBox" id="hbox_custom">
1556 <property name="visible">True</property>
1557 <property name="can_focus">False</property>
1558 </object>
1559 </child>
1560 <child type="label">
1561 <object class="GtkLabel" id="label6">
1562 <property name="visible">True</property>
1563 <property name="can_focus">False</property>
1564 <property name="label" translatable="yes">Terminal</property>
1565 </object>
1566 </child>
1567 </object>
1568 <packing>
1569 <property name="expand">True</property>
1570 <property name="fill">True</property>
1571 <property name="position">0</property>
1572 </packing>
1573 </child>
1574 <child>
1575 <object class="GtkButton" id="button_fetch_cancel">
1576 <property name="label">gtk-cancel</property>
1577 <property name="can_focus">True</property>
1578 <property name="receives_default">False</property>
1579 <property name="use_action_appearance">False</property>
1580 <property name="use_stock">True</property>
1581 </object>
1582 <packing>
1583 <property name="expand">False</property>
1584 <property name="fill">False</property>
1585 <property name="position">1</property>
1586 </packing>
1587 </child>
1588 </object>
1589 <packing>
1590 <property name="expand">True</property>
1591 <property name="fill">True</property>
1592 <property name="position">3</property>
1593 </packing>
1594 </child>
1595 </object>
1596 <packing>
1597 <property name="expand">True</property>
1598 <property name="fill">True</property>
1599 <property name="position">0</property>
1600 </packing>
1601 </child>
1602 </object>
1603 </child>
1604 </object>
1605</interface>
16060
=== removed file 'DistUpgrade/DistUpgradeApport.py'
--- DistUpgrade/DistUpgradeApport.py 2012-06-18 18:41:13 +0000
+++ DistUpgrade/DistUpgradeApport.py 1970-01-01 00:00:00 +0000
@@ -1,91 +0,0 @@
1
2import os
3import logging
4import subprocess
5import sys
6import gettext
7import errno
8
9
10def apport_crash(type, value, tb):
11 logging.debug("running apport_crash()")
12 try:
13 from apport_python_hook import apport_excepthook
14 from apport.report import Report
15 except ImportError as e:
16 logging.error("failed to import apport python module, can't report bug: %s" % e)
17 return False
18 # we pretend we are update-manager
19 sys.argv[0] = "/usr/bin/update-manager"
20 apport_excepthook(type, value, tb)
21 # now add the files in /var/log/dist-upgrade/*
22 if os.path.exists('/var/crash/_usr_bin_update-manager.0.crash'):
23 report = Report()
24 report.setdefault('Tags', 'dist-upgrade')
25 report['Tags'] += ' dist-upgrade'
26 for fname in os.listdir("/var/log/dist-upgrade/"):
27 f = os.path.join("/var/log/dist-upgrade", fname)
28 if not os.path.isfile(f) or os.path.getsize(f) == 0:
29 continue
30 report[f.replace(".", "").replace("-", "")] = (open(f), )
31 report.add_to_existing('/var/crash/_usr_bin_update-manager.0.crash')
32 return True
33
34
35def apport_pkgfailure(pkg, errormsg):
36 logging.debug("running apport_pkgfailure() %s: %s", pkg, errormsg)
37 LOGDIR = "/var/log/dist-upgrade/"
38 s = "/usr/share/apport/package_hook"
39
40 # we do not report followup errors from earlier failures
41 # dpkg messages will not be translated if DPKG_UNTRANSLATED_MESSAGES is
42 # set which it is by default so check for the English message first
43 if "dependency problems - leaving unconfigured" in errormsg:
44 return False
45 if gettext.dgettext('dpkg', "dependency problems - leaving unconfigured") in errormsg:
46 return False
47 # we do not run apport_pkgfailure for full disk errors
48 if os.strerror(errno.ENOSPC) in errormsg:
49 logging.debug("dpkg error because of full disk, not reporting against %s " % pkg)
50 return False
51
52 if os.path.exists(s):
53 try:
54 p = subprocess.Popen([s, "-p", pkg, "-l", LOGDIR, "--tags",
55 "dist-upgrade"], stdin=subprocess.PIPE)
56 p.stdin.write("%s\n" % errormsg)
57 p.stdin.close()
58 #p.wait()
59 except Exception as e:
60 logging.warning("Failed to run apport (%s)" % e)
61 return False
62 return True
63 return False
64
65
66def run_apport():
67 " run apport, check if we have a display "
68 if "RELEASE_UPRADER_NO_APPORT" in os.environ:
69 logging.debug("RELEASE_UPRADER_NO_APPORT env set")
70 return False
71 if "DISPLAY" in os.environ:
72 for p in ["/usr/share/apport/apport-gtk", "/usr/share/apport/apport-qt"]:
73 if os.path.exists(p):
74 ret = -1
75 try:
76 ret = subprocess.call(p)
77 except Exception:
78 logging.exception("Unable to launch '%s' " % p)
79 return (ret == 0)
80 elif os.path.exists("/usr/bin/apport-cli"):
81 try:
82 return (subprocess.call("/usr/bin/apport-cli") == 0)
83 except Exception:
84 logging.exception("Unable to launch '/usr/bin/apport-cli'")
85 return False
86 logging.debug("can't find apport")
87 return False
88
89
90if __name__ == "__main__":
91 apport_crash(None, None, None)
920
=== removed file 'DistUpgrade/DistUpgradeAptCdrom.py'
--- DistUpgrade/DistUpgradeAptCdrom.py 2012-06-12 13:52:04 +0000
+++ DistUpgrade/DistUpgradeAptCdrom.py 1970-01-01 00:00:00 +0000
@@ -1,308 +0,0 @@
1# DistUpgradeAptCdrom.py
2#
3# Copyright (c) 2008 Canonical
4#
5# Author: Michael Vogt <michael.vogt@ubuntu.com>
6#
7# This program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as
9# published by the Free Software Foundation; either version 2 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20# USA
21
22import re
23import os
24import apt
25import apt_pkg
26import logging
27import gzip
28import shutil
29import subprocess
30import sys
31from gettext import gettext as _
32
33
34class AptCdromError(Exception):
35 " base exception for apt cdrom errors "
36 pass
37
38class AptCdrom(object):
39 " represents a apt cdrom object "
40
41 def __init__(self, view, path):
42 self.view = view
43 self.cdrompath = path
44 # the directories we found on disk with signatures, packages and i18n
45 self.packages = set()
46 self.signatures = set()
47 self.i18n = set()
48
49 def restore_backup(self, backup_ext):
50 " restore the backup copy of the cdroms.list file (*not* sources.list)! "
51 cdromstate = os.path.join(apt_pkg.config.find_dir("Dir::State"),
52 apt_pkg.config.find("Dir::State::cdroms"))
53 if os.path.exists(cdromstate+backup_ext):
54 shutil.copy(cdromstate+backup_ext, cdromstate)
55 # mvo: we don't have to care about restoring the sources.list here because
56 # aptsources will do this for us anyway
57
58
59 def comment_out_cdrom_entry(self):
60 """ comment out the cdrom entry """
61 diskname = self._readDiskName()
62 pentry = self._generateSourcesListLine(diskname, self.packages)
63 sourceslist=apt_pkg.config.find_file("Dir::Etc::sourcelist")
64 content = open(sourceslist).read()
65 content = content.replace(pentry, "# %s" % pentry)
66 open(sourceslist, "w").write(content)
67
68 def _scanCD(self):
69 """
70 scan the CD for interessting files and return them as:
71 (packagesfiles, signaturefiles, i18nfiles)
72 """
73 packages = set()
74 signatures = set()
75 i18n = set()
76 for root, dirs, files in os.walk(self.cdrompath, topdown=True):
77 if (root.endswith("debian-installer") or
78 root.endswith("dist-upgrader")):
79 del dirs[:]
80 continue
81 elif ".aptignr" in files:
82 continue
83 elif "Packages" in files:
84 packages.add(os.path.join(root,"Packages"))
85 elif "Packages.gz" in files:
86 packages.add(os.path.join(root,"Packages.gz"))
87 elif "Sources" in files or "Sources.gz" in files:
88 logging.error("Sources entry found in %s but not supported" % root)
89 elif "Release.gpg" in files:
90 signatures.add(os.path.join(root,"Release.gpg"))
91 elif "i18n" in dirs:
92 for f in os.listdir(os.path.join(root,"i18n")):
93 i18n.add(os.path.join(root,"i18n",f))
94 # there is nothing under pool but deb packages (no
95 # indexfiles, so we skip that here
96 elif os.path.split(root)[1] == ("pool"):
97 del dirs[:]
98 return (packages, signatures, i18n)
99
100 def _writeDatabase(self):
101 " update apts cdrom.list "
102 dbfile = apt_pkg.config.find_file("Dir::State::cdroms")
103 cdrom = apt_pkg.Cdrom()
104 id=cdrom.ident(apt.progress.base.CdromProgress())
105 label = self._readDiskName()
106 out=open(dbfile,"a")
107 out.write('CD::%s "%s";\n' % (id, label))
108 out.write('CD::%s::Label "%s";\n' % (id, label))
109
110 def _dropArch(self, packages):
111 " drop architectures that are not ours "
112 # create a copy
113 packages = set(packages)
114 # now go over the packagesdirs and drop stuff that is not
115 # our binary-$arch
116 arch = apt_pkg.config.find("APT::Architecture")
117 for d in set(packages):
118 if "/binary-" in d and not arch in d:
119 packages.remove(d)
120 return packages
121
122 def _readDiskName(self):
123 # default to cdrompath if there is no name
124 diskname = self.cdrompath
125 info = os.path.join(self.cdrompath, ".disk","info")
126 if os.path.exists(info):
127 diskname = open(info).read()
128 for special in ('"',']','[','_'):
129 diskname = diskname.replace(special,'_')
130 return diskname
131
132 def _generateSourcesListLine(self, diskname, packages):
133 # see apts indexcopy.cc:364 for details
134 path = ""
135 dist = ""
136 comps = []
137 for d in packages:
138 # match(1) is the path, match(2) the dist
139 # and match(3) the components
140 m = re.match("(.*)/dists/([^/]*)/(.*)/binary-*", d)
141 if not m:
142 raise AptCdromError(_("Could not calculate sources.list entry"))
143 path = m.group(1)
144 dist = m.group(2)
145 comps.append(m.group(3))
146 if not path or not comps:
147 return None
148 comps.sort()
149 pentry = "deb cdrom:[%s]/ %s %s" % (diskname, dist, " ".join(comps))
150 return pentry
151
152 def _copyTranslations(self, translations, targetdir=None):
153 if not targetdir:
154 targetdir=apt_pkg.config.find_dir("Dir::State::lists")
155 diskname = self._readDiskName()
156 for f in translations:
157 fname = apt_pkg.uri_to_filename("cdrom:[%s]/%s" % (diskname,f[f.find("dists"):]))
158 outf = os.path.join(targetdir,os.path.splitext(fname)[0])
159 if f.endswith(".gz"):
160 g=gzip.open(f)
161 try:
162 with open(outf, "wb") as out:
163 # uncompress in 64k chunks
164 while True:
165 s=g.read(64000)
166 out.write(s)
167 if s == b"":
168 break
169 finally:
170 g.close()
171 else:
172 shutil.copy(f,outf)
173 return True
174
175 def _copyPackages(self, packages, targetdir=None):
176 if not targetdir:
177 targetdir=apt_pkg.config.find_dir("Dir::State::lists")
178 # CopyPackages()
179 diskname = self._readDiskName()
180 for f in packages:
181 fname = apt_pkg.uri_to_filename("cdrom:[%s]/%s" % (diskname,f[f.find("dists"):]))
182 outf = os.path.join(targetdir,os.path.splitext(fname)[0])
183 if f.endswith(".gz"):
184 g=gzip.open(f)
185 try:
186 with open(outf, "wb") as out:
187 # uncompress in 64k chunks
188 while True:
189 s=g.read(64000)
190 out.write(s)
191 if s == b"":
192 break
193 finally:
194 g.close()
195 else:
196 shutil.copy(f,outf)
197 return True
198
199 def _verifyRelease(self, signatures):
200 " verify the signatues and hashes "
201 gpgv = apt_pkg.config.find("Dir::Bin::gpg","/usr/bin/gpgv")
202 keyring = apt_pkg.config.find("Apt::GPGV::TrustedKeyring",
203 "/etc/apt/trusted.gpg")
204 for sig in signatures:
205 basepath = os.path.split(sig)[0]
206 # do gpg checking
207 releasef = os.path.splitext(sig)[0]
208 cmd = [gpgv,"--keyring",keyring,
209 "--ignore-time-conflict",
210 sig, releasef]
211 ret = subprocess.call(cmd)
212 if not (ret == 0):
213 return False
214 # now do the hash sum checks
215 t=apt_pkg.TagFile(open(releasef))
216 t.step()
217 for entry in t.section["SHA256"].split("\n"):
218 (hash,size,name) = entry.split()
219 f=os.path.join(basepath,name)
220 if not os.path.exists(f):
221 logging.info("ignoring missing '%s'" % f)
222 continue
223 sum = apt_pkg.sha256sum(open(f))
224 if not (sum == hash):
225 logging.error("hash sum mismatch expected %s but got %s" % (hash, sum))
226 return False
227 return True
228
229 def _copyRelease(self, signatures, targetdir=None):
230 " copy the release file "
231 if not targetdir:
232 targetdir=apt_pkg.config.find_dir("Dir::State::lists")
233 diskname = self._readDiskName()
234 for sig in signatures:
235 releasef = os.path.splitext(sig)[0]
236 # copy both Release and Release.gpg
237 for f in (sig, releasef):
238 fname = apt_pkg.uri_to_filename("cdrom:[%s]/%s" % (diskname,f[f.find("dists"):]))
239 shutil.copy(f,os.path.join(targetdir,fname))
240 return True
241
242 def _doAdd(self):
243 " reimplement pkgCdrom::Add() in python "
244 # os.walk() will not follow symlinks so we don't need
245 # pkgCdrom::Score() and not dropRepeats() that deal with
246 # killing the links
247 (self.packages, self.signatures, self.i18n) = self._scanCD()
248 self.packages = self._dropArch(self.packages)
249 if len(self.packages) == 0:
250 logging.error("no useable indexes found on CD, wrong ARCH?")
251 raise AptCdromError(_("Unable to locate any package files, perhaps this is not a Ubuntu Disc or the wrong architecture?"))
252
253 # CopyAndVerify
254 if self._verifyRelease(self.signatures):
255 self._copyRelease(self.signatures)
256
257 # copy the packages and translations
258 self._copyPackages(self.packages)
259 self._copyTranslations(self.i18n)
260
261 # add CD to cdroms.list "database" and update sources.list
262 diskname = self._readDiskName()
263 if not diskname:
264 logging.error("no .disk/ directory found")
265 return False
266 debline = self._generateSourcesListLine(diskname, self.packages)
267
268 # prepend to the sources.list
269 sourceslist=apt_pkg.config.find_file("Dir::Etc::sourcelist")
270 content=open(sourceslist).read()
271 open(sourceslist,"w").write("# added by the release upgrader\n%s\n%s" % (debline,content))
272 self._writeDatabase()
273
274 return True
275
276 def add(self, backup_ext=None):
277 " add a cdrom to apt's database "
278 logging.debug("AptCdrom.add() called with '%s'", self.cdrompath)
279 # do backup (if needed) of the cdroms.list file
280 if backup_ext:
281 cdromstate = os.path.join(apt_pkg.config.find_dir("Dir::State"),
282 apt_pkg.config.find("Dir::State::cdroms"))
283 if os.path.exists(cdromstate):
284 shutil.copy(cdromstate, cdromstate+backup_ext)
285 # do the actual work
286 apt_pkg.config.set("Acquire::cdrom::mount",self.cdrompath)
287 apt_pkg.config.set("APT::CDROM::NoMount","true")
288 # FIXME: add cdrom progress here for the view
289 #progress = self.view.getCdromProgress()
290 try:
291 res = self._doAdd()
292 except (SystemError, AptCdromError) as e:
293 logging.error("can't add cdrom: %s" % e)
294 self.view.error(_("Failed to add the CD"),
295 _("There was a error adding the CD, the "
296 "upgrade will abort. Please report this as "
297 "a bug if this is a valid Ubuntu CD.\n\n"
298 "The error message was:\n'%s'") % e)
299 return False
300 logging.debug("AptCdrom.add() returned: %s" % res)
301 return res
302
303 def __bool__(self):
304 """ helper to use this as 'if cdrom:' """
305 return self.cdrompath is not None
306
307 if sys.version < '3':
308 __nonzero__ = __bool__
3090
=== removed file 'DistUpgrade/DistUpgradeAufs.py'
--- DistUpgrade/DistUpgradeAufs.py 2012-05-01 14:11:33 +0000
+++ DistUpgrade/DistUpgradeAufs.py 1970-01-01 00:00:00 +0000
@@ -1,253 +0,0 @@
1from __future__ import absolute_import, print_function
2
3import logging
4import os
5import subprocess
6import tempfile
7
8def aufsOptionsAndEnvironmentSetup(options, config):
9 """ setup the environment based on the config and options
10 It will use
11 config("Aufs","Enabled") - to show if its enabled
12 and
13 config("Aufs","RWDir") - for the writable overlay dir
14 """
15 logging.debug("aufsOptionsAndEnvironmentSetup()")
16 # enabled from the commandline (full overlay by default)
17 if options and options.useAufs:
18 logging.debug("enabling full overlay from commandline")
19 config.set("Aufs","Enabled", "True")
20 config.set("Aufs","EnableFullOverlay","True")
21
22 # setup environment based on config
23 tmprw = tempfile.mkdtemp(prefix="upgrade-rw-")
24 aufs_rw_dir = config.getWithDefault("Aufs","RWDir", tmprw)
25 logging.debug("using '%s' as aufs_rw_dir" % aufs_rw_dir)
26 os.environ["RELEASE_UPGRADE_AUFS_RWDIR"] = aufs_rw_dir
27 config.set("Aufs","RWDir",aufs_rw_dir)
28 # now the chroot tmpdir
29 tmpchroot = tempfile.mkdtemp(prefix="upgrade-chroot-")
30 os.chmod(tmpchroot, 0o755)
31 aufs_chroot_dir = config.getWithDefault("Aufs","ChrootDir", tmpchroot)
32 logging.debug("using '%s' as aufs chroot dir" % aufs_chroot_dir)
33
34 if config.getWithDefault("Aufs","EnableFullOverlay", False):
35 logging.debug("enabling aufs full overlay (from config)")
36 config.set("Aufs","Enabled", "True")
37 os.environ["RELEASE_UPGRADE_USE_AUFS_FULL_OVERLAY"] = "1"
38 if config.getWithDefault("Aufs","EnableChrootOverlay",False):
39 logging.debug("enabling aufs chroot overlay")
40 config.set("Aufs","Enabled", "True")
41 os.environ["RELEASE_UPGRADE_USE_AUFS_CHROOT"] = aufs_chroot_dir
42 if config.getWithDefault("Aufs","EnableChrootRsync", False):
43 logging.debug("enable aufs chroot rsync back to real system")
44 os.environ["RELEASE_UPGRADE_RSYNC_AUFS_CHROOT"] = "1"
45
46
47def _bindMount(from_dir, to_dir, rbind=False):
48 " helper that bind mounts a given dir to a new place "
49 if not os.path.exists(to_dir):
50 os.makedirs(to_dir)
51 if rbind:
52 bind = "--rbind"
53 else:
54 bind = "--bind"
55 cmd = ["mount",bind, from_dir, to_dir]
56 logging.debug("cmd: %s" % cmd)
57 res = subprocess.call(cmd)
58 if res != 0:
59 # FIXME: revert already mounted stuff
60 logging.error("Failed to bind mount from '%s' to '%s'" % (from_dir, to_dir))
61 return False
62 return True
63
64def _aufsOverlayMount(target, rw_dir, chroot_dir="/"):
65 """
66 helper that takes a target dir and mounts a rw dir over it, e.g.
67 /var , /tmp/upgrade-rw
68 """
69 if not os.path.exists(rw_dir+target):
70 os.makedirs(rw_dir+target)
71 if not os.path.exists(chroot_dir+target):
72 os.makedirs(chroot_dir+target)
73 # FIXME: figure out when to use aufs and when to use overlayfs
74 use_overlayfs = False
75 if use_overlayfs:
76 cmd = ["mount",
77 "-t","overlayfs",
78 "-o","upperdir=%s,lowerdir=%s" % (rw_dir+target, target),
79 "none",
80 chroot_dir+target]
81 else:
82 cmd = ["mount",
83 "-t","aufs",
84 "-o","br:%s:%s=ro" % (rw_dir+target, target),
85 "none",
86 chroot_dir+target]
87 res = subprocess.call(cmd)
88 if res != 0:
89 # FIXME: revert already mounted stuff
90 logging.error("Failed to mount rw aufs overlay for '%s'" % target)
91 return False
92 logging.debug("cmd '%s' return '%s' " % (cmd, res))
93 return True
94
95def is_aufs_mount(dir):
96 " test if the given dir is already mounted with aufs overlay "
97 for line in open("/proc/mounts"):
98 (device, mountpoint, fstype, options, a, b) = line.split()
99 if device == "none" and fstype == "aufs" and mountpoint == dir:
100 return True
101 return False
102
103def is_submount(mountpoint, systemdirs):
104 " helper: check if the given mountpoint is a submount of a systemdir "
105 logging.debug("is_submount: %s %s" % (mountpoint, systemdirs))
106 for d in systemdirs:
107 if not d.endswith("/"):
108 d += "/"
109 if mountpoint.startswith(d):
110 return True
111 return False
112
113def is_real_fs(fs):
114 if fs.startswith("fuse"):
115 return False
116 if fs in ["rootfs","tmpfs","proc","fusectrl","aufs",
117 "devpts","binfmt_misc", "sysfs"]:
118 return False
119 return True
120
121def doAufsChrootRsync(aufs_chroot_dir):
122 """
123 helper that rsyncs the changes in the aufs chroot back to the
124 real system
125 """
126 from .DistUpgradeMain import SYSTEM_DIRS
127 for d in SYSTEM_DIRS:
128 if not os.path.exists(d):
129 continue
130 # its important to have the "/" at the end of source
131 # and dest so that rsync knows what to do
132 cmd = ["rsync","-aHAX","--del","-v", "--progress",
133 "/%s/%s/" % (aufs_chroot_dir, d),
134 "/%s/" % d]
135 logging.debug("running: '%s'" % cmd)
136 ret = subprocess.call(cmd)
137 logging.debug("rsync back result for %s: %i" % (d, ret))
138 return True
139
140def doAufsChroot(aufs_rw_dir, aufs_chroot_dir):
141 " helper that sets the chroot up and does chroot() into it "
142 if not setupAufsChroot(aufs_rw_dir, aufs_chroot_dir):
143 return False
144 os.chroot(aufs_chroot_dir)
145 os.chdir("/")
146 return True
147
148
149def setupAufsChroot(rw_dir, chroot_dir):
150 " setup aufs chroot that is based on / but with a writable overlay "
151 # with the chroot aufs we can just rsync the changes back
152 # from the chroot dir to the real dirs
153 #
154 # (if we run rsync with --backup --backup-dir we could even
155 # create something vaguely rollbackable
156
157 # get the mount points before the aufs buisiness starts
158 mounts = open("/proc/mounts").read()
159 from .DistUpgradeMain import SYSTEM_DIRS
160 systemdirs = SYSTEM_DIRS
161
162 # aufs mount or bind mount required dirs
163 for d in os.listdir("/"):
164 d = os.path.join("/",d)
165 if os.path.isdir(d):
166 if d in systemdirs:
167 logging.debug("bind mounting %s" % d)
168 if not _aufsOverlayMount(d, rw_dir, chroot_dir):
169 return False
170 else:
171 logging.debug("overlay mounting %s" % d)
172 if not _bindMount(d, chroot_dir+d, rbind=True):
173 return False
174
175 # create binds for the systemdirs
176 #needs_bind_mount = set()
177 for line in mounts.split("\n"):
178 line = line.strip()
179 if not line: continue
180 (device, mountpoint, fstype, options, a, b) = line.split()
181 if (fstype != "aufs" and
182 not is_real_fs(fstype) and
183 is_submount(mountpoint, systemdirs)):
184 logging.debug("found %s that needs bind mount", mountpoint)
185 if not _bindMount(mountpoint, chroot_dir+mountpoint):
186 return False
187 return True
188
189def setupAufs(rw_dir):
190 " setup aufs overlay over the rootfs "
191 # * we need to find a way to tell all the existing daemon
192 # to look into the new namespace. so probably something
193 # like a reboot is required and some hackery in initramfs-tools
194 # to ensure that we boot into a overlay ready system
195 # * this is much less of a issue with the aufsChroot code
196 logging.debug("setupAufs")
197 if not os.path.exists("/proc/mounts"):
198 logging.debug("no /proc/mounts, can not do aufs overlay")
199 return False
200
201 from .DistUpgradeMain import SYSTEM_DIRS
202 systemdirs = SYSTEM_DIRS
203 # verify that there are no submounts of a systemdir and collect
204 # the stuff that needs bind mounting (because a aufs does not
205 # include sub mounts)
206 needs_bind_mount = set()
207 needs_bind_mount.add("/var/cache/apt/archives")
208 for line in open("/proc/mounts"):
209 (device, mountpoint, fstype, options, a, b) = line.split()
210 if is_real_fs(fstype) and is_submount(mountpoint, systemdirs):
211 logging.warning("mountpoint %s submount of systemdir" % mountpoint)
212 return False
213 if (fstype != "aufs" and not is_real_fs(fstype) and is_submount(mountpoint, systemdirs)):
214 logging.debug("found %s that needs bind mount", mountpoint)
215 needs_bind_mount.add(mountpoint)
216
217 # aufs mounts do not support stacked filesystems, so
218 # if we mount /var we will loose the tmpfs stuff
219 # first bind mount varun and varlock into the tmpfs
220 for d in needs_bind_mount:
221 if not _bindMount(d, rw_dir+"/needs_bind_mount/"+d):
222 return False
223 # setup writable overlay into /tmp/upgrade-rw so that all
224 # changes are written there instead of the real fs
225 for d in systemdirs:
226 if not is_aufs_mount(d):
227 if not _aufsOverlayMount(d, rw_dir):
228 return False
229 # now bind back the tempfs to the original location
230 for d in needs_bind_mount:
231 if not _bindMount(rw_dir+"/needs_bind_mount/"+d, d):
232 return False
233
234 # The below information is only of historical relevance:
235 # now what we *could* do to apply the changes is to
236 # mount -o bind / /orig
237 # (bind is important, *not* rbind that includes submounts)
238 #
239 # This will give us the original "/" without the
240 # aufs rw overlay - *BUT* only if "/" is all on one parition
241 #
242 # then apply the diff (including the whiteouts) to /orig
243 # e.g. by "rsync -av /tmp/upgrade-rw /orig"
244 # "script that search for whiteouts and removes them"
245 # (whiteout files start with .wh.$name
246 # whiteout dirs with .wh..? - check with aufs man page)
247 return True
248
249if __name__ == "__main__":
250 logging.basicConfig(level=logging.DEBUG)
251 #print(setupAufs("/tmp/upgrade-rw"))
252 print(setupAufsChroot("/tmp/upgrade-chroot-rw",
253 "/tmp/upgrade-chroot"))
2540
=== removed file 'DistUpgrade/DistUpgradeCache.py'
--- DistUpgrade/DistUpgradeCache.py 2012-06-13 12:45:49 +0000
+++ DistUpgrade/DistUpgradeCache.py 1970-01-01 00:00:00 +0000
@@ -1,1235 +0,0 @@
1# DistUpgradeCache.py
2#
3# Copyright (c) 2004-2008 Canonical
4#
5# Author: Michael Vogt <michael.vogt@ubuntu.com>
6#
7# This program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as
9# published by the Free Software Foundation; either version 2 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20# USA
21
22from __future__ import absolute_import, print_function
23
24import warnings
25warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning)
26import apt
27import apt_pkg
28import os
29import re
30import logging
31import time
32import datetime
33import threading
34try:
35 import configparser
36except ImportError:
37 import ConfigParser as configparser
38from subprocess import Popen, PIPE
39
40from .DistUpgradeGettext import gettext as _
41from .DistUpgradeGettext import ngettext
42
43from .utils import inside_chroot, estimate_kernel_size_in_boot
44
45class CacheException(Exception):
46 pass
47class CacheExceptionLockingFailed(CacheException):
48 pass
49class CacheExceptionDpkgInterrupted(CacheException):
50 pass
51
52# the initrd/vmlinuz/abi space required in /boot for each kernel
53# we estimate based on the current kernel size and add a safety marging
54def _set_kernel_initrd_size():
55 size = estimate_kernel_size_in_boot()
56 if size == 0:
57 logging.warn("estimate_kernel_size_in_boot() returned '0'?")
58 size = 28*1024*1024
59 # add small safety buffer
60 size += 1*1024*1024
61 return size
62KERNEL_INITRD_SIZE = _set_kernel_initrd_size()
63
64class FreeSpaceRequired(object):
65 """ FreeSpaceRequired object:
66
67 This exposes:
68 - the total size required (size_total)
69 - the dir that requires the space (dir)
70 - the additional space that is needed (size_needed)
71 """
72 def __init__(self, size_total, dir, size_needed):
73 self.size_total = size_total
74 self.dir = dir
75 self.size_needed = size_needed
76 def __str__(self):
77 return "FreeSpaceRequired Object: Dir: %s size_total: %s size_needed: %s" % (self.dir, self.size_total, self.size_needed)
78
79
80class NotEnoughFreeSpaceError(CacheException):
81 """
82 Exception if there is not enough free space for this operation
83
84 """
85 def __init__(self, free_space_required_list):
86 self.free_space_required_list = free_space_required_list
87
88class MyCache(apt.Cache):
89 ReInstReq = 1
90 HoldReInstReq = 3
91
92 # init
93 def __init__(self, config, view, quirks, progress=None, lock=True):
94 apt.Cache.__init__(self, progress)
95 self.to_install = []
96 self.to_remove = []
97 self.view = view
98 self.quirks = quirks
99 self.lock = False
100 self.partialUpgrade = False
101 self.config = config
102 self.metapkgs = self.config.getlist("Distro","MetaPkgs")
103 # acquire lock
104 self._listsLock = -1
105 if lock:
106 try:
107 apt_pkg.pkgsystem_lock()
108 self.lock_lists_dir()
109 self.lock = True
110 except SystemError as e:
111 # checking for this is ok, its not translatable
112 if "dpkg --configure -a" in str(e):
113 raise CacheExceptionDpkgInterrupted(e)
114 raise CacheExceptionLockingFailed(e)
115 # a list of regexp that are not allowed to be removed
116 self.removal_blacklist = config.getListFromFile("Distro","RemovalBlacklistFile")
117 self.uname = Popen(["uname","-r"], stdout=PIPE,
118 universal_newlines=True).communicate()[0].strip()
119 self._initAptLog()
120 # from hardy on we use recommends by default, so for the
121 # transition to the new dist we need to enable them now
122 if (config.get("Sources","From") == "hardy" and
123 not "RELEASE_UPGRADE_NO_RECOMMENDS" in os.environ):
124 apt_pkg.config.set("APT::Install-Recommends","true")
125
126 def _apply_dselect_upgrade(self):
127 """ honor the dselect install state """
128 for pkg in self:
129 if pkg.is_installed:
130 continue
131 if pkg._pkg.selected_state == apt_pkg.SELSTATE_INSTALL:
132 # upgrade() will take care of this
133 pkg.mark_install(auto_inst=False, auto_fix=False)
134
135 @property
136 def req_reinstall_pkgs(self):
137 " return the packages not downloadable packages in reqreinst state "
138 reqreinst = set()
139 for pkg in self:
140 if ((not pkg.candidate or not pkg.candidate.downloadable)
141 and
142 (pkg._pkg.inst_state == self.ReInstReq or
143 pkg._pkg.inst_state == self.HoldReInstReq)):
144 reqreinst.add(pkg.name)
145 return reqreinst
146
147 def fix_req_reinst(self, view):
148 " check for reqreinst state and offer to fix it "
149 reqreinst = self.req_reinstall_pkgs
150 if len(reqreinst) > 0:
151 header = ngettext("Remove package in bad state",
152 "Remove packages in bad state",
153 len(reqreinst))
154 summary = ngettext("The package '%s' is in an inconsistent "
155 "state and needs to be reinstalled, but "
156 "no archive can be found for it. "
157 "Do you want to remove this package "
158 "now to continue?",
159 "The packages '%s' are in an inconsistent "
160 "state and need to be reinstalled, but "
161 "no archives can be found for them. Do you "
162 "want to remove these packages now to "
163 "continue?",
164 len(reqreinst)) % ", ".join(reqreinst)
165 if view.askYesNoQuestion(header, summary):
166 self.release_lock()
167 cmd = ["dpkg","--remove","--force-remove-reinstreq"] + list(reqreinst)
168 view.getTerminal().call(cmd)
169 self.get_lock()
170 return True
171 return False
172
173 # logging stuff
174 def _initAptLog(self):
175 " init logging, create log file"
176 logdir = self.config.getWithDefault("Files","LogDir",
177 "/var/log/dist-upgrade")
178 if not os.path.exists(logdir):
179 os.makedirs(logdir)
180 apt_pkg.config.set("Dir::Log",logdir)
181 apt_pkg.config.set("Dir::Log::Terminal","apt-term.log")
182 self.logfd = os.open(os.path.join(logdir,"apt.log"),
183 os.O_RDWR|os.O_CREAT|os.O_APPEND, 0o644)
184 now = datetime.datetime.now()
185 header = "Log time: %s\n" % now
186 os.write(self.logfd, header.encode("utf-8"))
187
188 # turn on debugging in the cache
189 apt_pkg.config.set("Debug::pkgProblemResolver","true")
190 apt_pkg.config.set("Debug::pkgDepCache::AutoInstall","true")
191 def _startAptResolverLog(self):
192 if hasattr(self, "old_stdout"):
193 os.close(self.old_stdout)
194 os.close(self.old_stderr)
195 self.old_stdout = os.dup(1)
196 self.old_stderr = os.dup(2)
197 os.dup2(self.logfd, 1)
198 os.dup2(self.logfd, 2)
199 def _stopAptResolverLog(self):
200 os.fsync(1)
201 os.fsync(2)
202 os.dup2(self.old_stdout, 1)
203 os.dup2(self.old_stderr, 2)
204 # use this decorator instead of the _start/_stop stuff directly
205 # FIXME: this should probably be a decorator class where all
206 # logging is moved into?
207 def withResolverLog(f):
208 " decorator to ensure that the apt output is logged "
209 def wrapper(*args, **kwargs):
210 args[0]._startAptResolverLog()
211 res = f(*args, **kwargs)
212 args[0]._stopAptResolverLog()
213 return res
214 return wrapper
215
216 # properties
217 @property
218 def required_download(self):
219 """ get the size of the packages that are required to download """
220 pm = apt_pkg.PackageManager(self._depcache)
221 fetcher = apt_pkg.Acquire()
222 pm.get_archives(fetcher, self._list, self._records)
223 return fetcher.fetch_needed
224 @property
225 def additional_required_space(self):
226 """ get the size of the additional required space on the fs """
227 return self._depcache.usr_size
228 @property
229 def is_broken(self):
230 """ is the cache broken """
231 return self._depcache.broken_count > 0
232
233 # methods
234 def lock_lists_dir(self):
235 name = apt_pkg.config.find_dir("Dir::State::Lists") + "lock"
236 self._listsLock = apt_pkg.get_lock(name)
237 if self._listsLock < 0:
238 e = "Can not lock '%s' " % name
239 raise CacheExceptionLockingFailed(e)
240 def unlock_lists_dir(self):
241 if self._listsLock > 0:
242 os.close(self._listsLock)
243 self._listsLock = -1
244 def update(self, fprogress=None):
245 """
246 our own update implementation is required because we keep the lists
247 dir lock
248 """
249 self.unlock_lists_dir()
250 res = apt.Cache.update(self, fprogress)
251 self.lock_lists_dir()
252 if fprogress and fprogress.release_file_download_error:
253 # FIXME: not ideal error message, but we just reuse a
254 # existing one here to avoid a new string
255 raise IOError(_("The server may be overloaded"))
256 if res == False:
257 raise IOError("apt.cache.update() returned False, but did not raise exception?!?")
258
259 def commit(self, fprogress, iprogress):
260 logging.info("cache.commit()")
261 if self.lock:
262 self.release_lock()
263 apt.Cache.commit(self, fprogress, iprogress)
264
265 def release_lock(self, pkgSystemOnly=True):
266 if self.lock:
267 try:
268 apt_pkg.pkgsystem_unlock()
269 self.lock = False
270 except SystemError as e:
271 logging.debug("failed to SystemUnLock() (%s) " % e)
272
273 def get_lock(self, pkgSystemOnly=True):
274 if not self.lock:
275 try:
276 apt_pkg.pkgsystem_lock()
277 self.lock = True
278 except SystemError as e:
279 logging.debug("failed to SystemLock() (%s) " % e)
280
281 def downloadable(self, pkg, useCandidate=True):
282 " check if the given pkg can be downloaded "
283 if useCandidate:
284 ver = self._depcache.get_candidate_ver(pkg._pkg)
285 else:
286 ver = pkg._pkg.current_ver
287 if ver == None:
288 logging.warning("no version information for '%s' (useCandidate=%s)" % (pkg.name, useCandidate))
289 return False
290 return ver.downloadable
291
292 def pkg_auto_removable(self, pkg):
293 """ check if the pkg is auto-removable """
294 return (pkg.is_installed and
295 self._depcache.is_garbage(pkg._pkg))
296
297 def fix_broken(self):
298 """ try to fix broken dependencies on the system, may throw
299 SystemError when it can't"""
300 return self._depcache.fix_broken()
301
302 def create_snapshot(self):
303 """ create a snapshot of the current changes """
304 self.to_install = []
305 self.to_remove = []
306 for pkg in self.get_changes():
307 if pkg.marked_install or pkg.marked_upgrade:
308 self.to_install.append(pkg.name)
309 if pkg.marked_delete:
310 self.to_remove.append(pkg.name)
311
312 def clear(self):
313 self._depcache.init()
314
315 def restore_snapshot(self):
316 """ restore a snapshot """
317 actiongroup = apt_pkg.ActionGroup(self._depcache)
318 # just make pyflakes shut up, later we need to use
319 # with self.actiongroup():
320 actiongroup
321 self.clear()
322 for name in self.to_remove:
323 pkg = self[name]
324 pkg.mark_delete()
325 for name in self.to_install:
326 pkg = self[name]
327 pkg.mark_install(auto_fix=False, auto_inst=False)
328
329 def need_server_mode(self):
330 """
331 This checks if we run on a desktop or a server install.
332
333 A server install has more freedoms, for a desktop install
334 we force a desktop meta package to be install on the upgrade.
335
336 We look for a installed desktop meta pkg and for key
337 dependencies, if none of those are installed we assume
338 server mode
339 """
340 #logging.debug("need_server_mode() run")
341 # check for the MetaPkgs (e.g. ubuntu-desktop)
342 metapkgs = self.config.getlist("Distro","MetaPkgs")
343 for key in metapkgs:
344 # if it is installed we are done
345 if key in self and self[key].is_installed:
346 logging.debug("need_server_mode(): run in 'desktop' mode, (because of pkg '%s')" % key)
347 return False
348 # if it is not installed, but its key depends are installed
349 # we are done too (we auto-select the package later)
350 deps_found = True
351 for pkg in self.config.getlist(key,"KeyDependencies"):
352 deps_found &= pkg in self and self[pkg].is_installed
353 if deps_found:
354 logging.debug("need_server_mode(): run in 'desktop' mode, (because of key deps for '%s')" % key)
355 return False
356 logging.debug("need_server_mode(): can not find a desktop meta package or key deps, running in server mode")
357 return True
358
359 def sanity_check(self, view):
360 """ check if the cache is ok and if the required metapkgs
361 are installed
362 """
363 if self.is_broken:
364 try:
365 logging.debug("Have broken pkgs, trying to fix them")
366 self.fix_broken()
367 except SystemError:
368 view.error(_("Broken packages"),
369 _("Your system contains broken packages "
370 "that couldn't be fixed with this "
371 "software. "
372 "Please fix them first using synaptic or "
373 "apt-get before proceeding."))
374 return False
375 return True
376
377 def mark_install(self, pkg, reason=""):
378 logging.debug("Installing '%s' (%s)" % (pkg, reason))
379 if pkg in self:
380 self[pkg].mark_install()
381 if not (self[pkg].marked_install or self[pkg].marked_upgrade):
382 logging.error("Installing/upgrading '%s' failed" % pkg)
383 #raise SystemError("Installing '%s' failed" % pkg)
384 return False
385 return True
386 def mark_upgrade(self, pkg, reason=""):
387 logging.debug("Upgrading '%s' (%s)" % (pkg, reason))
388 if pkg in self and self[pkg].is_installed:
389 self[pkg].mark_upgrade()
390 if not self[pkg].marked_upgrade:
391 logging.error("Upgrading '%s' failed" % pkg)
392 return False
393 return True
394 def mark_remove(self, pkg, reason=""):
395 logging.debug("Removing '%s' (%s)" % (pkg, reason))
396 if pkg in self:
397 self[pkg].mark_delete()
398 def mark_purge(self, pkg, reason=""):
399 logging.debug("Purging '%s' (%s)" % (pkg, reason))
400 if pkg in self:
401 self._depcache.mark_delete(self[pkg]._pkg,True)
402
403 def _keep_installed(self, pkgname, reason):
404 if (pkgname in self
405 and self[pkgname].is_installed
406 and self[pkgname].marked_delete):
407 self.mark_install(pkgname, reason)
408
409 def keep_installed_rule(self):
410 """ run after the dist-upgrade to ensure that certain
411 packages are kept installed """
412 # first the global list
413 for pkgname in self.config.getlist("Distro","KeepInstalledPkgs"):
414 self._keep_installed(pkgname, "Distro KeepInstalledPkgs rule")
415 # the the per-metapkg rules
416 for key in self.metapkgs:
417 if key in self and (self[key].is_installed or
418 self[key].marked_install):
419 for pkgname in self.config.getlist(key,"KeepInstalledPkgs"):
420 self._keep_installed(pkgname, "%s KeepInstalledPkgs rule" % key)
421
422 # only enforce section if we have a network. Otherwise we run
423 # into CD upgrade issues for installed language packs etc
424 if self.config.get("Options","withNetwork") == "True":
425 logging.debug("Running KeepInstalledSection rules")
426 # now the KeepInstalledSection code
427 for section in self.config.getlist("Distro","KeepInstalledSection"):
428 for pkg in self:
429 if (pkg.candidate and pkg.candidate.downloadable
430 and pkg.marked_delete and pkg.section == section):
431 self._keep_installed(pkg.name, "Distro KeepInstalledSection rule: %s" % section)
432 for key in self.metapkgs:
433 if key in self and (self[key].is_installed or
434 self[key].marked_install):
435 for section in self.config.getlist(key,"KeepInstalledSection"):
436 for pkg in self:
437 if (pkg.candidate and pkg.candidate.downloadable
438 and pkg.marked_delete and
439 pkg.section == section):
440 self._keep_installed(pkg.name, "%s KeepInstalledSection rule: %s" % (key, section))
441
442
443 def post_upgrade_rule(self):
444 " run after the upgrade was done in the cache "
445 for (rule, action) in [("Install", self.mark_install),
446 ("Upgrade", self.mark_upgrade),
447 ("Remove", self.mark_remove),
448 ("Purge", self.mark_purge)]:
449 # first the global list
450 for pkg in self.config.getlist("Distro","PostUpgrade%s" % rule):
451 action(pkg, "Distro PostUpgrade%s rule" % rule)
452 for key in self.metapkgs:
453 if key in self and (self[key].is_installed or
454 self[key].marked_install):
455 for pkg in self.config.getlist(key,"PostUpgrade%s" % rule):
456 action(pkg, "%s PostUpgrade%s rule" % (key, rule))
457 # run the quirks handlers
458 if not self.partialUpgrade:
459 self.quirks.run("PostDistUpgradeCache")
460
461 def identifyObsoleteKernels(self):
462 # we have a funny policy that we remove security updates
463 # for the kernel from the archive again when a new ABI
464 # version hits the archive. this means that we have
465 # e.g.
466 # linux-image-2.6.24-15-generic
467 # is obsolete when
468 # linux-image-2.6.24-19-generic
469 # is available
470 # ...
471 # This code tries to identify the kernels that can be removed
472 logging.debug("identifyObsoleteKernels()")
473 obsolete_kernels = set()
474 version = self.config.get("KernelRemoval","Version")
475 basenames = self.config.getlist("KernelRemoval","BaseNames")
476 types = self.config.getlist("KernelRemoval","Types")
477 for pkg in self:
478 for base in basenames:
479 basename = "%s-%s-" % (base,version)
480 for type in types:
481 if (pkg.name.startswith(basename) and
482 pkg.name.endswith(type) and
483 pkg.is_installed):
484 if (pkg.name == "%s-%s" % (base,self.uname)):
485 logging.debug("skipping running kernel %s" % pkg.name)
486 continue
487 logging.debug("removing obsolete kernel '%s'" % pkg.name)
488 obsolete_kernels.add(pkg.name)
489 logging.debug("identifyObsoleteKernels found '%s'" % obsolete_kernels)
490 return obsolete_kernels
491
492 def checkForNvidia(self):
493 """
494 this checks for nvidia hardware and checks what driver is needed
495 """
496 logging.debug("nvidiaUpdate()")
497 # if the free drivers would give us a equally hard time, we would
498 # never be able to release
499 try:
500 from .NvidiaDetector.nvidiadetector import NvidiaDetection
501 except (ImportError, SyntaxError) as e:
502 # SyntaxError is temporary until the port of NvidiaDetector to
503 # Python 3 is in the archive.
504 logging.error("NvidiaDetector can not be imported %s" % e)
505 return False
506 try:
507 # get new detection module and use the modalises files
508 # from within the release-upgrader
509 nv = NvidiaDetection(obsolete="./ubuntu-drivers-obsolete.pkgs")
510 #nv = NvidiaDetection()
511 # check if a binary driver is installed now
512 for oldDriver in nv.oldPackages:
513 if oldDriver in self and self[oldDriver].is_installed:
514 self.mark_remove(oldDriver, "old nvidia driver")
515 break
516 else:
517 logging.info("no old nvidia driver installed, installing no new")
518 return False
519 # check which one to use
520 driver = nv.selectDriver()
521 logging.debug("nv.selectDriver() returned '%s'" % driver)
522 if not driver in self:
523 logging.warning("no '%s' found" % driver)
524 return False
525 if not (self[driver].marked_install or self[driver].marked_upgrade):
526 self[driver].mark_install()
527 logging.info("installing %s as suggested by NvidiaDetector" % driver)
528 return True
529 except Exception as e:
530 logging.error("NvidiaDetection returned a error: %s" % e)
531 return False
532
533
534 def getKernelsFromBaseInstaller(self):
535 """get the list of recommended kernels from base-installer"""
536 p = Popen(["/bin/sh", "./get_kernel_list.sh"],
537 stdout=PIPE, universal_newlines=True)
538 res = p.wait()
539 if res != 0:
540 logging.warn("./get_kernel_list.sh returned non-zero exitcode")
541 return ""
542 kernels = p.communicate()[0]
543 kernels = [x.strip() for x in kernels.split("\n")]
544 kernels = [x for x in kernels if len(x) > 0]
545 logging.debug("./get_kernel_list.sh returns: %s" % kernels)
546 return kernels
547
548 def _selectKernelFromBaseInstaller(self):
549 """ use the get_kernel_list.sh script (that uses base-installer)
550 to figure out what kernel is most suitable for the system
551 """
552 # check if we have a kernel from that list installed first
553 kernels = self.getKernelsFromBaseInstaller()
554 for kernel in kernels:
555 if not kernel in self:
556 logging.debug("%s not available in cache" % kernel)
557 continue
558 # this can happen e.g. on cdrom -> cdrom only upgrades
559 # where on hardy we have linux-386 but on the lucid CD
560 # we only have linux-generic
561 if (not self[kernel].candidate or
562 not self[kernel].candidate.downloadable):
563 logging.debug("%s not downloadable" % kernel)
564 continue
565 # check if installed
566 if self[kernel].is_installed or self[kernel].marked_install:
567 logging.debug("%s kernel already installed" % kernel)
568 if self[kernel].is_upgradable and not self[kernel].marked_upgrade:
569 self.mark_upgrade(kernel, "Upgrading kernel from base-installer")
570 return
571 # if we have not found a kernel yet, use the first one that installs
572 for kernel in kernels:
573 if self.mark_install(kernel,
574 "Selecting new kernel from base-installer"):
575 if self._has_kernel_headers_installed():
576 prefix, sep, postfix = kernel.partition("-")
577 headers = "%s-header-%s" % (prefix, postfix)
578 self.mark_install(
579 headers,
580 "Selecting new kernel headers from base-installer")
581 else:
582 logging.debug("no kernel-headers installed")
583 return
584
585 def _has_kernel_headers_installed(self):
586 for pkg in self:
587 if (pkg.name.startswith("linux-headers-") and
588 pkg.is_installed):
589 return True
590 return False
591
592 def checkForKernel(self):
593 """ check for the running kernel and try to ensure that we have
594 an updated version
595 """
596 logging.debug("Kernel uname: '%s' " % self.uname)
597 try:
598 (version, build, flavour) = self.uname.split("-")
599 except Exception as e:
600 logging.warning("Can't parse kernel uname: '%s' (self compiled?)" % e)
601 return False
602 # now check if we have a SMP system
603 dmesg = Popen(["dmesg"],stdout=PIPE).communicate()[0]
604 if b"WARNING: NR_CPUS limit" in dmesg:
605 logging.debug("UP kernel on SMP system!?!")
606 # use base-installer to get the kernel we want (if it exists)
607 if os.path.exists("./get_kernel_list.sh"):
608 self._selectKernelFromBaseInstaller()
609 else:
610 logging.debug("skipping ./get_kernel_list.sh: not found")
611 return True
612
613 def checkPriority(self):
614 # tuple of priorities we require to be installed
615 need = ('required', )
616 # stuff that its ok not to have
617 removeEssentialOk = self.config.getlist("Distro","RemoveEssentialOk")
618 # check now
619 for pkg in self:
620 # WORKADOUND bug on the CD/python-apt #253255
621 ver = pkg._pcache._depcache.get_candidate_ver(pkg._pkg)
622 if ver and ver.priority == 0:
623 logging.error("Package %s has no priority set" % pkg.name)
624 continue
625 if (pkg.candidate and pkg.candidate.downloadable and
626 not (pkg.is_installed or pkg.marked_install) and
627 not pkg.name in removeEssentialOk and
628 # ignore multiarch priority required packages
629 not ":" in pkg.name and
630 pkg.candidate.priority in need):
631 self.mark_install(pkg.name, "priority in required set '%s' but not scheduled for install" % need)
632
633 # FIXME: make this a decorator (just like the withResolverLog())
634 def updateGUI(self, view, lock):
635 i = 0
636 while lock.locked():
637 if i % 15 == 0:
638 view.pulseProgress()
639 view.processEvents()
640 time.sleep(0.02)
641 i += 1
642 view.pulseProgress(finished=True)
643 view.processEvents()
644
645 @withResolverLog
646 def distUpgrade(self, view, serverMode, partialUpgrade):
647 # keep the GUI alive
648 lock = threading.Lock()
649 lock.acquire()
650 t = threading.Thread(target=self.updateGUI, args=(self.view, lock,))
651 t.start()
652 try:
653 # mvo: disabled as it casues to many errornous installs
654 #self._apply_dselect_upgrade()
655
656 # upgrade (and make sure this way that the cache is ok)
657 self.upgrade(True)
658
659 # check that everything in priority required is installed
660 self.checkPriority()
661
662 # see if our KeepInstalled rules are honored
663 self.keep_installed_rule()
664
665 # check if we got a new kernel (if we are not inside a
666 # chroot)
667 if inside_chroot():
668 logging.warn("skipping kernel checks because we run inside a chroot")
669 else:
670 self.checkForKernel()
671
672 # check for nvidia stuff
673 self.checkForNvidia()
674
675 # and if we have some special rules
676 self.post_upgrade_rule()
677
678 # install missing meta-packages (if not in server upgrade mode)
679 self._keepBaseMetaPkgsInstalled(view)
680 if not serverMode:
681 # if this fails, a system error is raised
682 self._installMetaPkgs(view)
683
684 # see if it all makes sense, if not this function raises
685 self._verifyChanges()
686
687 except SystemError as e:
688 # this should go into a finally: line, see below for the
689 # rationale why it doesn't
690 lock.release()
691 t.join()
692 # FIXME: change the text to something more useful
693 details = _("An unresolvable problem occurred while "
694 "calculating the upgrade:\n%s\n\n "
695 "This can be caused by:\n"
696 " * Upgrading to a pre-release version of Ubuntu\n"
697 " * Running the current pre-release version of Ubuntu\n"
698 " * Unofficial software packages not provided by Ubuntu\n"
699 "\n") % e
700 # we never have partialUpgrades (including removes) on a stable system
701 # with only ubuntu sources so we do not recommend reporting a bug
702 if partialUpgrade:
703 details += _("This is most likely a transient problem, "
704 "please try again later.")
705 else:
706 details += _("If none of this applies, then please report this bug using "
707 "the command 'ubuntu-bug update-manager' in a terminal.")
708 # make the error text available again on stdout for the
709 # text frontend
710 self._stopAptResolverLog()
711 view.error(_("Could not calculate the upgrade"), details)
712 # start the resolver log again because this is run with
713 # the withResolverLog decorator
714 self._startAptResolverLog()
715 logging.error("Dist-upgrade failed: '%s'", e)
716 return False
717 # would be nice to be able to use finally: here, but we need
718 # to run on python2.4 too
719 #finally:
720 # wait for the gui-update thread to exit
721 lock.release()
722 t.join()
723
724 # check the trust of the packages that are going to change
725 untrusted = []
726 for pkg in self.get_changes():
727 if pkg.marked_delete:
728 continue
729 # special case because of a bug in pkg.candidate.origins
730 if pkg.marked_downgrade:
731 for ver in pkg._pkg.version_list:
732 # version is lower than installed one
733 if apt_pkg.version_compare(
734 ver.ver_str, pkg.installed.version) < 0:
735 for (verFileIter, index) in ver.file_list:
736 indexfile = pkg._pcache._list.find_index(verFileIter)
737 if indexfile and not indexfile.is_trusted:
738 untrusted.append(pkg.name)
739 break
740 continue
741 origins = pkg.candidate.origins
742 trusted = False
743 for origin in origins:
744 #print(origin)
745 trusted |= origin.trusted
746 if not trusted:
747 untrusted.append(pkg.name)
748 # check if the user overwrote the unauthenticated warning
749 try:
750 b = self.config.getboolean("Distro","AllowUnauthenticated")
751 if b:
752 logging.warning("AllowUnauthenticated set!")
753 return True
754 except configparser.NoOptionError as e:
755 pass
756 if len(untrusted) > 0:
757 untrusted.sort()
758 logging.error("Unauthenticated packages found: '%s'" % \
759 " ".join(untrusted))
760 # FIXME: maybe ask a question here? instead of failing?
761 self._stopAptResolverLog()
762 view.error(_("Error authenticating some packages"),
763 _("It was not possible to authenticate some "
764 "packages. This may be a transient network problem. "
765 "You may want to try again later. See below for a "
766 "list of unauthenticated packages."),
767 "\n".join(untrusted))
768 # start the resolver log again because this is run with
769 # the withResolverLog decorator
770 self._startAptResolverLog()
771 return False
772 return True
773
774 def _verifyChanges(self):
775 """ this function tests if the current changes don't violate
776 our constrains (blacklisted removals etc)
777 """
778 removeEssentialOk = self.config.getlist("Distro","RemoveEssentialOk")
779 # check changes
780 for pkg in self.get_changes():
781 if pkg.marked_delete and self._inRemovalBlacklist(pkg.name):
782 logging.debug("The package '%s' is marked for removal but it's in the removal blacklist", pkg.name)
783 raise SystemError(_("The package '%s' is marked for removal but it is in the removal blacklist.") % pkg.name)
784 if pkg.marked_delete and (pkg._pkg.essential == True and
785 not pkg.name in removeEssentialOk):
786 logging.debug("The package '%s' is marked for removal but it's an ESSENTIAL package", pkg.name)
787 raise SystemError(_("The essential package '%s' is marked for removal.") % pkg.name)
788 # check bad-versions blacklist
789 badVersions = self.config.getlist("Distro","BadVersions")
790 for bv in badVersions:
791 (pkgname, ver) = bv.split("_")
792 if (pkgname in self and self[pkgname].candidate and
793 self[pkgname].candidate.version == ver and
794 (self[pkgname].marked_install or
795 self[pkgname].marked_upgrade)):
796 raise SystemError(_("Trying to install blacklisted version '%s'") % bv)
797 return True
798
799 def _lookupPkgRecord(self, pkg):
800 """
801 helper to make sure that the pkg._records is pointing to the right
802 location - needed because python-apt 0.7.9 dropped the python-apt
803 version but we can not yet use the new version because on upgrade
804 the old version is still installed
805 """
806 ver = pkg._pcache._depcache.get_candidate_ver(pkg._pkg)
807 if ver is None:
808 print("No candidate ver: ", pkg.name)
809 return False
810 if ver.file_list is None:
811 print("No file_list for: %s " % self._pkg.name())
812 return False
813 f, index = ver.file_list.pop(0)
814 pkg._pcache._records.lookup((f, index))
815 return True
816
817 @property
818 def installedTasks(self):
819 tasks = {}
820 installed_tasks = set()
821 for pkg in self:
822 if not self._lookupPkgRecord(pkg):
823 logging.debug("no PkgRecord found for '%s', skipping " % pkg.name)
824 continue
825 for line in pkg._pcache._records.record.split("\n"):
826 if line.startswith("Task:"):
827 for task in (line[len("Task:"):]).split(","):
828 task = task.strip()
829 if task not in tasks:
830 tasks[task] = set()
831 tasks[task].add(pkg.name)
832 for task in tasks:
833 installed = True
834 for pkgname in tasks[task]:
835 if not self[pkgname].is_installed:
836 installed = False
837 break
838 if installed:
839 installed_tasks.add(task)
840 return installed_tasks
841
842 def installTasks(self, tasks):
843 logging.debug("running installTasks")
844 for pkg in self:
845 if pkg.marked_install or pkg.is_installed:
846 continue
847 self._lookupPkgRecord(pkg)
848 if not (hasattr(pkg._pcache._records,"record") and pkg._pcache._records.record):
849 logging.warning("can not find Record for '%s'" % pkg.name)
850 continue
851 for line in pkg._pcache._records.record.split("\n"):
852 if line.startswith("Task:"):
853 for task in (line[len("Task:"):]).split(","):
854 task = task.strip()
855 if task in tasks:
856 pkg.mark_install()
857 return True
858
859 def _keepBaseMetaPkgsInstalled(self, view):
860 for pkg in self.config.getlist("Distro","BaseMetaPkgs"):
861 self._keep_installed(pkg, "base meta package keep installed rule")
862
863 def _installMetaPkgs(self, view):
864
865 def metaPkgInstalled():
866 """
867 internal helper that checks if at least one meta-pkg is
868 installed or marked install
869 """
870 for key in metapkgs:
871 if key in self:
872 pkg = self[key]
873 if pkg.is_installed and pkg.marked_delete:
874 logging.debug("metapkg '%s' installed but marked_delete" % pkg.name)
875 if ((pkg.is_installed and not pkg.marked_delete)
876 or self[key].marked_install):
877 return True
878 return False
879
880 # now check for ubuntu-desktop, kubuntu-desktop, edubuntu-desktop
881 metapkgs = self.config.getlist("Distro","MetaPkgs")
882
883 # we never go without ubuntu-base
884 for pkg in self.config.getlist("Distro","BaseMetaPkgs"):
885 self[pkg].mark_install()
886
887 # every meta-pkg that is installed currently, will be marked
888 # install (that result in a upgrade and removes a mark_delete)
889 for key in metapkgs:
890 try:
891 if (key in self and
892 self[key].is_installed and
893 self[key].is_upgradable):
894 logging.debug("Marking '%s' for upgrade" % key)
895 self[key].mark_upgrade()
896 except SystemError as e:
897 # warn here, but don't fail, its possible that meta-packages
898 # conflict (like ubuntu-desktop vs xubuntu-desktop) LP: #775411
899 logging.warn("Can't mark '%s' for upgrade (%s)" % (key,e))
900
901 # check if we have a meta-pkg, if not, try to guess which one to pick
902 if not metaPkgInstalled():
903 logging.debug("none of the '%s' meta-pkgs installed" % metapkgs)
904 for key in metapkgs:
905 deps_found = True
906 for pkg in self.config.getlist(key,"KeyDependencies"):
907 deps_found &= pkg in self and self[pkg].is_installed
908 if deps_found:
909 logging.debug("guessing '%s' as missing meta-pkg" % key)
910 try:
911 self[key].mark_install()
912 except (SystemError, KeyError) as e:
913 logging.error("failed to mark '%s' for install (%s)" % (key,e))
914 view.error(_("Can't install '%s'") % key,
915 _("It was impossible to install a "
916 "required package. Please report "
917 "this as a bug using "
918 "'ubuntu-bug update-manager' in "
919 "a terminal."))
920 return False
921 logging.debug("marked_install: '%s' -> '%s'" % (key, self[key].marked_install))
922 break
923 # check if we actually found one
924 if not metaPkgInstalled():
925 # FIXME: provide a list
926 view.error(_("Can't guess meta-package"),
927 _("Your system does not contain a "
928 "ubuntu-desktop, kubuntu-desktop, xubuntu-desktop or "
929 "edubuntu-desktop package and it was not "
930 "possible to detect which version of "
931 "Ubuntu you are running.\n "
932 "Please install one of the packages "
933 "above first using synaptic or "
934 "apt-get before proceeding."))
935 return False
936 return True
937
938 def _inRemovalBlacklist(self, pkgname):
939 for expr in self.removal_blacklist:
940 if re.compile(expr).match(pkgname):
941 logging.debug("blacklist expr '%s' matches '%s'" % (expr, pkgname))
942 return True
943 return False
944
945 @withResolverLog
946 def tryMarkObsoleteForRemoval(self, pkgname, remove_candidates, foreign_pkgs):
947 #logging.debug("tryMarkObsoleteForRemoval(): %s" % pkgname)
948 # sanity check, first see if it looks like a running kernel pkg
949 if pkgname.endswith(self.uname):
950 logging.debug("skipping running kernel pkg '%s'" % pkgname)
951 return False
952 if self._inRemovalBlacklist(pkgname):
953 logging.debug("skipping '%s' (in removalBlacklist)" % pkgname)
954 return False
955 # ensure we honor KeepInstalledSection here as well
956 for section in self.config.getlist("Distro","KeepInstalledSection"):
957 if pkgname in self and self[pkgname].section == section:
958 logging.debug("skipping '%s' (in KeepInstalledSection)" % pkgname)
959 return False
960 # if we don't have the package anyway, we are fine (this can
961 # happen when forced_obsoletes are specified in the config file)
962 if pkgname not in self:
963 #logging.debug("package '%s' not in cache" % pkgname)
964 return True
965 # check if we want to purge
966 try:
967 purge = self.config.getboolean("Distro","PurgeObsoletes")
968 except configparser.NoOptionError as e:
969 purge = False
970
971 # this is a delete candidate, only actually delete,
972 # if it dosn't remove other packages depending on it
973 # that are not obsolete as well
974 actiongroup = apt_pkg.ActionGroup(self._depcache)
975 # just make pyflakes shut up, later we should use
976 # with self.actiongroup():
977 actiongroup
978 self.create_snapshot()
979 try:
980 self[pkgname].mark_delete(purge=purge)
981 self.view.processEvents()
982 #logging.debug("marking '%s' for removal" % pkgname)
983 for pkg in self.get_changes():
984 if (pkg.name not in remove_candidates or
985 pkg.name in foreign_pkgs or
986 self._inRemovalBlacklist(pkg.name)):
987 logging.debug("package '%s' has unwanted removals, skipping" % pkgname)
988 self.restore_snapshot()
989 return False
990 except (SystemError, KeyError) as e:
991 logging.warning("_tryMarkObsoleteForRemoval failed for '%s' (%s: %s)" % (pkgname, repr(e), e))
992 self.restore_snapshot()
993 return False
994 return True
995
996 def _getObsoletesPkgs(self):
997 " get all package names that are not downloadable "
998 obsolete_pkgs =set()
999 for pkg in self:
1000 if pkg.is_installed:
1001 # check if any version is downloadable. we need to check
1002 # for older ones too, because there might be
1003 # cases where e.g. firefox in gutsy-updates is newer
1004 # than hardy
1005 if not self.anyVersionDownloadable(pkg):
1006 obsolete_pkgs.add(pkg.name)
1007 return obsolete_pkgs
1008
1009 def anyVersionDownloadable(self, pkg):
1010 " helper that checks if any of the version of pkg is downloadable "
1011 for ver in pkg._pkg.version_list:
1012 if ver.downloadable:
1013 return True
1014 return False
1015
1016 def _getUnusedDependencies(self):
1017 " get all package names that are not downloadable "
1018 unused_dependencies =set()
1019 for pkg in self:
1020 if pkg.is_installed and self._depcache.is_garbage(pkg._pkg):
1021 unused_dependencies.add(pkg.name)
1022 return unused_dependencies
1023
1024 def get_installed_demoted_packages(self):
1025 """ return list of installed and demoted packages
1026
1027 If a demoted package is a automatic install it will be skipped
1028 """
1029 demotions = set()
1030 demotions_file = self.config.get("Distro","Demotions")
1031 if os.path.exists(demotions_file):
1032 with open(demotions_file) as demotions_f:
1033 for line in demotions_f:
1034 if not line.startswith("#"):
1035 demotions.add(line.strip())
1036 installed_demotions = set()
1037 for demoted_pkgname in demotions:
1038 if demoted_pkgname not in self:
1039 continue
1040 pkg = self[demoted_pkgname]
1041 if (not pkg.is_installed or
1042 self._depcache.is_auto_installed(pkg._pkg) or
1043 pkg.marked_delete):
1044 continue
1045 installed_demotions.add(pkg)
1046 return list(installed_demotions)
1047
1048 def _getForeignPkgs(self, allowed_origin, fromDist, toDist):
1049 """ get all packages that are installed from a foreign repo
1050 (and are actually downloadable)
1051 """
1052 foreign_pkgs=set()
1053 for pkg in self:
1054 if pkg.is_installed and self.downloadable(pkg):
1055 if not pkg.candidate:
1056 continue
1057 # assume it is foreign and see if it is from the
1058 # official archive
1059 foreign=True
1060 for origin in pkg.candidate.origins:
1061 # FIXME: use some better metric here
1062 if fromDist in origin.archive and \
1063 origin.origin == allowed_origin:
1064 foreign = False
1065 if toDist in origin.archive and \
1066 origin.origin == allowed_origin:
1067 foreign = False
1068 if foreign:
1069 foreign_pkgs.add(pkg.name)
1070 return foreign_pkgs
1071
1072 def checkFreeSpace(self, snapshots_in_use=False):
1073 """
1074 this checks if we have enough free space on /var, /boot and /usr
1075 with the given cache
1076
1077 Note: this can not be fully accurate if there are multiple
1078 mountpoints for /usr, /var, /boot
1079 """
1080
1081 class FreeSpace(object):
1082 " helper class that represents the free space on each mounted fs "
1083 def __init__(self, initialFree):
1084 self.free = initialFree
1085 self.need = 0
1086
1087 def make_fs_id(d):
1088 """ return 'id' of a directory so that directories on the
1089 same filesystem get the same id (simply the mount_point)
1090 """
1091 for mount_point in mounted:
1092 if d.startswith(mount_point):
1093 return mount_point
1094 return "/"
1095
1096 # this is all a bit complicated
1097 # 1) check what is mounted (in mounted)
1098 # 2) create FreeSpace objects for the dirs we are interested in
1099 # (mnt_map)
1100 # 3) use the mnt_map to check if we have enough free space and
1101 # if not tell the user how much is missing
1102 mounted = []
1103 mnt_map = {}
1104 fs_free = {}
1105 with open("/proc/mounts") as mounts:
1106 for line in mounts:
1107 try:
1108 (what, where, fs, options, a, b) = line.split()
1109 except ValueError as e:
1110 logging.debug("line '%s' in /proc/mounts not understood (%s)" % (line, e))
1111 continue
1112 if not where in mounted:
1113 mounted.append(where)
1114 # make sure mounted is sorted by longest path
1115 mounted.sort(key=len, reverse=True)
1116 archivedir = apt_pkg.config.find_dir("Dir::Cache::archives")
1117 aufs_rw_dir = "/tmp/"
1118 if (hasattr(self, "config") and
1119 self.config.getWithDefault("Aufs","Enabled", False)):
1120 aufs_rw_dir = self.config.get("Aufs","RWDir")
1121 if not os.path.exists(aufs_rw_dir):
1122 os.makedirs(aufs_rw_dir)
1123 logging.debug("cache aufs_rw_dir: %s" % aufs_rw_dir)
1124 for d in ["/","/usr","/var","/boot", archivedir, aufs_rw_dir, "/home","/tmp/"]:
1125 d = os.path.realpath(d)
1126 fs_id = make_fs_id(d)
1127 if os.path.exists(d):
1128 st = os.statvfs(d)
1129 free = st.f_bavail * st.f_frsize
1130 else:
1131 logging.warn("directory '%s' does not exists" % d)
1132 free = 0
1133 if fs_id in mnt_map:
1134 logging.debug("Dir %s mounted on %s" % (d,mnt_map[fs_id]))
1135 fs_free[d] = fs_free[mnt_map[fs_id]]
1136 else:
1137 logging.debug("Free space on %s: %s" % (d,free))
1138 mnt_map[fs_id] = d
1139 fs_free[d] = FreeSpace(free)
1140 del mnt_map
1141 logging.debug("fs_free contains: '%s'" % fs_free)
1142
1143 # now calculate the space that is required on /boot
1144 # we do this by checking how many linux-image-$ver packages
1145 # are installed or going to be installed
1146 space_in_boot = 0
1147 for pkg in self:
1148 # we match against everything that looks like a kernel
1149 # and add space check to filter out metapackages
1150 if re.match("^linux-(image|image-debug)-[0-9.]*-.*", pkg.name):
1151 if pkg.marked_install:
1152 logging.debug("%s (new-install) added with %s to boot space" % (pkg.name, KERNEL_INITRD_SIZE))
1153 space_in_boot += KERNEL_INITRD_SIZE
1154 # mvo: jaunty does not create .bak files anymore
1155 #elif (pkg.marked_upgrade or pkg.is_installed):
1156 # logging.debug("%s (upgrade|installed) added with %s to boot space" % (pkg.name, KERNEL_INITRD_SIZE))
1157 # space_in_boot += KERNEL_INITRD_SIZE # creates .bak
1158
1159 # we check for various sizes:
1160 # archivedir is were we download the debs
1161 # /usr is assumed to get *all* of the install space (incorrect,
1162 # but as good as we can do currently + safety buffer
1163 # / has a small safety buffer as well
1164 required_for_aufs = 0.0
1165 if (hasattr(self, "config") and
1166 self.config.getWithDefault("Aufs","Enabled", False)):
1167 logging.debug("taking aufs overlay into space calculation")
1168 aufs_rw_dir = self.config.get("Aufs","RWDir")
1169 # if we use the aufs rw overlay all the space is consumed
1170 # the overlay dir
1171 for pkg in self:
1172 if pkg.marked_upgrade or pkg.marked_install:
1173 required_for_aufs += pkg.candidate.installed_size
1174
1175 # add old size of the package if we use snapshots
1176 required_for_snapshots = 0.0
1177 if snapshots_in_use:
1178 for pkg in self:
1179 if (pkg.is_installed and
1180 (pkg.marked_upgrade or pkg.marked_delete)):
1181 required_for_snapshots += pkg.installed.installed_size
1182 logging.debug("additional space for the snapshots: %s" % required_for_snapshots)
1183
1184 # sum up space requirements
1185 for (dir, size) in [(archivedir, self.required_download),
1186 # plus 50M safety buffer in /usr
1187 ("/usr", self.additional_required_space),
1188 ("/usr", 50*1024*1024),
1189 ("/boot", space_in_boot),
1190 ("/tmp", 5*1024*1024), # /tmp for dkms LP: #427035
1191 ("/", 10*1024*1024), # small safety buffer /
1192 (aufs_rw_dir, required_for_aufs),
1193 # if snapshots are in use
1194 ("/usr", required_for_snapshots),
1195 ]:
1196 dir = os.path.realpath(dir)
1197 logging.debug("dir '%s' needs '%s' of '%s' (%f)" % (dir, size, fs_free[dir], fs_free[dir].free))
1198 fs_free[dir].free -= size
1199 fs_free[dir].need += size
1200
1201
1202 # check for space required violations
1203 required_list = {}
1204 for dir in fs_free:
1205 if fs_free[dir].free < 0:
1206 free_at_least = apt_pkg.size_to_str(float(abs(fs_free[dir].free)+1))
1207 # make_fs_id ensures we only get stuff on the same
1208 # mountpoint, so we report the requirements only once
1209 # per mountpoint
1210 required_list[make_fs_id(dir)] = FreeSpaceRequired(apt_pkg.size_to_str(fs_free[dir].need), make_fs_id(dir), free_at_least)
1211 # raise exception if free space check fails
1212 if len(required_list) > 0:
1213 logging.error("Not enough free space: %s" % [str(i) for i in required_list])
1214 raise NotEnoughFreeSpaceError(list(required_list.values()))
1215 return True
1216
1217
1218
1219if __name__ == "__main__":
1220 import sys
1221 from .DistUpgradeConfigParser import DistUpgradeConfig
1222 from .DistUpgradeView import DistUpgradeView
1223 print("foo")
1224 c = MyCache(DistUpgradeConfig("."), DistUpgradeView(), None)
1225 #c.checkForNvidia()
1226 #print(c._identifyObsoleteKernels())
1227 print(c.checkFreeSpace())
1228 sys.exit()
1229
1230 c.clear()
1231 c.create_snapshot()
1232 c.installedTasks
1233 c.installTasks(["ubuntu-desktop"])
1234 print(c.get_changes())
1235 c.restore_snapshot()
12360
=== removed file 'DistUpgrade/DistUpgradeConfigParser.py'
--- DistUpgrade/DistUpgradeConfigParser.py 2012-06-11 10:46:56 +0000
+++ DistUpgrade/DistUpgradeConfigParser.py 1970-01-01 00:00:00 +0000
@@ -1,85 +0,0 @@
1from __future__ import print_function
2
3import sys
4try:
5 # >= 3.0
6 from configparser import NoOptionError, NoSectionError
7 if sys.version >= '3.2':
8 from configparser import ConfigParser as SafeConfigParser
9 else:
10 from configparser import SafeConfigParser
11except ImportError:
12 # < 3.0
13 from ConfigParser import SafeConfigParser, NoOptionError, NoSectionError
14import subprocess
15import os.path
16import logging
17import glob
18
19CONFIG_OVERRIDE_DIR = "/etc/update-manager/release-upgrades.d"
20
21class DistUpgradeConfig(SafeConfigParser):
22 def __init__(self, datadir, name="DistUpgrade.cfg",
23 override_dir=None, defaults_dir=None):
24 SafeConfigParser.__init__(self)
25 # we support a config overwrite, if DistUpgrade.cfg.dapper exists
26 # and the user runs dapper, that one will be used
27 from_release = subprocess.Popen(["lsb_release","-c","-s"],
28 stdout=subprocess.PIPE,
29 universal_newlines=True).communicate()[0].strip()
30 self.datadir=datadir
31 if os.path.exists(name+"."+from_release):
32 name = name+"."+from_release
33 maincfg = os.path.join(datadir,name)
34 # defaults are read first
35 self.config_files = []
36 if defaults_dir:
37 for cfg in glob.glob(defaults_dir+"/*.cfg"):
38 self.config_files.append(cfg)
39 # our config file
40 self.config_files += [maincfg]
41 # overrides are read later
42 if override_dir is None:
43 override_dir = CONFIG_OVERRIDE_DIR
44 if override_dir is not None:
45 for cfg in glob.glob(override_dir+"/*.cfg"):
46 self.config_files.append(cfg)
47 self.read(self.config_files)
48 def getWithDefault(self, section, option, default):
49 try:
50 if type(default) == bool:
51 return self.getboolean(section, option)
52 elif type(default) == float:
53 return self.getfloat(section, option)
54 elif type(default) == int:
55 return self.getint(section, option)
56 return self.get(section, option)
57 except (NoSectionError, NoOptionError):
58 return default
59 def getlist(self, section, option):
60 try:
61 tmp = self.get(section, option)
62 except (NoSectionError,NoOptionError):
63 return []
64 items = [x.strip() for x in tmp.split(",")]
65 return items
66 def getListFromFile(self, section, option):
67 try:
68 filename = self.get(section, option)
69 except NoOptionError:
70 return []
71 p = os.path.join(self.datadir,filename)
72 if not os.path.exists(p):
73 logging.error("getListFromFile: no '%s' found" % p)
74 items = [x.strip() for x in open(p)]
75 return [s for s in items if not s.startswith("#") and not s == ""]
76
77
78if __name__ == "__main__":
79 c = DistUpgradeConfig(".")
80 print(c.getlist("Distro","MetaPkgs"))
81 print(c.getlist("Distro","ForcedPurges"))
82 print(c.getListFromFile("Sources","ValidMirrors"))
83 print(c.getWithDefault("Distro","EnableApport", True))
84 print(c.set("Distro","Foo", "False"))
85 print(c.getWithDefault("Distro","Foo", True))
860
=== removed file 'DistUpgrade/DistUpgradeController.py'
--- DistUpgrade/DistUpgradeController.py 2012-06-11 12:09:52 +0000
+++ DistUpgrade/DistUpgradeController.py 1970-01-01 00:00:00 +0000
@@ -1,1793 +0,0 @@
1# DistUpgradeController.py
2#
3# Copyright (c) 2004-2008 Canonical
4#
5# Author: Michael Vogt <michael.vogt@ubuntu.com>
6#
7# This program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as
9# published by the Free Software Foundation; either version 2 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20# USA
21
22
23from __future__ import absolute_import, print_function
24
25import warnings
26warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning)
27import apt
28import apt_pkg
29import sys
30import os
31import subprocess
32import locale
33import logging
34import shutil
35import glob
36import time
37import copy
38try:
39 # >= 3.0
40 from configparser import NoOptionError
41 if sys.version >= '3.2':
42 from configparser import ConfigParser as SafeConfigParser
43 else:
44 from configparser import SafeConfigParser
45except ImportError:
46 # < 3.0
47 from ConfigParser import SafeConfigParser, NoOptionError
48from .utils import (country_mirror,
49 url_downloadable,
50 check_and_fix_xbit,
51 get_arch,
52 iptables_active,
53 inside_chroot,
54 get_string_with_no_auth_from_source_entry,
55 is_child_of_process_name)
56from string import Template
57try:
58 from urllib.parse import urlsplit
59except ImportError:
60 from urlparse import urlsplit
61
62from .DistUpgradeView import STEP_PREPARE, STEP_MODIFY_SOURCES, STEP_FETCH, STEP_INSTALL, STEP_CLEANUP, STEP_REBOOT
63from .DistUpgradeCache import MyCache
64from .DistUpgradeConfigParser import DistUpgradeConfig
65from .DistUpgradeQuirks import DistUpgradeQuirks
66from .DistUpgradeAptCdrom import AptCdrom
67from .DistUpgradeAufs import setupAufs, aufsOptionsAndEnvironmentSetup
68
69# workaround broken relative import in python-apt (LP: #871007), we
70# want the local version of distinfo.py from oneiric, but because of
71# a bug in python-apt we will get the natty version that does not
72# know about "Component.parent_component" leading to a crash
73from . import distinfo
74from . import sourceslist
75sourceslist.DistInfo = distinfo.DistInfo
76
77from .sourceslist import SourcesList, is_mirror
78from .distro import get_distro, NoDistroTemplateException
79
80from .DistUpgradeGettext import gettext as _
81from .DistUpgradeGettext import ngettext
82import gettext
83
84from .DistUpgradeCache import (CacheExceptionDpkgInterrupted,
85 CacheExceptionLockingFailed,
86 NotEnoughFreeSpaceError)
87from .DistUpgradeApport import run_apport
88
89REBOOT_REQUIRED_FILE = "/var/run/reboot-required"
90
91class NoBackportsFoundException(Exception):
92 pass
93
94
95class DistUpgradeController(object):
96 """ this is the controller that does most of the work """
97
98 def __init__(self, distUpgradeView, options=None, datadir=None):
99 # setup the paths
100 localedir = "/usr/share/locale/"
101 if datadir == None:
102 datadir = os.getcwd()
103 localedir = os.path.join(datadir,"mo")
104 self.datadir = datadir
105 self.options = options
106
107 # init gettext
108 gettext.bindtextdomain("update-manager",localedir)
109 gettext.textdomain("update-manager")
110
111 # setup the view
112 logging.debug("Using '%s' view" % distUpgradeView.__class__.__name__)
113 self._view = distUpgradeView
114 self._view.updateStatus(_("Reading cache"))
115 self.cache = None
116
117 if not self.options or self.options.withNetwork == None:
118 self.useNetwork = True
119 else:
120 self.useNetwork = self.options.withNetwork
121 if options:
122 cdrompath = options.cdromPath
123 else:
124 cdrompath = None
125 self.aptcdrom = AptCdrom(distUpgradeView, cdrompath)
126
127 # the configuration
128 self.config = DistUpgradeConfig(datadir)
129 self.sources_backup_ext = "."+self.config.get("Files","BackupExt")
130
131 # move some of the options stuff into the self.config,
132 # ConfigParser deals only with strings it seems *sigh*
133 self.config.add_section("Options")
134 self.config.set("Options","withNetwork", str(self.useNetwork))
135
136 # aufs stuff
137 aufsOptionsAndEnvironmentSetup(self.options, self.config)
138
139 # some constants here
140 self.fromDist = self.config.get("Sources","From")
141 self.toDist = self.config.get("Sources","To")
142 self.origin = self.config.get("Sources","ValidOrigin")
143 self.arch = get_arch()
144
145 # we run with --force-overwrite by default
146 if "RELEASE_UPGRADE_NO_FORCE_OVERWRITE" not in os.environ:
147 logging.debug("enable dpkg --force-overwrite")
148 apt_pkg.config.set("DPkg::Options::","--force-overwrite")
149
150 # we run in full upgrade mode by default
151 self._partialUpgrade = False
152
153 # install the quirks handler
154 self.quirks = DistUpgradeQuirks(self, self.config)
155
156 # setup env var
157 os.environ["RELEASE_UPGRADE_IN_PROGRESS"] = "1"
158 os.environ["PYCENTRAL_FORCE_OVERWRITE"] = "1"
159 os.environ["PATH"] = "%s:%s" % (os.getcwd()+"/imported",
160 os.environ["PATH"])
161 check_and_fix_xbit("./imported/invoke-rc.d")
162
163 # set max retries
164 maxRetries = self.config.getint("Network","MaxRetries")
165 apt_pkg.config.set("Acquire::Retries", str(maxRetries))
166 # max sizes for dpkgpm for large installs (see linux/limits.h and
167 # linux/binfmts.h)
168 apt_pkg.config.set("Dpkg::MaxArgs", str(64*1024))
169 apt_pkg.config.set("Dpkg::MaxArgBytes", str(128*1024))
170
171 # smaller to avoid hangs
172 apt_pkg.config.set("Acquire::http::Timeout","20")
173 apt_pkg.config.set("Acquire::ftp::Timeout","20")
174
175 # no list cleanup here otherwise a "cancel" in the upgrade
176 # will not restore the full state (lists will be missing)
177 apt_pkg.config.set("Apt::Get::List-Cleanup", "false")
178
179 # forced obsoletes
180 self.forced_obsoletes = self.config.getlist("Distro","ForcedObsoletes")
181 # list of valid mirrors that we can add
182 self.valid_mirrors = self.config.getListFromFile("Sources","ValidMirrors")
183 # third party mirrors
184 self.valid_3p_mirrors = []
185 if self.config.has_section('ThirdPartyMirrors'):
186 self.valid_3p_mirrors = [pair[1] for pair in
187 self.config.items('ThirdPartyMirrors')]
188 # debugging
189 #apt_pkg.config.set("DPkg::Options::","--debug=0077")
190
191 # apt cron job
192 self._aptCronJobPerms = 0o755
193
194 def openCache(self, lock=True):
195 logging.debug("openCache()")
196 if self.cache is None:
197 self.quirks.run("PreCacheOpen")
198 else:
199 self.cache.release_lock()
200 self.cache.unlock_lists_dir()
201 try:
202 self.cache = MyCache(self.config,
203 self._view,
204 self.quirks,
205 self._view.getOpCacheProgress(),
206 lock)
207 # alias name for the plugin interface code
208 self.apt_cache = self.cache
209 # if we get a dpkg error that it was interrupted, just
210 # run dpkg --configure -a
211 except CacheExceptionDpkgInterrupted as e:
212 logging.warning("dpkg interrupted, calling dpkg --configure -a")
213 cmd = ["/usr/bin/dpkg","--configure","-a"]
214 if os.environ.get("DEBIAN_FRONTEND") == "noninteractive":
215 cmd.append("--force-confold")
216 self._view.getTerminal().call(cmd)
217 self.cache = MyCache(self.config,
218 self._view,
219 self.quirks,
220 self._view.getOpCacheProgress())
221 except CacheExceptionLockingFailed as e:
222 logging.error("Cache can not be locked (%s)" % e)
223 self._view.error(_("Unable to get exclusive lock"),
224 _("This usually means that another "
225 "package management application "
226 "(like apt-get or aptitude) "
227 "already running. Please close that "
228 "application first."));
229 sys.exit(1)
230 self.cache.partialUpgrade = self._partialUpgrade
231 logging.debug("/openCache(), new cache size %i" % len(self.cache))
232
233 def _viewSupportsSSH(self):
234 """
235 Returns True if this view support upgrades over ssh.
236 In theory all views should support it, but for savety
237 we do only allow text ssh upgrades (see LP: #322482)
238 """
239 supported = self.config.getlist("View","SupportSSH")
240 if self._view.__class__.__name__ in supported:
241 return True
242 return False
243
244 def _sshMagic(self):
245 """ this will check for server mode and if we run over ssh.
246 if this is the case, we will ask and spawn a additional
247 daemon (to be sure we have a spare one around in case
248 of trouble)
249 """
250 pidfile = os.path.join("/var/run/release-upgrader-sshd.pid")
251 if (not os.path.exists(pidfile) and
252 os.path.isdir("/proc") and
253 is_child_of_process_name("sshd")):
254 # check if the frontend supports ssh upgrades (see lp: #322482)
255 if not self._viewSupportsSSH():
256 logging.error("upgrade over ssh not alllowed")
257 self._view.error(_("Upgrading over remote connection not supported"),
258 _("You are running the upgrade over a "
259 "remote ssh connection with a frontend "
260 "that does "
261 "not support this. Please try a text "
262 "mode upgrade with 'do-release-upgrade'."
263 "\n\n"
264 "The upgrade will "
265 "abort now. Please try without ssh.")
266 )
267 sys.exit(1)
268 return False
269 # ask for a spare one to start (and below 1024)
270 port = 1022
271 res = self._view.askYesNoQuestion(
272 _("Continue running under SSH?"),
273 _("This session appears to be running under ssh. "
274 "It is not recommended to perform a upgrade "
275 "over ssh currently because in case of failure "
276 "it is harder to recover.\n\n"
277 "If you continue, an additional ssh daemon will be "
278 "started at port '%s'.\n"
279 "Do you want to continue?") % port)
280 # abort
281 if res == False:
282 sys.exit(1)
283 res = subprocess.call(["/usr/sbin/sshd",
284 "-o", "PidFile=%s" % pidfile,
285 "-p",str(port)])
286 if res == 0:
287 summary = _("Starting additional sshd")
288 descr = _("To make recovery in case of failure easier, an "
289 "additional sshd will be started on port '%s'. "
290 "If anything goes wrong with the running ssh "
291 "you can still connect to the additional one.\n"
292 ) % port
293 if iptables_active():
294 cmd = "iptables -I INPUT -p tcp --dport %s -j ACCEPT" % port
295 descr += _(
296 "If you run a firewall, you may need to "
297 "temporarily open this port. As this is "
298 "potentially dangerous it's not done automatically. "
299 "You can open the port with e.g.:\n'%s'") % cmd
300 self._view.information(summary, descr)
301 return True
302
303 def _tryUpdateSelf(self):
304 """ this is a helper that is run if we are started from a CD
305 and we have network - we will then try to fetch a update
306 of ourself
307 """
308 from .MetaRelease import MetaReleaseCore
309 from .DistUpgradeFetcherSelf import DistUpgradeFetcherSelf
310 # check if we run from a LTS
311 forceLTS=False
312 if (self.release == "dapper" or
313 self.release == "hardy" or
314 self.release == "lucid" or
315 self.release == "precise"):
316 forceLTS=True
317 m = MetaReleaseCore(useDevelopmentRelease=False,
318 forceLTS=forceLTS)
319 # this will timeout eventually
320 while m.downloading:
321 self._view.processEvents()
322 time.sleep(0.1)
323 if m.new_dist is None:
324 logging.error("No new dist found")
325 return False
326 # we have a new dist
327 progress = self._view.getAcquireProgress()
328 fetcher = DistUpgradeFetcherSelf(new_dist=m.new_dist,
329 progress=progress,
330 options=self.options,
331 view=self._view)
332 fetcher.run()
333
334 def _pythonSymlinkCheck(self):
335 """ sanity check that /usr/bin/python points to the default
336 python version. Users tend to modify this symlink, which
337 breaks stuff in obscure ways (Ubuntu #75557).
338 """
339 logging.debug("_pythonSymlinkCheck run")
340 if os.path.exists('/usr/share/python/debian_defaults'):
341 config = SafeConfigParser()
342 config.readfp(open('/usr/share/python/debian_defaults'))
343 try:
344 expected_default = config.get('DEFAULT', 'default-version')
345 except NoOptionError:
346 logging.debug("no default version for python found in '%s'" % config)
347 return False
348 try:
349 fs_default_version = os.readlink('/usr/bin/python')
350 except OSError as e:
351 logging.error("os.readlink failed (%s)" % e)
352 return False
353 if not fs_default_version in (expected_default, os.path.join('/usr/bin', expected_default)):
354 logging.debug("python symlink points to: '%s', but expected is '%s' or '%s'" % (fs_default_version, expected_default, os.path.join('/usr/bin', expected_default)))
355 return False
356 return True
357
358
359 def prepare(self):
360 """ initial cache opening, sanity checking, network checking """
361 # first check if that is a good upgrade
362 self.release = release = subprocess.Popen(["lsb_release","-c","-s"],
363 stdout=subprocess.PIPE,
364 universal_newlines=True).communicate()[0].strip()
365 logging.debug("lsb-release: '%s'" % release)
366 if not (release == self.fromDist or release == self.toDist):
367 logging.error("Bad upgrade: '%s' != '%s' " % (release, self.fromDist))
368 self._view.error(_("Can not upgrade"),
369 _("An upgrade from '%s' to '%s' is not "
370 "supported with this tool." % (release, self.toDist)))
371 sys.exit(1)
372
373 # setup aufs
374 if self.config.getWithDefault("Aufs", "EnableFullOverlay", False):
375 aufs_rw_dir = self.config.get("Aufs","RWDir")
376 if not setupAufs(aufs_rw_dir):
377 logging.error("aufs setup failed")
378 self._view.error(_("Sandbox setup failed"),
379 _("It was not possible to create the sandbox "
380 "environment."))
381 return False
382
383 # all good, tell the user about the sandbox mode
384 logging.info("running in aufs overlay mode")
385 self._view.information(_("Sandbox mode"),
386 _("This upgrade is running in sandbox "
387 "(test) mode. All changes are written "
388 "to '%s' and will be lost on the next "
389 "reboot.\n\n"
390 "*No* changes written to a system directory "
391 "from now until the next reboot are "
392 "permanent.") % aufs_rw_dir)
393
394 # setup backports (if we have them)
395 if self.options and self.options.havePrerequists:
396 backportsdir = os.getcwd()+"/backports"
397 logging.info("using backports in '%s' " % backportsdir)
398 logging.debug("have: %s" % glob.glob(backportsdir+"/*.udeb"))
399 if os.path.exists(backportsdir+"/usr/bin/dpkg"):
400 apt_pkg.config.set("Dir::Bin::dpkg",backportsdir+"/usr/bin/dpkg");
401 if os.path.exists(backportsdir+"/usr/lib/apt/methods"):
402 apt_pkg.config.set("Dir::Bin::methods",backportsdir+"/usr/lib/apt/methods")
403 conf = backportsdir+"/etc/apt/apt.conf.d/01ubuntu"
404 if os.path.exists(conf):
405 logging.debug("adding config '%s'" % conf)
406 apt_pkg.read_config_file(apt_pkg.config, conf)
407
408 # do the ssh check and warn if we run under ssh
409 self._sshMagic()
410 # check python version
411 if not self._pythonSymlinkCheck():
412 logging.error("pythonSymlinkCheck() failed, aborting")
413 self._view.error(_("Can not upgrade"),
414 _("Your python install is corrupted. "
415 "Please fix the '/usr/bin/python' symlink."))
416 sys.exit(1)
417 # open cache
418 try:
419 self.openCache()
420 except SystemError as e:
421 logging.error("openCache() failed: '%s'" % e)
422 return False
423 if not self.cache.sanity_check(self._view):
424 return False
425
426 # now figure out if we need to go into desktop or
427 # server mode - we use a heuristic for this
428 self.serverMode = self.cache.need_server_mode()
429 if self.serverMode:
430 os.environ["RELEASE_UPGRADE_MODE"] = "server"
431 else:
432 os.environ["RELEASE_UPGRADE_MODE"] = "desktop"
433
434 if not self.checkViewDepends():
435 logging.error("checkViewDepends() failed")
436 return False
437
438 if os.path.exists("/usr/bin/debsig-verify"):
439 logging.error("debsig-verify is installed")
440 self._view.error(_("Package 'debsig-verify' is installed"),
441 _("The upgrade can not continue with that "
442 "package installed.\n"
443 "Please remove it with synaptic "
444 "or 'apt-get remove debsig-verify' first "
445 "and run the upgrade again."))
446 self.abort()
447
448 from .DistUpgradeMain import SYSTEM_DIRS
449 for systemdir in SYSTEM_DIRS:
450 if os.path.exists(systemdir) and not os.access(systemdir, os.W_OK):
451 logging.error("%s not writable" % systemdir)
452 self._view.error(
453 _("Can not write to '%s'") % systemdir,
454 _("Its not possible to write to the system directory "
455 "'%s' on your system. The upgrade can not "
456 "continue.\n"
457 "Please make sure that the system directory is "
458 "writable.") % systemdir)
459 self.abort()
460
461
462 # FIXME: we may try to find out a bit more about the network
463 # connection here and ask more intelligent questions
464 if self.aptcdrom and self.options and self.options.withNetwork == None:
465 res = self._view.askYesNoQuestion(_("Include latest updates from the Internet?"),
466 _("The upgrade system can use the internet to "
467 "automatically download "
468 "the latest updates and install them during the "
469 "upgrade. If you have a network connection this is "
470 "highly recommended.\n\n"
471 "The upgrade will take longer, but when "
472 "it is complete, your system will be fully up to "
473 "date. You can choose not to do this, but you "
474 "should install the latest updates soon after "
475 "upgrading.\n"
476 "If you answer 'no' here, the network is not "
477 "used at all."),
478 'Yes')
479 self.useNetwork = res
480 self.config.set("Options","withNetwork", str(self.useNetwork))
481 logging.debug("useNetwork: '%s' (selected by user)" % res)
482 if res:
483 self._tryUpdateSelf()
484 return True
485
486 def _sourcesListEntryDownloadable(self, entry):
487 """
488 helper that checks if a sources.list entry points to
489 something downloadable
490 """
491 logging.debug("verifySourcesListEntry: %s" % entry)
492 # no way to verify without network
493 if not self.useNetwork:
494 logging.debug("skiping downloadable check (no network)")
495 return True
496 # check if the entry points to something we can download
497 uri = "%s/dists/%s/Release" % (entry.uri, entry.dist)
498 return url_downloadable(uri, logging.debug)
499
500 def rewriteSourcesList(self, mirror_check=True):
501 logging.debug("rewriteSourcesList()")
502
503 sync_components = self.config.getlist("Sources","Components")
504
505 # skip mirror check if special environment is set
506 # (useful for server admins with internal repos)
507 if (self.config.getWithDefault("Sources","AllowThirdParty",False) or
508 "RELEASE_UPRADER_ALLOW_THIRD_PARTY" in os.environ):
509 logging.warning("mirror check skipped, *overriden* via config")
510 mirror_check=False
511
512 # check if we need to enable main
513 if mirror_check == True and self.useNetwork:
514 # now check if the base-meta pkgs are available in
515 # the archive or only available as "now"
516 # -> if not that means that "main" is missing and we
517 # need to enable it
518 for pkgname in self.config.getlist("Distro","BaseMetaPkgs"):
519 if ((not pkgname in self.cache or
520 not self.cache[pkgname].candidate or
521 len(self.cache[pkgname].candidate.origins) == 0)
522 or
523 (self.cache[pkgname].candidate and
524 len(self.cache[pkgname].candidate.origins) == 1 and
525 self.cache[pkgname].candidate.origins[0].archive == "now")
526 ):
527 logging.debug("BaseMetaPkg '%s' has no candidate.origins" % pkgname)
528 try:
529 distro = get_distro()
530 distro.get_sources(self.sources)
531 distro.enable_component("main")
532 except NoDistroTemplateException:
533 # fallback if everything else does not work,
534 # we replace the sources.list with a single
535 # line to ubuntu-main
536 logging.warning('get_distro().enable_component("man") failed, overwriting sources.list instead as last resort')
537 s = "# auto generated by update-manager"
538 s += "deb http://archive.ubuntu.com/ubuntu %s main restricted" % self.toDist
539 s += "deb http://archive.ubuntu.com/ubuntu %s-updates main restricted" % self.toDist
540 s += "deb http://security.ubuntu.com/ubuntu %s-security main restricted" % self.toDist
541 open("/etc/apt/sources.list","w").write(s)
542 break
543
544 # this must map, i.e. second in "from" must be the second in "to"
545 # (but they can be different, so in theory we could exchange
546 # component names here)
547 pockets = self.config.getlist("Sources","Pockets")
548 fromDists = [self.fromDist] + ["%s-%s" % (self.fromDist, x)
549 for x in pockets]
550 toDists = [self.toDist] + ["%s-%s" % (self.toDist,x)
551 for x in pockets]
552 self.sources_disabled = False
553
554 # look over the stuff we have
555 foundToDist = False
556 # collect information on what components (main,universe) are enabled for what distro (sub)version
557 # e.g. found_components = { 'hardy':set("main","restricted"), 'hardy-updates':set("main") }
558 self.found_components = {}
559 for entry in self.sources.list[:]:
560
561 # ignore invalid records or disabled ones
562 if entry.invalid or entry.disabled:
563 continue
564
565 # we disable breezy cdrom sources to make sure that demoted
566 # packages are removed
567 if entry.uri.startswith("cdrom:") and entry.dist == self.fromDist:
568 logging.debug("disabled '%s' cdrom entry (dist == fromDist)" % entry)
569 entry.disabled = True
570 continue
571 # check if there is actually a lists file for them available
572 # and disable them if not
573 elif entry.uri.startswith("cdrom:"):
574 #
575 listdir = apt_pkg.config.find_dir("Dir::State::lists")
576 if not os.path.exists("%s/%s%s_%s_%s" %
577 (listdir,
578 apt_pkg.uri_to_filename(entry.uri),
579 "dists",
580 entry.dist,
581 "Release")):
582 logging.warning("disabling cdrom source '%s' because it has no Release file" % entry)
583 entry.disabled = True
584 continue
585
586 # special case for archive.canonical.com that needs to
587 # be rewritten (for pre-gutsy upgrades)
588 cdist = "%s-commercial" % self.fromDist
589 if (not entry.disabled and
590 entry.uri.startswith("http://archive.canonical.com") and
591 entry.dist == cdist):
592 entry.dist = self.toDist
593 entry.comps = ["partner"]
594 logging.debug("transitioned commercial to '%s' " % entry)
595 continue
596
597 # special case for landscape.canonical.com because they
598 # don't use a standard archive layout (gutsy->hardy)
599 if (not entry.disabled and
600 entry.uri.startswith("http://landscape.canonical.com/packages/%s" % self.fromDist)):
601 logging.debug("commenting landscape.canonical.com out")
602 entry.disabled = True
603 continue
604
605 # handle upgrades from a EOL release and check if there
606 # is a supported release available
607 if (not entry.disabled and
608 "old-releases.ubuntu.com/" in entry.uri):
609 logging.debug("upgrade from old-releases.ubuntu.com detected")
610 # test country mirror first, then archive.u.c
611 for uri in ["http://%sarchive.ubuntu.com/ubuntu" % country_mirror(),
612 "http://archive.ubuntu.com/ubuntu"]:
613 test_entry = copy.copy(entry)
614 test_entry.uri = uri
615 test_entry.dist = self.toDist
616 if self._sourcesListEntryDownloadable(test_entry):
617 logging.info("transition from old-release.u.c to %s" % uri)
618 entry.uri = uri
619 break
620
621 logging.debug("examining: '%s'" % get_string_with_no_auth_from_source_entry(entry))
622 # check if it's a mirror (or official site)
623 validMirror = self.isMirror(entry.uri)
624 thirdPartyMirror = not mirror_check or self.isThirdPartyMirror(entry.uri)
625 if validMirror or thirdPartyMirror:
626 # disabled/security/commercial/extras are special cases
627 # we use validTo/foundToDist to figure out if we have a
628 # main archive mirror in the sources.list or if we
629 # need to add one
630 validTo = True
631 if (entry.disabled or
632 entry.type == "deb-src" or
633 "/security.ubuntu.com" in entry.uri or
634 "%s-security" % self.fromDist in entry.dist or
635 "/archive.canonical.com" in entry.uri or
636 "/extras.ubuntu.com" in entry.uri):
637 validTo = False
638 if entry.dist in toDists:
639 # so the self.sources.list is already set to the new
640 # distro
641 logging.debug("entry '%s' is already set to new dist" % get_string_with_no_auth_from_source_entry(entry))
642 foundToDist |= validTo
643 elif entry.dist in fromDists:
644 foundToDist |= validTo
645 entry.dist = toDists[fromDists.index(entry.dist)]
646 logging.debug("entry '%s' updated to new dist" % get_string_with_no_auth_from_source_entry(entry))
647 elif entry.type == 'deb-src':
648 continue
649 elif validMirror:
650 # disable all entries that are official but don't
651 # point to either "to" or "from" dist
652 entry.disabled = True
653 self.sources_disabled = True
654 logging.debug("entry '%s' was disabled (unknown dist)" % get_string_with_no_auth_from_source_entry(entry))
655
656 # if we make it to this point, we have a official or third-party mirror
657
658 # check if the arch is powerpc or sparc and if so, transition
659 # to ports.ubuntu.com (powerpc got demoted in gutsy, sparc
660 # in hardy)
661 if (entry.type == "deb" and
662 not "ports.ubuntu.com" in entry.uri and
663 (self.arch == "powerpc" or self.arch == "sparc")):
664 logging.debug("moving %s source entry to 'ports.ubuntu.com' " % self.arch)
665 entry.uri = "http://ports.ubuntu.com/ubuntu-ports/"
666
667 # gather what components are enabled and are inconsitent
668 for d in ["%s" % self.toDist,
669 "%s-updates" % self.toDist,
670 "%s-security" % self.toDist]:
671 # create entry if needed, ignore disabled
672 # entries and deb-src
673 self.found_components.setdefault(d,set())
674 if (not entry.disabled and entry.dist == d and
675 entry.type == "deb"):
676 for comp in entry.comps:
677 # only sync components we know about
678 if not comp in sync_components:
679 continue
680 self.found_components[d].add(comp)
681
682 else:
683 # disable anything that is not from a official mirror or a whitelisted third party
684 if entry.dist == self.fromDist:
685 entry.dist = self.toDist
686 entry.comment += " " + _("disabled on upgrade to %s") % self.toDist
687 entry.disabled = True
688 self.sources_disabled = True
689 logging.debug("entry '%s' was disabled (unknown mirror)" % get_string_with_no_auth_from_source_entry(entry))
690
691 # now go over the list again and check for missing components
692 # in $dist-updates and $dist-security and add them
693 for entry in self.sources.list[:]:
694 # skip all comps that are not relevant (including e.g. "hardy")
695 if (entry.invalid or entry.disabled or entry.type == "deb-src" or
696 entry.uri.startswith("cdrom:") or entry.dist == self.toDist):
697 continue
698 # now check for "$dist-updates" and "$dist-security" and add any inconsistencies
699 if entry.dist in self.found_components:
700 component_diff = self.found_components[self.toDist]-self.found_components[entry.dist]
701 if component_diff:
702 logging.info("fixing components inconsistency from '%s'" % get_string_with_no_auth_from_source_entry(entry))
703 entry.comps.extend(list(component_diff))
704 logging.info("to new entry '%s'" % get_string_with_no_auth_from_source_entry(entry))
705 del self.found_components[entry.dist]
706 return foundToDist
707
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: