Merge ~nteodosio/update-manager:bionic-ua into update-manager:main
- Git
- lp:~nteodosio/update-manager
- bionic-ua
- Merge into main
Status: | Superseded |
---|---|
Proposed branch: | ~nteodosio/update-manager:bionic-ua |
Merge into: | update-manager:main |
Diff against target: |
2128 lines (+863/-137) (has conflicts) 21 files modified
.gitignore (+2/-0) HweSupportStatus/consts.py (+26/-0) UpdateManager/Core/MetaRelease.py (+14/-0) UpdateManager/Core/UpdateList.py (+129/-0) UpdateManager/Core/utils.py (+17/-0) UpdateManager/Dialogs.py (+28/-1) UpdateManager/UpdateManager.py (+120/-14) UpdateManager/UpdateManagerVersion.py (+4/-0) UpdateManager/UpdatesAvailable.py (+105/-17) UpdateManager/backend/InstallBackendAptdaemon.py (+30/-0) UpdateManager/backend/__init__.py (+56/-0) data/gtkbuilder/UpdateManager.ui (+44/-105) debian/changelog (+133/-0) debian/control (+3/-0) hwe-support-status (+5/-0) tests/test_backend_error.py (+36/-0) tests/test_hwe_support_status.py (+8/-0) tests/test_meta_release_core.py (+22/-0) tests/test_pep8.py (+42/-0) tests/test_proxy.py (+31/-0) tests/test_update_error.py (+8/-0) Conflict in HweSupportStatus/consts.py Conflict in UpdateManager/Core/MetaRelease.py Conflict in UpdateManager/Core/UpdateList.py Conflict in UpdateManager/Core/utils.py Conflict in UpdateManager/Dialogs.py Conflict in UpdateManager/UpdateManager.py Conflict in UpdateManager/UpdateManagerVersion.py Conflict in UpdateManager/UpdatesAvailable.py Conflict in UpdateManager/backend/InstallBackendAptdaemon.py Conflict in UpdateManager/backend/__init__.py Conflict in debian/changelog Conflict in debian/control Conflict in hwe-support-status Conflict in tests/test_backend_error.py Conflict in tests/test_hwe_support_status.py Conflict in tests/test_meta_release_core.py Conflict in tests/test_pep8.py Conflict in tests/test_proxy.py Conflict in tests/test_pycodestyle.py Conflict in tests/test_update_error.py |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Elio Qoshi | Pending | ||
Sebastien Bacher | Pending | ||
Review via email: mp+446967@code.launchpad.net |
Commit message
Description of the change
Implement the redesign of Ubuntu Pro in Update Manager.
PPA: https:/
Still doesn't display Ubuntu Pro packages as such when already attached, rather they're listed as normal updates.
Main differences are:
- Fuse the description and changes tabs into a single view, which is
now separated with a GtkPaned widget from the tree widget above.
- Add button to attach to enable Ubuntu Pro if it is the only action
available.
- Ubuntu base -> System components.
- Fix Ubuntu Pro item not being a parent group of its corresponding
packages.
Unmerged commits
- aa9b49f... by Nathan Teodosio
-
Add gitignore file.
- 2a11578... by Nathan Teodosio
-
Update change log.
- bd22c4a... by Nathan Teodosio
-
Implement the new Ubuntu Pro design.
- Fuse the description and changes tabs into a single view.
- Add button to attach to enable Ubuntu Pro if it is the only action
available.
- Ubuntu base -> System components.
- Fix Ubuntu Pro item not being a parent group of its corresponding
packages. - 48d6735... by Robert Ancell
-
releasing package update-manager version 1:18.04.11.17
- 1ab7416... by Robert Ancell
-
Fix Ubuntu Pro updates checkbox and expander widget from overlapping
- 67a1fd6... by Sebastien Bacher
-
releasing package update-manager version 1:18.04.11.16
- 1a006d9... by Sebastien Bacher
-
Update of the parsing for pro client changes (lp: #1990450)
- b181652... by Robert Ancell
-
Show pending Ubuntu pro packages (LP: #1990450)
- 1f906b8... by Brian Murray
-
tests/test_
meta_release_ core.py: switch a test from using lucid to bionic as precise was removed from the archive. (LP: #1929865) - 9dbf545... by Brian Murray
-
UpdateManager/
UpdateManager. py: when refreshing the cache and encountering an error return rather than trying to use the undefined cache which causes crashes. Additionally, don't present the dialog with a "Try Again" button which won't do anything. (LP: #1826213)
Preview Diff
1 | diff --git a/.gitignore b/.gitignore | |||
2 | 0 | new file mode 100644 | 0 | new file mode 100644 |
3 | index 0000000..0370a5e | |||
4 | --- /dev/null | |||
5 | +++ b/.gitignore | |||
6 | @@ -0,0 +1,2 @@ | |||
7 | 1 | tags | ||
8 | 2 | __pycache__ | ||
9 | diff --git a/HweSupportStatus/consts.py b/HweSupportStatus/consts.py | |||
10 | index 433b5b5..9dd7c56 100644 | |||
11 | --- a/HweSupportStatus/consts.py | |||
12 | +++ b/HweSupportStatus/consts.py | |||
13 | @@ -6,6 +6,7 @@ from gettext import gettext as _ | |||
14 | 6 | 6 | ||
15 | 7 | 7 | ||
16 | 8 | # the day on which the short support HWE stack goes EoL | 8 | # the day on which the short support HWE stack goes EoL |
17 | 9 | <<<<<<< HweSupportStatus/consts.py | ||
18 | 9 | HWE_EOL_DATE = datetime.date(2027, 4, 30) | 10 | HWE_EOL_DATE = datetime.date(2027, 4, 30) |
19 | 10 | 11 | ||
20 | 11 | # the day on which the next LTS first point release is available | 12 | # the day on which the next LTS first point release is available |
21 | @@ -14,6 +15,16 @@ NEXT_LTS_DOT1_DATE = datetime.date(2024, 7, 15) | |||
22 | 14 | 15 | ||
23 | 15 | # end of the month in which this LTS goes EoL | 16 | # end of the month in which this LTS goes EoL |
24 | 16 | LTS_EOL_DATE = datetime.date(2027, 4, 30) | 17 | LTS_EOL_DATE = datetime.date(2027, 4, 30) |
25 | 18 | ======= | ||
26 | 19 | HWE_EOL_DATE = datetime.date(2023, 4, 30) | ||
27 | 20 | |||
28 | 21 | # the day on which the next LTS first point release is available | ||
29 | 22 | # used to propose a release upgrade | ||
30 | 23 | NEXT_LTS_DOT1_DATE = datetime.date(2020, 7, 21) | ||
31 | 24 | |||
32 | 25 | # end of the month in which this LTS goes EoL | ||
33 | 26 | LTS_EOL_DATE = datetime.date(2023, 4, 30) | ||
34 | 27 | >>>>>>> HweSupportStatus/consts.py | ||
35 | 17 | 28 | ||
36 | 18 | 29 | ||
37 | 19 | class Messages: | 30 | class Messages: |
38 | @@ -33,7 +44,11 @@ in the Dash. | |||
39 | 33 | """ | 44 | """ |
40 | 34 | To upgrade to a supported (or longer-supported) configuration: | 45 | To upgrade to a supported (or longer-supported) configuration: |
41 | 35 | 46 | ||
42 | 47 | <<<<<<< HweSupportStatus/consts.py | ||
43 | 36 | * Upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS by running: | 48 | * Upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS by running: |
44 | 49 | ======= | ||
45 | 50 | * Upgrade from Ubuntu 16.04 LTS to Ubuntu 18.04 LTS by running: | ||
46 | 51 | >>>>>>> HweSupportStatus/consts.py | ||
47 | 37 | sudo do-release-upgrade %s | 52 | sudo do-release-upgrade %s |
48 | 38 | 53 | ||
49 | 39 | OR | 54 | OR |
50 | @@ -69,6 +84,7 @@ on %s. After this date security updates for critical parts (kernel | |||
51 | 69 | and graphics stack) of your system will no longer be available. | 84 | and graphics stack) of your system will no longer be available. |
52 | 70 | 85 | ||
53 | 71 | For more information, please see: | 86 | For more information, please see: |
54 | 87 | <<<<<<< HweSupportStatus/consts.py | ||
55 | 72 | http://wiki.ubuntu.com/2204_HWE_EOL | 88 | http://wiki.ubuntu.com/2204_HWE_EOL |
56 | 73 | """ | 89 | """ |
57 | 74 | ) | 90 | ) |
58 | @@ -85,3 +101,13 @@ Stack ended on %s: | |||
59 | 85 | ) | 101 | ) |
60 | 86 | % HWE_EOL_DATE.isoformat() | 102 | % HWE_EOL_DATE.isoformat() |
61 | 87 | ) | 103 | ) |
62 | 104 | ======= | ||
63 | 105 | http://wiki.ubuntu.com/1604_HWE_EOL | ||
64 | 106 | """) % HWE_EOL_DATE.isoformat() | ||
65 | 107 | |||
66 | 108 | HWE_SUPPORT_HAS_ENDED = _(""" | ||
67 | 109 | WARNING: Security updates for your current Hardware Enablement | ||
68 | 110 | Stack ended on %s: | ||
69 | 111 | * http://wiki.ubuntu.com/1604_HWE_EOL | ||
70 | 112 | """) % HWE_EOL_DATE.isoformat() | ||
71 | 113 | >>>>>>> HweSupportStatus/consts.py | ||
72 | diff --git a/UpdateManager/Core/MetaRelease.py b/UpdateManager/Core/MetaRelease.py | |||
73 | index 9a485c4..ce90be0 100644 | |||
74 | --- a/UpdateManager/Core/MetaRelease.py | |||
75 | +++ b/UpdateManager/Core/MetaRelease.py | |||
76 | @@ -155,13 +155,20 @@ class MetaReleaseCore(object): | |||
77 | 155 | return | 155 | return |
78 | 156 | # now check which specific url to use | 156 | # now check which specific url to use |
79 | 157 | if parser.has_option("DEFAULT", "Prompt"): | 157 | if parser.has_option("DEFAULT", "Prompt"): |
80 | 158 | <<<<<<< UpdateManager/Core/MetaRelease.py | ||
81 | 158 | prompt = parser.get("DEFAULT", "Prompt").lower() | 159 | prompt = parser.get("DEFAULT", "Prompt").lower() |
82 | 159 | if prompt == "never" or prompt == "no": | 160 | if prompt == "never" or prompt == "no": |
83 | 160 | self.prompt = "never" | 161 | self.prompt = "never" |
84 | 162 | ======= | ||
85 | 163 | type = parser.get("DEFAULT", "Prompt").lower() | ||
86 | 164 | if (type == "never" or type == "no"): | ||
87 | 165 | self.prompt = 'never' | ||
88 | 166 | >>>>>>> UpdateManager/Core/MetaRelease.py | ||
89 | 161 | # nothing to do for this object | 167 | # nothing to do for this object |
90 | 162 | # FIXME: what about no longer supported? | 168 | # FIXME: what about no longer supported? |
91 | 163 | self.downloaded.set() | 169 | self.downloaded.set() |
92 | 164 | return | 170 | return |
93 | 171 | <<<<<<< UpdateManager/Core/MetaRelease.py | ||
94 | 165 | elif prompt == "lts": | 172 | elif prompt == "lts": |
95 | 166 | self.prompt = "lts" | 173 | self.prompt = "lts" |
96 | 167 | # the Prompt=lts setting only makes sense when running on | 174 | # the Prompt=lts setting only makes sense when running on |
97 | @@ -174,6 +181,13 @@ class MetaReleaseCore(object): | |||
98 | 174 | self._debug("Prompt=lts for non-LTS, ignoring") | 181 | self._debug("Prompt=lts for non-LTS, ignoring") |
99 | 175 | else: | 182 | else: |
100 | 176 | self.prompt = "normal" | 183 | self.prompt = "normal" |
101 | 184 | ======= | ||
102 | 185 | elif type == "lts": | ||
103 | 186 | self.prompt = 'lts' | ||
104 | 187 | self.METARELEASE_URI = self.METARELEASE_URI_LTS | ||
105 | 188 | else: | ||
106 | 189 | self.prompt = 'normal' | ||
107 | 190 | >>>>>>> UpdateManager/Core/MetaRelease.py | ||
108 | 177 | # needed for the _tryUpgradeSelf() code in DistUpgradeController | 191 | # needed for the _tryUpgradeSelf() code in DistUpgradeController |
109 | 178 | if forceLTS: | 192 | if forceLTS: |
110 | 179 | self.METARELEASE_URI = self.METARELEASE_URI_LTS | 193 | self.METARELEASE_URI = self.METARELEASE_URI_LTS |
111 | diff --git a/UpdateManager/Core/UpdateList.py b/UpdateManager/Core/UpdateList.py | |||
112 | index 80b900b..d902561 100644 | |||
113 | --- a/UpdateManager/Core/UpdateList.py | |||
114 | +++ b/UpdateManager/Core/UpdateList.py | |||
115 | @@ -43,7 +43,11 @@ from gi.repository import Gio | |||
116 | 43 | from UpdateManager.Core import utils | 43 | from UpdateManager.Core import utils |
117 | 44 | 44 | ||
118 | 45 | 45 | ||
119 | 46 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
120 | 46 | class UpdateItem: | 47 | class UpdateItem: |
121 | 48 | ======= | ||
122 | 49 | class UpdateItem(): | ||
123 | 50 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
124 | 47 | def __init__(self, pkg, name, icon, to_remove, sensitive=True): | 51 | def __init__(self, pkg, name, icon, to_remove, sensitive=True): |
125 | 48 | self.icon = icon | 52 | self.icon = icon |
126 | 49 | self.name = name | 53 | self.name = name |
127 | @@ -76,6 +80,7 @@ class UpdateGroup(UpdateItem): | |||
128 | 76 | all_items.extend(self._items) | 80 | all_items.extend(self._items) |
129 | 77 | return sorted(all_items, key=lambda a: a.name.lower()) | 81 | return sorted(all_items, key=lambda a: a.name.lower()) |
130 | 78 | 82 | ||
131 | 83 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
132 | 79 | def add( | 84 | def add( |
133 | 80 | self, | 85 | self, |
134 | 81 | pkg, | 86 | pkg, |
135 | @@ -84,6 +89,10 @@ class UpdateGroup(UpdateItem): | |||
136 | 84 | to_remove=False, | 89 | to_remove=False, |
137 | 85 | sensitive=True, | 90 | sensitive=True, |
138 | 86 | ): | 91 | ): |
139 | 92 | ======= | ||
140 | 93 | def add(self, pkg, cache=None, eventloop_callback=None, to_remove=False, | ||
141 | 94 | sensitive=True): | ||
142 | 95 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
143 | 87 | name = utils.get_package_label(pkg) | 96 | name = utils.get_package_label(pkg) |
144 | 88 | icon = Gio.ThemedIcon.new("package") | 97 | icon = Gio.ThemedIcon.new("package") |
145 | 89 | self._items.add(UpdateItem(pkg, name, icon, to_remove, sensitive)) | 98 | self._items.add(UpdateItem(pkg, name, icon, to_remove, sensitive)) |
146 | @@ -168,18 +177,28 @@ class UpdateApplicationGroup(UpdateGroup): | |||
147 | 168 | def __init__(self, pkg, application, to_remove, sensitive=True): | 177 | def __init__(self, pkg, application, to_remove, sensitive=True): |
148 | 169 | name = application.get_display_name() | 178 | name = application.get_display_name() |
149 | 170 | icon = application.get_icon() | 179 | icon = application.get_icon() |
150 | 180 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
151 | 171 | super(UpdateApplicationGroup, self).__init__( | 181 | super(UpdateApplicationGroup, self).__init__( |
152 | 172 | pkg, name, icon, to_remove, sensitive | 182 | pkg, name, icon, to_remove, sensitive |
153 | 173 | ) | 183 | ) |
154 | 184 | ======= | ||
155 | 185 | super(UpdateApplicationGroup, self).__init__(pkg, name, icon, | ||
156 | 186 | to_remove, sensitive) | ||
157 | 187 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
158 | 174 | 188 | ||
159 | 175 | 189 | ||
160 | 176 | class UpdatePackageGroup(UpdateGroup): | 190 | class UpdatePackageGroup(UpdateGroup): |
161 | 177 | def __init__(self, pkg, to_remove, sensitive=True): | 191 | def __init__(self, pkg, to_remove, sensitive=True): |
162 | 178 | name = utils.get_package_label(pkg) | 192 | name = utils.get_package_label(pkg) |
163 | 179 | icon = Gio.ThemedIcon.new("package") | 193 | icon = Gio.ThemedIcon.new("package") |
164 | 194 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
165 | 180 | super(UpdatePackageGroup, self).__init__( | 195 | super(UpdatePackageGroup, self).__init__( |
166 | 181 | pkg, name, icon, to_remove, sensitive | 196 | pkg, name, icon, to_remove, sensitive |
167 | 182 | ) | 197 | ) |
168 | 198 | ======= | ||
169 | 199 | super(UpdatePackageGroup, self).__init__(pkg, name, icon, to_remove, | ||
170 | 200 | sensitive) | ||
171 | 201 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
172 | 183 | 202 | ||
173 | 184 | 203 | ||
174 | 185 | class UpdateSystemGroup(UpdateGroup): | 204 | class UpdateSystemGroup(UpdateGroup): |
175 | @@ -188,9 +207,14 @@ class UpdateSystemGroup(UpdateGroup): | |||
176 | 188 | # the core components and packages. | 207 | # the core components and packages. |
177 | 189 | name = _("%s base") % utils.get_ubuntu_flavor_name(cache=cache) | 208 | name = _("%s base") % utils.get_ubuntu_flavor_name(cache=cache) |
178 | 190 | icon = Gio.ThemedIcon.new("distributor-logo") | 209 | icon = Gio.ThemedIcon.new("distributor-logo") |
179 | 210 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
180 | 191 | super(UpdateSystemGroup, self).__init__( | 211 | super(UpdateSystemGroup, self).__init__( |
181 | 192 | None, name, icon, to_remove, sensitive | 212 | None, name, icon, to_remove, sensitive |
182 | 193 | ) | 213 | ) |
183 | 214 | ======= | ||
184 | 215 | super(UpdateSystemGroup, self).__init__(None, name, icon, to_remove, | ||
185 | 216 | sensitive) | ||
186 | 217 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
187 | 194 | 218 | ||
188 | 195 | 219 | ||
189 | 196 | class UpdateOrigin: | 220 | class UpdateOrigin: |
190 | @@ -233,7 +257,10 @@ class UpdateList: | |||
191 | 233 | self.update_groups = [] | 257 | self.update_groups = [] |
192 | 234 | self.security_groups = [] | 258 | self.security_groups = [] |
193 | 235 | self.kernel_autoremove_groups = [] | 259 | self.kernel_autoremove_groups = [] |
194 | 260 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
195 | 236 | self.duplicate_groups = [] | 261 | self.duplicate_groups = [] |
196 | 262 | ======= | ||
197 | 263 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
198 | 237 | self.ubuntu_pro_groups = [] | 264 | self.ubuntu_pro_groups = [] |
199 | 238 | self.num_updates = 0 | 265 | self.num_updates = 0 |
200 | 239 | self.random = random.Random() | 266 | self.random = random.Random() |
201 | @@ -423,9 +450,50 @@ class UpdateList: | |||
202 | 423 | return True | 450 | return True |
203 | 424 | return False | 451 | return False |
204 | 425 | 452 | ||
205 | 453 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
206 | 426 | def _make_groups( | 454 | def _make_groups( |
207 | 427 | self, cache, pkgs, eventloop_callback, to_remove=False, sensitive=True | 455 | self, cache, pkgs, eventloop_callback, to_remove=False, sensitive=True |
208 | 428 | ): | 456 | ): |
209 | 457 | ======= | ||
210 | 458 | def _get_linux_packages(self): | ||
211 | 459 | "Return all binary packages made by the linux-meta source package" | ||
212 | 460 | # Hard code this rather than generate from source info in cache because | ||
213 | 461 | # that might only be available if we have deb-src lines. I think we | ||
214 | 462 | # could also generate it by iterating over all the binary package info | ||
215 | 463 | # we have, but that is costly. These don't change often. | ||
216 | 464 | return ['linux', | ||
217 | 465 | 'linux-cloud-tools-generic', | ||
218 | 466 | 'linux-cloud-tools-lowlatency', | ||
219 | 467 | 'linux-cloud-tools-virtual', | ||
220 | 468 | 'linux-crashdump', | ||
221 | 469 | 'linux-generic', | ||
222 | 470 | 'linux-generic-lpae', | ||
223 | 471 | 'linux-headers-generic', | ||
224 | 472 | 'linux-headers-generic-lpae', | ||
225 | 473 | 'linux-headers-lowlatency', | ||
226 | 474 | 'linux-headers-lowlatency-lpae', | ||
227 | 475 | 'linux-headers-server', | ||
228 | 476 | 'linux-headers-virtual', | ||
229 | 477 | 'linux-image', | ||
230 | 478 | 'linux-image-extra-virtual', | ||
231 | 479 | 'linux-image-generic', | ||
232 | 480 | 'linux-image-generic-lpae', | ||
233 | 481 | 'linux-image-lowlatency', | ||
234 | 482 | 'linux-image-virtual', | ||
235 | 483 | 'linux-lowlatency', | ||
236 | 484 | 'linux-signed-generic', | ||
237 | 485 | 'linux-signed-image-generic', | ||
238 | 486 | 'linux-signed-image-lowlatency', | ||
239 | 487 | 'linux-signed-lowlatency', | ||
240 | 488 | 'linux-source', | ||
241 | 489 | 'linux-tools-generic', | ||
242 | 490 | 'linux-tools-generic-lpae', | ||
243 | 491 | 'linux-tools-lowlatency', | ||
244 | 492 | 'linux-tools-virtual', | ||
245 | 493 | 'linux-virtual'] | ||
246 | 494 | |||
247 | 495 | def _make_groups(self, cache, pkgs, eventloop_callback, to_remove=False, sensitive=True): | ||
248 | 496 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
249 | 429 | if not pkgs: | 497 | if not pkgs: |
250 | 430 | return [] | 498 | return [] |
251 | 431 | ungrouped_pkgs = [] | 499 | ungrouped_pkgs = [] |
252 | @@ -435,9 +503,13 @@ class UpdateList: | |||
253 | 435 | for pkg in pkgs: | 503 | for pkg in pkgs: |
254 | 436 | app = self._get_application_for_package(pkg) | 504 | app = self._get_application_for_package(pkg) |
255 | 437 | if app is not None: | 505 | if app is not None: |
256 | 506 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
257 | 438 | app_group = UpdateApplicationGroup( | 507 | app_group = UpdateApplicationGroup( |
258 | 439 | pkg, app, to_remove, sensitive | 508 | pkg, app, to_remove, sensitive |
259 | 440 | ) | 509 | ) |
260 | 510 | ======= | ||
261 | 511 | app_group = UpdateApplicationGroup(pkg, app, to_remove, sensitive) | ||
262 | 512 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
263 | 441 | app_groups.append(app_group) | 513 | app_groups.append(app_group) |
264 | 442 | else: | 514 | else: |
265 | 443 | ungrouped_pkgs.append(pkg) | 515 | ungrouped_pkgs.append(pkg) |
266 | @@ -458,6 +530,7 @@ class UpdateList: | |||
267 | 458 | if ungrouped_pkgs: | 530 | if ungrouped_pkgs: |
268 | 459 | # Separate out system base packages. If we have already found an | 531 | # Separate out system base packages. If we have already found an |
269 | 460 | # application for all updates, don't bother. | 532 | # application for all updates, don't bother. |
270 | 533 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
271 | 461 | linux_names = ( | 534 | linux_names = ( |
272 | 462 | "linux$", | 535 | "linux$", |
273 | 463 | "linux-.*-buildinfo.*", | 536 | "linux-.*-buildinfo.*", |
274 | @@ -482,6 +555,9 @@ class UpdateList: | |||
275 | 482 | ubuntu_base_group = UpdateGroup( | 555 | ubuntu_base_group = UpdateGroup( |
276 | 483 | None, None, None, to_remove, sensitive | 556 | None, None, None, to_remove, sensitive |
277 | 484 | ) | 557 | ) |
278 | 558 | ======= | ||
279 | 559 | meta_group = UpdateGroup(None, None, None, to_remove, sensitive) | ||
280 | 560 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
281 | 485 | flavor_package = utils.get_ubuntu_flavor_package(cache=cache) | 561 | flavor_package = utils.get_ubuntu_flavor_package(cache=cache) |
282 | 486 | ubuntu_base_pkgs = [ | 562 | ubuntu_base_pkgs = [ |
283 | 487 | flavor_package, | 563 | flavor_package, |
284 | @@ -502,6 +578,7 @@ class UpdateList: | |||
285 | 502 | pkg, cache, eventloop_callback | 578 | pkg, cache, eventloop_callback |
286 | 503 | ): | 579 | ): |
287 | 504 | if system_group is None: | 580 | if system_group is None: |
288 | 581 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
289 | 505 | system_group = UpdateSystemGroup( | 582 | system_group = UpdateSystemGroup( |
290 | 506 | cache, to_remove, sensitive | 583 | cache, to_remove, sensitive |
291 | 507 | ) | 584 | ) |
292 | @@ -510,6 +587,12 @@ class UpdateList: | |||
293 | 510 | pkg_groups.append( | 587 | pkg_groups.append( |
294 | 511 | UpdatePackageGroup(pkg, to_remove, sensitive) | 588 | UpdatePackageGroup(pkg, to_remove, sensitive) |
295 | 512 | ) | 589 | ) |
296 | 590 | ======= | ||
297 | 591 | system_group = UpdateSystemGroup(cache, to_remove, sensitive) | ||
298 | 592 | system_group.add(pkg) | ||
299 | 593 | else: | ||
300 | 594 | pkg_groups.append(UpdatePackageGroup(pkg, to_remove, sensitive)) | ||
301 | 595 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
302 | 513 | 596 | ||
303 | 514 | app_groups.sort(key=lambda a: a.name.lower()) | 597 | app_groups.sort(key=lambda a: a.name.lower()) |
304 | 515 | pkg_groups.sort(key=lambda a: a.name.lower()) | 598 | pkg_groups.sort(key=lambda a: a.name.lower()) |
305 | @@ -518,6 +601,7 @@ class UpdateList: | |||
306 | 518 | 601 | ||
307 | 519 | return app_groups + pkg_groups | 602 | return app_groups + pkg_groups |
308 | 520 | 603 | ||
309 | 604 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
310 | 521 | def update( | 605 | def update( |
311 | 522 | self, | 606 | self, |
312 | 523 | cache, | 607 | cache, |
313 | @@ -525,6 +609,9 @@ class UpdateList: | |||
314 | 525 | duplicate_packages=[], | 609 | duplicate_packages=[], |
315 | 526 | ua_security_packages=[], | 610 | ua_security_packages=[], |
316 | 527 | ): | 611 | ): |
317 | 612 | ======= | ||
318 | 613 | def update(self, cache, eventloop_callback=None, ua_security_packages=[]): | ||
319 | 614 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
320 | 528 | self.held_back = [] | 615 | self.held_back = [] |
321 | 529 | 616 | ||
322 | 530 | # do the upgrade | 617 | # do the upgrade |
323 | @@ -569,6 +656,36 @@ class UpdateList: | |||
324 | 569 | FakeUbuntuProPackage(package_name, version, size) | 656 | FakeUbuntuProPackage(package_name, version, size) |
325 | 570 | ) | 657 | ) |
326 | 571 | 658 | ||
327 | 659 | class FakeUbuntuProPackageCandidate: | ||
328 | 660 | def __init__(self, source_name, version, size): | ||
329 | 661 | self.source_name = source_name | ||
330 | 662 | self.summary = source_name | ||
331 | 663 | self.description = source_name | ||
332 | 664 | self.version = version | ||
333 | 665 | self.size = size | ||
334 | 666 | self.downloadable = False | ||
335 | 667 | self.record = {} | ||
336 | 668 | |||
337 | 669 | class FakeUbuntuProPackage: | ||
338 | 670 | def __init__(self, package_name, version, size): | ||
339 | 671 | self.name = package_name | ||
340 | 672 | self.candidate = FakeUbuntuProPackageCandidate(package_name, | ||
341 | 673 | version, size) | ||
342 | 674 | self.marked_install = False | ||
343 | 675 | self.marked_upgrade = False | ||
344 | 676 | self.marked_delete = False | ||
345 | 677 | self.installed_files = [] | ||
346 | 678 | |||
347 | 679 | def mark_install(self): | ||
348 | 680 | pass | ||
349 | 681 | |||
350 | 682 | def mark_delete(self): | ||
351 | 683 | pass | ||
352 | 684 | fake_ua_packages = [] | ||
353 | 685 | for (package_name, version, size) in ua_security_packages: | ||
354 | 686 | fake_ua_packages.append(FakeUbuntuProPackage(package_name, | ||
355 | 687 | version, size)) | ||
356 | 688 | |||
357 | 572 | # Find all upgradable packages | 689 | # Find all upgradable packages |
358 | 573 | for pkg in cache: | 690 | for pkg in cache: |
359 | 574 | if pkg.is_upgradable or pkg.marked_install: | 691 | if pkg.is_upgradable or pkg.marked_install: |
360 | @@ -609,15 +726,21 @@ class UpdateList: | |||
361 | 609 | and not cache.running_kernel_pkgs_regexp.match(pkg.name) | 726 | and not cache.running_kernel_pkgs_regexp.match(pkg.name) |
362 | 610 | ): | 727 | ): |
363 | 611 | kernel_autoremove_pkgs.append(pkg) | 728 | kernel_autoremove_pkgs.append(pkg) |
364 | 729 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
365 | 612 | if pkg.name in duplicate_packages: | 730 | if pkg.name in duplicate_packages: |
366 | 613 | duplicate_pkgs.append(pkg) | 731 | duplicate_pkgs.append(pkg) |
367 | 732 | ======= | ||
368 | 733 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
369 | 614 | 734 | ||
370 | 615 | # perform operations after the loop to not skip packages which | 735 | # perform operations after the loop to not skip packages which |
371 | 616 | # changed state due to the resolver | 736 | # changed state due to the resolver |
372 | 617 | for pkg in kernel_autoremove_pkgs: | 737 | for pkg in kernel_autoremove_pkgs: |
373 | 618 | pkg.mark_delete() | 738 | pkg.mark_delete() |
374 | 739 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
375 | 619 | for pkg in duplicate_pkgs: | 740 | for pkg in duplicate_pkgs: |
376 | 620 | pkg.mark_delete() | 741 | pkg.mark_delete() |
377 | 742 | ======= | ||
378 | 743 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
379 | 621 | for pkg in self.ignored_phased_updates: | 744 | for pkg in self.ignored_phased_updates: |
380 | 622 | pkg.mark_keep() | 745 | pkg.mark_keep() |
381 | 623 | 746 | ||
382 | @@ -641,6 +764,7 @@ class UpdateList: | |||
383 | 641 | cache, security_pkgs, eventloop_callback | 764 | cache, security_pkgs, eventloop_callback |
384 | 642 | ) | 765 | ) |
385 | 643 | self.kernel_autoremove_groups = self._make_groups( | 766 | self.kernel_autoremove_groups = self._make_groups( |
386 | 767 | <<<<<<< UpdateManager/Core/UpdateList.py | ||
387 | 644 | cache, kernel_autoremove_pkgs, eventloop_callback, True | 768 | cache, kernel_autoremove_pkgs, eventloop_callback, True |
388 | 645 | ) | 769 | ) |
389 | 646 | self.duplicate_groups = self._make_groups( | 770 | self.duplicate_groups = self._make_groups( |
390 | @@ -649,3 +773,8 @@ class UpdateList: | |||
391 | 649 | self.ubuntu_pro_groups = self._make_groups( | 773 | self.ubuntu_pro_groups = self._make_groups( |
392 | 650 | cache, fake_ua_packages, eventloop_callback, sensitive=False | 774 | cache, fake_ua_packages, eventloop_callback, sensitive=False |
393 | 651 | ) | 775 | ) |
394 | 776 | ======= | ||
395 | 777 | cache, kernel_autoremove_pkgs, eventloop_callback, True) | ||
396 | 778 | self.ubuntu_pro_groups = self._make_groups( | ||
397 | 779 | cache, fake_ua_packages, eventloop_callback, sensitive=False) | ||
398 | 780 | >>>>>>> UpdateManager/Core/UpdateList.py | ||
399 | diff --git a/UpdateManager/Core/utils.py b/UpdateManager/Core/utils.py | |||
400 | index 3ca01cd..de22382 100644 | |||
401 | --- a/UpdateManager/Core/utils.py | |||
402 | +++ b/UpdateManager/Core/utils.py | |||
403 | @@ -234,10 +234,15 @@ def url_downloadable(uri, debug_func=None): | |||
404 | 234 | lambda x: True | 234 | lambda x: True |
405 | 235 | debug_func("url_downloadable: %s" % uri) | 235 | debug_func("url_downloadable: %s" % uri) |
406 | 236 | (scheme, netloc, path, querry, fragment) = urlsplit(uri) | 236 | (scheme, netloc, path, querry, fragment) = urlsplit(uri) |
407 | 237 | <<<<<<< UpdateManager/Core/utils.py | ||
408 | 237 | debug_func( | 238 | debug_func( |
409 | 238 | "s='%s' n='%s' p='%s' q='%s' f='%s'" | 239 | "s='%s' n='%s' p='%s' q='%s' f='%s'" |
410 | 239 | % (scheme, netloc, path, querry, fragment) | 240 | % (scheme, netloc, path, querry, fragment) |
411 | 240 | ) | 241 | ) |
412 | 242 | ======= | ||
413 | 243 | debug_func("s='%s' n='%s' p='%s' q='%s' f='%s'" % (scheme, netloc, path, | ||
414 | 244 | querry, fragment)) | ||
415 | 245 | >>>>>>> UpdateManager/Core/utils.py | ||
416 | 241 | if scheme in ("http", "https"): | 246 | if scheme in ("http", "https"): |
417 | 242 | try: | 247 | try: |
418 | 243 | http_file = urlopen(HeadRequest(uri)) | 248 | http_file = urlopen(HeadRequest(uri)) |
419 | @@ -279,7 +284,11 @@ def init_proxy(gsettings=None): | |||
420 | 279 | SYNAPTIC_CONF_FILE = "/root/.synaptic/synaptic.conf" | 284 | SYNAPTIC_CONF_FILE = "/root/.synaptic/synaptic.conf" |
421 | 280 | proxies = {} | 285 | proxies = {} |
422 | 281 | # generic apt config wins | 286 | # generic apt config wins |
423 | 287 | <<<<<<< UpdateManager/Core/utils.py | ||
424 | 282 | if apt_pkg.config.find("Acquire::http::Proxy") != "": | 288 | if apt_pkg.config.find("Acquire::http::Proxy") != "": |
425 | 289 | ======= | ||
426 | 290 | if apt_pkg.config.find("Acquire::http::Proxy") != '': | ||
427 | 291 | >>>>>>> UpdateManager/Core/utils.py | ||
428 | 283 | proxies["http"] = apt_pkg.config.find("Acquire::http::Proxy") | 292 | proxies["http"] = apt_pkg.config.find("Acquire::http::Proxy") |
429 | 284 | # then synaptic | 293 | # then synaptic |
430 | 285 | elif os.path.exists(SYNAPTIC_CONF_FILE): | 294 | elif os.path.exists(SYNAPTIC_CONF_FILE): |
431 | @@ -291,7 +300,11 @@ def init_proxy(gsettings=None): | |||
432 | 291 | proxy_port = str(cnf.find_i("Synaptic::httpProxyPort")) | 300 | proxy_port = str(cnf.find_i("Synaptic::httpProxyPort")) |
433 | 292 | if proxy_host and proxy_port: | 301 | if proxy_host and proxy_port: |
434 | 293 | proxies["http"] = "http://%s:%s/" % (proxy_host, proxy_port) | 302 | proxies["http"] = "http://%s:%s/" % (proxy_host, proxy_port) |
435 | 303 | <<<<<<< UpdateManager/Core/utils.py | ||
436 | 294 | if apt_pkg.config.find("Acquire::https::Proxy") != "": | 304 | if apt_pkg.config.find("Acquire::https::Proxy") != "": |
437 | 305 | ======= | ||
438 | 306 | if apt_pkg.config.find("Acquire::https::Proxy") != '': | ||
439 | 307 | >>>>>>> UpdateManager/Core/utils.py | ||
440 | 295 | proxies["https"] = apt_pkg.config.find("Acquire::https::Proxy") | 308 | proxies["https"] = apt_pkg.config.find("Acquire::https::Proxy") |
441 | 296 | elif "http" in proxies: | 309 | elif "http" in proxies: |
442 | 297 | proxies["https"] = proxies["http"] | 310 | proxies["https"] = proxies["http"] |
443 | @@ -299,7 +312,11 @@ def init_proxy(gsettings=None): | |||
444 | 299 | if proxies: | 312 | if proxies: |
445 | 300 | # basic verification | 313 | # basic verification |
446 | 301 | for proxy in proxies.values(): | 314 | for proxy in proxies.values(): |
447 | 315 | <<<<<<< UpdateManager/Core/utils.py | ||
448 | 302 | if not re.match("https?://\\w+", proxy): | 316 | if not re.match("https?://\\w+", proxy): |
449 | 317 | ======= | ||
450 | 318 | if not re.match("https?://\w+", proxy): | ||
451 | 319 | >>>>>>> UpdateManager/Core/utils.py | ||
452 | 303 | print("proxy '%s' looks invalid" % proxy, file=sys.stderr) | 320 | print("proxy '%s' looks invalid" % proxy, file=sys.stderr) |
453 | 304 | return | 321 | return |
454 | 305 | proxy_support = ProxyHandler(proxies) | 322 | proxy_support = ProxyHandler(proxies) |
455 | diff --git a/UpdateManager/Dialogs.py b/UpdateManager/Dialogs.py | |||
456 | index 304609c..5f3f9af 100644 | |||
457 | --- a/UpdateManager/Dialogs.py | |||
458 | +++ b/UpdateManager/Dialogs.py | |||
459 | @@ -107,6 +107,7 @@ class InternalDialog(BuilderDialog): | |||
460 | 107 | self.connect("realize", self._on_realize) | 107 | self.connect("realize", self._on_realize) |
461 | 108 | 108 | ||
462 | 109 | def _on_realize(self, user_data): | 109 | def _on_realize(self, user_data): |
463 | 110 | self.paned.set_position(self.paned.get_allocation().height * 0.6) | ||
464 | 110 | if self.focus_button: | 111 | if self.focus_button: |
465 | 111 | self.focus_button.set_can_default(True) | 112 | self.focus_button.set_can_default(True) |
466 | 112 | self.focus_button.set_can_focus(True) | 113 | self.focus_button.set_can_focus(True) |
467 | @@ -131,7 +132,7 @@ class InternalDialog(BuilderDialog): | |||
468 | 131 | return None | 132 | return None |
469 | 132 | 133 | ||
470 | 133 | def on_settings_button_clicked(self): | 134 | def on_settings_button_clicked(self): |
472 | 134 | self.window_main.show_settings() | 135 | self.window_main.show_settings(2) |
473 | 135 | 136 | ||
474 | 136 | def set_header(self, label): | 137 | def set_header(self, label): |
475 | 137 | if label: | 138 | if label: |
476 | @@ -159,6 +160,7 @@ class InternalDialog(BuilderDialog): | |||
477 | 159 | self.set_desc(None) | 160 | self.set_desc(None) |
478 | 160 | 161 | ||
479 | 161 | if not active: | 162 | if not active: |
480 | 163 | <<<<<<< UpdateManager/Dialogs.py | ||
481 | 162 | if ( | 164 | if ( |
482 | 163 | self._is_livepatch_supported() | 165 | self._is_livepatch_supported() |
483 | 164 | and self.settings_button | 166 | and self.settings_button |
484 | @@ -171,6 +173,14 @@ class InternalDialog(BuilderDialog): | |||
485 | 171 | "secure between restarts." | 173 | "secure between restarts." |
486 | 172 | ) | 174 | ) |
487 | 173 | ) | 175 | ) |
488 | 176 | ======= | ||
489 | 177 | if self._is_livepatch_supported() and \ | ||
490 | 178 | self.settings_button and \ | ||
491 | 179 | self.settings.get_int('launch-count') >= 4: | ||
492 | 180 | self.set_desc(_("<b>Tip:</b> You can use Livepatch with " | ||
493 | 181 | "Ubuntu Pro to keep your computer more " | ||
494 | 182 | "secure between restarts.")) | ||
495 | 183 | >>>>>>> UpdateManager/Dialogs.py | ||
496 | 174 | self.settings_button.set_label(_("Settings & Pro…")) | 184 | self.settings_button.set_label(_("Settings & Pro…")) |
497 | 175 | return | 185 | return |
498 | 176 | 186 | ||
499 | @@ -236,9 +246,14 @@ class NoUpdatesDialog(InternalDialog): | |||
500 | 236 | else: | 246 | else: |
501 | 237 | self.set_header(_("The software on this computer is up to date.")) | 247 | self.set_header(_("The software on this computer is up to date.")) |
502 | 238 | self.settings_button = self.add_settings_button() | 248 | self.settings_button = self.add_settings_button() |
503 | 249 | <<<<<<< UpdateManager/Dialogs.py | ||
504 | 239 | self.focus_button = self.add_button( | 250 | self.focus_button = self.add_button( |
505 | 240 | Gtk.STOCK_OK, self.window_main.close | 251 | Gtk.STOCK_OK, self.window_main.close |
506 | 241 | ) | 252 | ) |
507 | 253 | ======= | ||
508 | 254 | self.focus_button = self.add_button(Gtk.STOCK_OK, | ||
509 | 255 | self.window_main.close) | ||
510 | 256 | >>>>>>> UpdateManager/Dialogs.py | ||
511 | 242 | self.check_livepatch_status() | 257 | self.check_livepatch_status() |
512 | 243 | 258 | ||
513 | 244 | 259 | ||
514 | @@ -326,6 +341,7 @@ class NoUpgradeForYouDialog(InternalDialog): | |||
515 | 326 | InternalDialog.__init__(self, window_main) | 341 | InternalDialog.__init__(self, window_main) |
516 | 327 | self.set_header(_("Sorry, there are no more upgrades for this system")) | 342 | self.set_header(_("Sorry, there are no more upgrades for this system")) |
517 | 328 | # Translators: this is an Ubuntu version name like "Ubuntu 12.04" | 343 | # Translators: this is an Ubuntu version name like "Ubuntu 12.04" |
518 | 344 | <<<<<<< UpdateManager/Dialogs.py | ||
519 | 329 | self.set_desc( | 345 | self.set_desc( |
520 | 330 | _( | 346 | _( |
521 | 331 | "\nThere will not be any further Ubuntu releases " | 347 | "\nThere will not be any further Ubuntu releases " |
522 | @@ -339,6 +355,17 @@ class NoUpgradeForYouDialog(InternalDialog): | |||
523 | 339 | self.focus_button = self.add_button( | 355 | self.focus_button = self.add_button( |
524 | 340 | Gtk.STOCK_OK, self.window_main.close | 356 | Gtk.STOCK_OK, self.window_main.close |
525 | 341 | ) | 357 | ) |
526 | 358 | ======= | ||
527 | 359 | self.set_desc(_("\nThere will not be any further Ubuntu releases " | ||
528 | 360 | "for this system's '%s' architecture.\n\n" | ||
529 | 361 | "Updates for Ubuntu %s will continue until " | ||
530 | 362 | "2023-04-26.\n\nIf you reinstall Ubuntu from " | ||
531 | 363 | "ubuntu.com/download, future upgrades will " | ||
532 | 364 | "be available.") % | ||
533 | 365 | (arch, meta_release.current_dist_version)) | ||
534 | 366 | self.focus_button = self.add_button(Gtk.STOCK_OK, | ||
535 | 367 | self.window_main.close) | ||
536 | 368 | >>>>>>> UpdateManager/Dialogs.py | ||
537 | 342 | 369 | ||
538 | 343 | 370 | ||
539 | 344 | class PartialUpgradeDialog(InternalDialog): | 371 | class PartialUpgradeDialog(InternalDialog): |
540 | diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py | |||
541 | index 6dcdab6..780c587 100644 | |||
542 | --- a/UpdateManager/UpdateManager.py | |||
543 | +++ b/UpdateManager/UpdateManager.py | |||
544 | @@ -35,7 +35,11 @@ warnings.filterwarnings( | |||
545 | 35 | ) | 35 | ) |
546 | 36 | 36 | ||
547 | 37 | import distro_info | 37 | import distro_info |
548 | 38 | <<<<<<< UpdateManager/UpdateManager.py | ||
549 | 38 | import fnmatch | 39 | import fnmatch |
550 | 40 | ======= | ||
551 | 41 | import json | ||
552 | 42 | >>>>>>> UpdateManager/UpdateManager.py | ||
553 | 39 | import os | 43 | import os |
554 | 40 | import subprocess | 44 | import subprocess |
555 | 41 | import sys | 45 | import sys |
556 | @@ -50,6 +54,7 @@ from dbus.mainloop.glib import DBusGMainLoop | |||
557 | 50 | DBusGMainLoop(set_as_default=True) | 54 | DBusGMainLoop(set_as_default=True) |
558 | 51 | 55 | ||
559 | 52 | from .UnitySupport import UnitySupport | 56 | from .UnitySupport import UnitySupport |
560 | 57 | <<<<<<< UpdateManager/UpdateManager.py | ||
561 | 53 | from .Dialogs import ( | 58 | from .Dialogs import ( |
562 | 54 | DistUpgradeDialog, | 59 | DistUpgradeDialog, |
563 | 55 | ErrorDialog, | 60 | ErrorDialog, |
564 | @@ -62,6 +67,18 @@ from .Dialogs import ( | |||
565 | 62 | UnsupportedDialog, | 67 | UnsupportedDialog, |
566 | 63 | UpdateErrorDialog, | 68 | UpdateErrorDialog, |
567 | 64 | ) | 69 | ) |
568 | 70 | ======= | ||
569 | 71 | from .Dialogs import (DistUpgradeDialog, | ||
570 | 72 | ErrorDialog, | ||
571 | 73 | HWEUpgradeDialog, | ||
572 | 74 | NeedRestartDialog, | ||
573 | 75 | NoUpdatesDialog, | ||
574 | 76 | NoUpgradeForYouDialog, | ||
575 | 77 | PartialUpgradeDialog, | ||
576 | 78 | StoppedUpdatesDialog, | ||
577 | 79 | UnsupportedDialog, | ||
578 | 80 | UpdateErrorDialog) | ||
579 | 81 | >>>>>>> UpdateManager/UpdateManager.py | ||
580 | 65 | from .MetaReleaseGObject import MetaRelease | 82 | from .MetaReleaseGObject import MetaRelease |
581 | 66 | from .UpdatesAvailable import UpdatesAvailable | 83 | from .UpdatesAvailable import UpdatesAvailable |
582 | 67 | from .Core.AlertWatcher import AlertWatcher | 84 | from .Core.AlertWatcher import AlertWatcher |
583 | @@ -69,7 +86,12 @@ from .Core.MyCache import MyCache | |||
584 | 69 | from .Core.roam import NetworkManagerHelper | 86 | from .Core.roam import NetworkManagerHelper |
585 | 70 | from .Core.UpdateList import UpdateList | 87 | from .Core.UpdateList import UpdateList |
586 | 71 | from .Core.utils import get_arch, get_dist | 88 | from .Core.utils import get_arch, get_dist |
587 | 89 | <<<<<<< UpdateManager/UpdateManager.py | ||
588 | 72 | from .backend import InstallBackend, get_backend | 90 | from .backend import InstallBackend, get_backend |
589 | 91 | ======= | ||
590 | 92 | from .backend import (InstallBackend, | ||
591 | 93 | get_backend) | ||
592 | 94 | >>>>>>> UpdateManager/UpdateManager.py | ||
593 | 73 | 95 | ||
594 | 74 | # file that signals if we need to reboot | 96 | # file that signals if we need to reboot |
595 | 75 | REBOOT_REQUIRED_FILE = "/var/run/reboot-required" | 97 | REBOOT_REQUIRED_FILE = "/var/run/reboot-required" |
596 | @@ -92,8 +114,11 @@ class UpdateManager(Gtk.Window): | |||
597 | 92 | self.update_list = None | 114 | self.update_list = None |
598 | 93 | self.meta_release = None | 115 | self.meta_release = None |
599 | 94 | self.hwe_replacement_packages = None | 116 | self.hwe_replacement_packages = None |
600 | 117 | <<<<<<< UpdateManager/UpdateManager.py | ||
601 | 95 | self.oem_metapackages = set() | 118 | self.oem_metapackages = set() |
602 | 96 | self.duplicate_packages = [] | 119 | self.duplicate_packages = [] |
603 | 120 | ======= | ||
604 | 121 | >>>>>>> UpdateManager/UpdateManager.py | ||
605 | 97 | self.arch = get_arch() | 122 | self.arch = get_arch() |
606 | 98 | 123 | ||
607 | 99 | # Basic GTK+ parameters | 124 | # Basic GTK+ parameters |
608 | @@ -103,9 +128,15 @@ class UpdateManager(Gtk.Window): | |||
609 | 103 | 128 | ||
610 | 104 | # Keep window at a constant size | 129 | # Keep window at a constant size |
611 | 105 | ctx = self.get_style_context() | 130 | ctx = self.get_style_context() |
612 | 131 | <<<<<<< UpdateManager/UpdateManager.py | ||
613 | 106 | self.style_changed = ctx.connect( | 132 | self.style_changed = ctx.connect( |
614 | 107 | "changed", lambda ctx: self.resize_to_standard_width() | 133 | "changed", lambda ctx: self.resize_to_standard_width() |
615 | 108 | ) | 134 | ) |
616 | 135 | ======= | ||
617 | 136 | self.style_changed = ctx.connect("changed", | ||
618 | 137 | lambda ctx: | ||
619 | 138 | self.resize_to_standard_width()) | ||
620 | 139 | >>>>>>> UpdateManager/UpdateManager.py | ||
621 | 109 | 140 | ||
622 | 110 | # Signals | 141 | # Signals |
623 | 111 | self.connect("delete-event", self._on_close) | 142 | self.connect("delete-event", self._on_close) |
624 | @@ -202,8 +233,18 @@ class UpdateManager(Gtk.Window): | |||
625 | 202 | self._start_pane(None) | 233 | self._start_pane(None) |
626 | 203 | sys.exit(0) | 234 | sys.exit(0) |
627 | 204 | 235 | ||
628 | 236 | <<<<<<< UpdateManager/UpdateManager.py | ||
629 | 205 | def show_settings(self): | 237 | def show_settings(self): |
630 | 206 | cmd = ["/usr/bin/software-properties-gtk", "--open-tab", "2"] | 238 | cmd = ["/usr/bin/software-properties-gtk", "--open-tab", "2"] |
631 | 239 | ======= | ||
632 | 240 | def show_settings(self, page_number): | ||
633 | 241 | try: | ||
634 | 242 | apt_pkg.pkgsystem_unlock() | ||
635 | 243 | except SystemError: | ||
636 | 244 | pass | ||
637 | 245 | cmd = ["/usr/bin/software-properties-gtk", | ||
638 | 246 | "--open-tab", str(page_number)] | ||
639 | 247 | >>>>>>> UpdateManager/UpdateManager.py | ||
640 | 207 | 248 | ||
641 | 208 | if "WAYLAND_DISPLAY" not in os.environ: | 249 | if "WAYLAND_DISPLAY" not in os.environ: |
642 | 209 | cmd += ["--toplevel", "%s" % self.get_window().get_xid()] | 250 | cmd += ["--toplevel", "%s" % self.get_window().get_xid()] |
643 | @@ -246,6 +287,7 @@ class UpdateManager(Gtk.Window): | |||
644 | 246 | if self.cache is None: | 287 | if self.cache is None: |
645 | 247 | return | 288 | return |
646 | 248 | 289 | ||
647 | 290 | <<<<<<< UpdateManager/UpdateManager.py | ||
648 | 249 | pane = self._make_available_pane( | 291 | pane = self._make_available_pane( |
649 | 250 | self.cache.install_count + self.cache.del_count, | 292 | self.cache.install_count + self.cache.del_count, |
650 | 251 | os.path.exists(REBOOT_REQUIRED_FILE), | 293 | os.path.exists(REBOOT_REQUIRED_FILE), |
651 | @@ -294,21 +336,38 @@ class UpdateManager(Gtk.Window): | |||
652 | 294 | cancelled_update=False, | 336 | cancelled_update=False, |
653 | 295 | error_occurred=False, | 337 | error_occurred=False, |
654 | 296 | ): | 338 | ): |
669 | 297 | self._check_hwe_support_status() | 339 | ======= |
670 | 298 | if install_count == 0: | 340 | pane = self._make_available_pane(self.cache.install_count, |
671 | 299 | # Need Restart > New Release > No Updates | 341 | os.path.exists(REBOOT_REQUIRED_FILE), |
672 | 300 | if need_reboot: | 342 | cancelled_update, error_occurred) |
673 | 301 | return NeedRestartDialog(self) | 343 | self._start_pane(pane) |
674 | 302 | dist_upgrade = self._check_meta_release() | 344 | |
675 | 303 | if dist_upgrade: | 345 | def _get_ua_security_status(self): |
676 | 304 | return dist_upgrade | 346 | self.ua_security_packages = [] |
677 | 305 | elif cancelled_update: | 347 | try: |
678 | 306 | return StoppedUpdatesDialog(self) | 348 | p = subprocess.Popen(['pro', 'security-status', '--format=json'], |
679 | 307 | elif self.hwe_replacement_packages: | 349 | stdout=subprocess.PIPE) |
680 | 308 | return HWEUpgradeDialog(self) | 350 | except OSError: |
681 | 309 | else: | 351 | pass |
668 | 310 | return NoUpdatesDialog(self, error_occurred=error_occurred) | ||
682 | 311 | else: | 352 | else: |
683 | 353 | while p.poll() is None: | ||
684 | 354 | while Gtk.events_pending(): | ||
685 | 355 | Gtk.main_iteration() | ||
686 | 356 | time.sleep(0.05) | ||
687 | 357 | s = json.load(p.stdout) | ||
688 | 358 | for package in s.get('packages', []): | ||
689 | 359 | status = package.get('status', '') | ||
690 | 360 | if status == 'pending_attach' or status == 'pending_enable': | ||
691 | 361 | name = package.get('package', '') | ||
692 | 362 | version = package.get('version', '') | ||
693 | 363 | size = package.get('download_size', 0) | ||
694 | 364 | self.ua_security_packages.append((name, version, size)) | ||
695 | 365 | |||
696 | 366 | def _make_available_pane(self, install_count, need_reboot=False, | ||
697 | 367 | cancelled_update=False, error_occurred=False): | ||
698 | 368 | >>>>>>> UpdateManager/UpdateManager.py | ||
699 | 369 | self._check_hwe_support_status() | ||
700 | 370 | if install_count != 0 or len(self.ua_security_packages) > 0: | ||
701 | 312 | header = None | 371 | header = None |
702 | 313 | desc = None | 372 | desc = None |
703 | 314 | if error_occurred: | 373 | if error_occurred: |
704 | @@ -322,6 +381,19 @@ class UpdateManager(Gtk.Window): | |||
705 | 322 | elif self.hwe_replacement_packages: | 381 | elif self.hwe_replacement_packages: |
706 | 323 | return HWEUpgradeDialog(self) | 382 | return HWEUpgradeDialog(self) |
707 | 324 | return UpdatesAvailable(self, header, desc, need_reboot) | 383 | return UpdatesAvailable(self, header, desc, need_reboot) |
708 | 384 | else: | ||
709 | 385 | # Need Restart > New Release > No Updates | ||
710 | 386 | if need_reboot: | ||
711 | 387 | return NeedRestartDialog(self) | ||
712 | 388 | dist_upgrade = self._check_meta_release() | ||
713 | 389 | if dist_upgrade: | ||
714 | 390 | return dist_upgrade | ||
715 | 391 | elif cancelled_update: | ||
716 | 392 | return StoppedUpdatesDialog(self) | ||
717 | 393 | elif self.hwe_replacement_packages: | ||
718 | 394 | return HWEUpgradeDialog(self) | ||
719 | 395 | else: | ||
720 | 396 | return NoUpdatesDialog(self, error_occurred=error_occurred) | ||
721 | 325 | 397 | ||
722 | 326 | def start_error(self, update_and_retry, header, desc): | 398 | def start_error(self, update_and_retry, header, desc): |
723 | 327 | if update_and_retry: | 399 | if update_and_retry: |
724 | @@ -360,6 +432,7 @@ class UpdateManager(Gtk.Window): | |||
725 | 360 | 432 | ||
726 | 361 | # Check for new fresh release | 433 | # Check for new fresh release |
727 | 362 | settings = Gio.Settings.new("com.ubuntu.update-manager") | 434 | settings = Gio.Settings.new("com.ubuntu.update-manager") |
728 | 435 | <<<<<<< UpdateManager/UpdateManager.py | ||
729 | 363 | if self.meta_release.new_dist and ( | 436 | if self.meta_release.new_dist and ( |
730 | 364 | self.options.check_dist_upgrades | 437 | self.options.check_dist_upgrades |
731 | 365 | or settings.get_boolean("check-dist-upgrades") | 438 | or settings.get_boolean("check-dist-upgrades") |
732 | @@ -368,6 +441,14 @@ class UpdateManager(Gtk.Window): | |||
733 | 368 | return NoUpgradeForYouDialog( | 441 | return NoUpgradeForYouDialog( |
734 | 369 | self, self.meta_release, self.arch | 442 | self, self.meta_release, self.arch |
735 | 370 | ) | 443 | ) |
736 | 444 | ======= | ||
737 | 445 | if (self.meta_release.new_dist and | ||
738 | 446 | (self.options.check_dist_upgrades or | ||
739 | 447 | settings.get_boolean("check-dist-upgrades"))): | ||
740 | 448 | if self.arch == 'i386': | ||
741 | 449 | return NoUpgradeForYouDialog(self, self.meta_release, | ||
742 | 450 | self.arch) | ||
743 | 451 | >>>>>>> UpdateManager/UpdateManager.py | ||
744 | 371 | return DistUpgradeDialog(self, self.meta_release) | 452 | return DistUpgradeDialog(self, self.meta_release) |
745 | 372 | 453 | ||
746 | 373 | return None | 454 | return None |
747 | @@ -428,22 +509,37 @@ class UpdateManager(Gtk.Window): | |||
748 | 428 | self._start_pane(PartialUpgradeDialog(self)) | 509 | self._start_pane(PartialUpgradeDialog(self)) |
749 | 429 | # we assert a clean cache | 510 | # we assert a clean cache |
750 | 430 | header = _("Software index is broken") | 511 | header = _("Software index is broken") |
751 | 512 | <<<<<<< UpdateManager/UpdateManager.py | ||
752 | 431 | desc = _( | 513 | desc = _( |
753 | 432 | "It is impossible to install or remove any software. " | 514 | "It is impossible to install or remove any software. " |
754 | 433 | 'Please use the package manager "Synaptic" or run ' | 515 | 'Please use the package manager "Synaptic" or run ' |
755 | 434 | '"sudo apt-get install -f" in a terminal to fix ' | 516 | '"sudo apt-get install -f" in a terminal to fix ' |
756 | 435 | "this issue at first." | 517 | "this issue at first." |
757 | 436 | ) | 518 | ) |
758 | 519 | ======= | ||
759 | 520 | desc = _("It is impossible to install or remove any software. " | ||
760 | 521 | "Please use the package manager \"Synaptic\" or run " | ||
761 | 522 | "\"sudo apt-get install -f\" in a terminal to fix " | ||
762 | 523 | "this issue at first.") | ||
763 | 524 | >>>>>>> UpdateManager/UpdateManager.py | ||
764 | 437 | self.start_error(False, header, desc) | 525 | self.start_error(False, header, desc) |
765 | 438 | return | 526 | return |
766 | 439 | except SystemError as e: | 527 | except SystemError as e: |
767 | 440 | header = _("Could not initialize the package information") | 528 | header = _("Could not initialize the package information") |
768 | 529 | <<<<<<< UpdateManager/UpdateManager.py | ||
769 | 441 | desc = _( | 530 | desc = _( |
770 | 442 | "An unresolvable problem occurred while " | 531 | "An unresolvable problem occurred while " |
771 | 443 | "initializing the package information.\n\n" | 532 | "initializing the package information.\n\n" |
772 | 444 | "Please report this bug against the 'update-manager' " | 533 | "Please report this bug against the 'update-manager' " |
773 | 445 | "package and include the following error message:\n" | 534 | "package and include the following error message:\n" |
774 | 446 | ) + str(e) | 535 | ) + str(e) |
775 | 536 | ======= | ||
776 | 537 | desc = _("An unresolvable problem occurred while " | ||
777 | 538 | "initializing the package information.\n\n" | ||
778 | 539 | "Please report this bug against the 'update-manager' " | ||
779 | 540 | "package and include the following error " | ||
780 | 541 | "message:\n") + str(e) | ||
781 | 542 | >>>>>>> UpdateManager/UpdateManager.py | ||
782 | 447 | self.start_error(False, header, desc) | 543 | self.start_error(False, header, desc) |
783 | 448 | return | 544 | return |
784 | 449 | 545 | ||
785 | @@ -454,6 +550,7 @@ class UpdateManager(Gtk.Window): | |||
786 | 454 | 550 | ||
787 | 455 | iterate() | 551 | iterate() |
788 | 456 | 552 | ||
789 | 553 | <<<<<<< UpdateManager/UpdateManager.py | ||
790 | 457 | self._check_oem_metapackages() | 554 | self._check_oem_metapackages() |
791 | 458 | 555 | ||
792 | 459 | self._get_ua_security_status() | 556 | self._get_ua_security_status() |
793 | @@ -473,6 +570,15 @@ class UpdateManager(Gtk.Window): | |||
794 | 473 | duplicate_packages=self.duplicate_packages, | 570 | duplicate_packages=self.duplicate_packages, |
795 | 474 | ua_security_packages=self.ua_security_packages, | 571 | ua_security_packages=self.ua_security_packages, |
796 | 475 | ) | 572 | ) |
797 | 573 | ======= | ||
798 | 574 | self._get_ua_security_status() | ||
799 | 575 | |||
800 | 576 | self.update_list = UpdateList(self) | ||
801 | 577 | try: | ||
802 | 578 | self.update_list.update(self.cache, eventloop_callback=iterate, | ||
803 | 579 | ua_security_packages=self. | ||
804 | 580 | ua_security_packages) | ||
805 | 581 | >>>>>>> UpdateManager/UpdateManager.py | ||
806 | 476 | except SystemError as e: | 582 | except SystemError as e: |
807 | 477 | header = _("Could not calculate the upgrade") | 583 | header = _("Could not calculate the upgrade") |
808 | 478 | desc = _( | 584 | desc = _( |
809 | diff --git a/UpdateManager/UpdateManagerVersion.py b/UpdateManager/UpdateManagerVersion.py | |||
810 | index 09c2fb6..2b23708 100644 | |||
811 | --- a/UpdateManager/UpdateManagerVersion.py | |||
812 | +++ b/UpdateManager/UpdateManagerVersion.py | |||
813 | @@ -1,3 +1,7 @@ | |||
814 | 1 | <<<<<<< UpdateManager/UpdateManagerVersion.py | ||
815 | 1 | # This file isn't used except in local checkouts, but one like it is written | 2 | # This file isn't used except in local checkouts, but one like it is written |
816 | 2 | # out in the build directory by setup.py | 3 | # out in the build directory by setup.py |
817 | 3 | VERSION = "bzr" | 4 | VERSION = "bzr" |
818 | 5 | ======= | ||
819 | 6 | VERSION = '1:18.04.11.17' | ||
820 | 7 | >>>>>>> UpdateManager/UpdateManagerVersion.py | ||
821 | diff --git a/UpdateManager/UpdatesAvailable.py b/UpdateManager/UpdatesAvailable.py | |||
822 | index e081e1f..6c16802 100644 | |||
823 | --- a/UpdateManager/UpdatesAvailable.py | |||
824 | +++ b/UpdateManager/UpdatesAvailable.py | |||
825 | @@ -75,6 +75,7 @@ from .UnitySupport import UnitySupport | |||
826 | 75 | # - screen reader does not say "Downloaded" for downloaded updates | 75 | # - screen reader does not say "Downloaded" for downloaded updates |
827 | 76 | 76 | ||
828 | 77 | # list constants | 77 | # list constants |
829 | 78 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
830 | 78 | ( | 79 | ( |
831 | 79 | LIST_NAME, | 80 | LIST_NAME, |
832 | 80 | LIST_UPDATE_DATA, | 81 | LIST_UPDATE_DATA, |
833 | @@ -82,6 +83,10 @@ from .UnitySupport import UnitySupport | |||
834 | 82 | LIST_TOGGLE_ACTIVE, | 83 | LIST_TOGGLE_ACTIVE, |
835 | 83 | LIST_SENSITIVE, | 84 | LIST_SENSITIVE, |
836 | 84 | ) = range(5) | 85 | ) = range(5) |
837 | 86 | ======= | ||
838 | 87 | (LIST_NAME, LIST_UPDATE_DATA, LIST_SIZE, LIST_TOGGLE_ACTIVE, | ||
839 | 88 | LIST_SENSITIVE) = range(5) | ||
840 | 89 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
841 | 85 | 90 | ||
842 | 86 | # NetworkManager enums | 91 | # NetworkManager enums |
843 | 87 | from .Core.roam import NetworkManagerHelper | 92 | from .Core.roam import NetworkManagerHelper |
844 | @@ -256,20 +261,32 @@ class UpdatesAvailable(InternalDialog): | |||
845 | 256 | # self.button_help.set_sensitive(False) | 261 | # self.button_help.set_sensitive(False) |
846 | 257 | 262 | ||
847 | 258 | self.add_settings_button() | 263 | self.add_settings_button() |
848 | 264 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
849 | 259 | self.button_close = self.add_button( | 265 | self.button_close = self.add_button( |
850 | 260 | Gtk.STOCK_CANCEL, self.window_main.close | 266 | Gtk.STOCK_CANCEL, self.window_main.close |
851 | 261 | ) | 267 | ) |
852 | 262 | self.button_install = self.add_button( | 268 | self.button_install = self.add_button( |
853 | 263 | _("Install Now"), self.on_button_install_clicked | 269 | _("Install Now"), self.on_button_install_clicked |
854 | 264 | ) | 270 | ) |
855 | 271 | ======= | ||
856 | 272 | self.button_close = self.add_button(Gtk.STOCK_CANCEL, | ||
857 | 273 | self.window_main.close) | ||
858 | 274 | self.button_pro = self.add_button(_("Enable Ubuntu Pro..."), | ||
859 | 275 | self.on_button_pro_clicked) | ||
860 | 276 | self.button_install = self.add_button(_("Install Now"), | ||
861 | 277 | self.on_button_install_clicked) | ||
862 | 278 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
863 | 265 | self.focus_button = self.button_install | 279 | self.focus_button = self.button_install |
864 | 266 | 280 | ||
865 | 267 | # create text view | 281 | # create text view |
866 | 268 | self.textview_changes = ChangelogViewer() | 282 | self.textview_changes = ChangelogViewer() |
867 | 283 | self.textview_changes.set_wrap_mode(Gtk.WrapMode.WORD) | ||
868 | 269 | self.textview_changes.show() | 284 | self.textview_changes.show() |
869 | 270 | self.scrolledwindow_changes.add(self.textview_changes) | 285 | self.scrolledwindow_changes.add(self.textview_changes) |
870 | 271 | changes_buffer = self.textview_changes.get_buffer() | 286 | changes_buffer = self.textview_changes.get_buffer() |
871 | 272 | changes_buffer.create_tag("versiontag", weight=Pango.Weight.BOLD) | 287 | changes_buffer.create_tag("versiontag", weight=Pango.Weight.BOLD) |
872 | 288 | changes_buffer.create_tag("changestag", weight=Pango.Weight.BOLD) | ||
873 | 289 | changes_buffer.create_tag("descriptiontag", weight=Pango.Weight.BOLD) | ||
874 | 273 | 290 | ||
875 | 274 | # the treeview (move into it's own code!) | 291 | # the treeview (move into it's own code!) |
876 | 275 | self.store = Gtk.TreeStore(str, GObject.TYPE_PYOBJECT, str, bool, bool) | 292 | self.store = Gtk.TreeStore(str, GObject.TYPE_PYOBJECT, str, bool, bool) |
877 | @@ -304,6 +321,7 @@ class UpdatesAvailable(InternalDialog): | |||
878 | 304 | pkg_toggle_renderer.set_property("ypad", 2) | 321 | pkg_toggle_renderer.set_property("ypad", 2) |
879 | 305 | pkg_toggle_renderer.connect("toggled", self.on_update_toggled) | 322 | pkg_toggle_renderer.connect("toggled", self.on_update_toggled) |
880 | 306 | pkg_column.pack_start(pkg_toggle_renderer, False) | 323 | pkg_column.pack_start(pkg_toggle_renderer, False) |
881 | 324 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
882 | 307 | pkg_column.add_attribute( | 325 | pkg_column.add_attribute( |
883 | 308 | pkg_toggle_renderer, "active", LIST_TOGGLE_ACTIVE | 326 | pkg_toggle_renderer, "active", LIST_TOGGLE_ACTIVE |
884 | 309 | ) | 327 | ) |
885 | @@ -313,6 +331,14 @@ class UpdatesAvailable(InternalDialog): | |||
886 | 313 | pkg_column.set_cell_data_func( | 331 | pkg_column.set_cell_data_func( |
887 | 314 | pkg_toggle_renderer, self.pkg_toggle_renderer_data_func | 332 | pkg_toggle_renderer, self.pkg_toggle_renderer_data_func |
888 | 315 | ) | 333 | ) |
889 | 334 | ======= | ||
890 | 335 | pkg_column.add_attribute(pkg_toggle_renderer, | ||
891 | 336 | 'active', LIST_TOGGLE_ACTIVE) | ||
892 | 337 | pkg_column.add_attribute(pkg_toggle_renderer, | ||
893 | 338 | 'sensitive', LIST_SENSITIVE) | ||
894 | 339 | pkg_column.set_cell_data_func(pkg_toggle_renderer, | ||
895 | 340 | self.pkg_toggle_renderer_data_func) | ||
896 | 341 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
897 | 316 | 342 | ||
898 | 317 | pkg_icon_renderer = Gtk.CellRendererPixbuf() | 343 | pkg_icon_renderer = Gtk.CellRendererPixbuf() |
899 | 318 | pkg_icon_renderer.set_property("ypad", 2) | 344 | pkg_icon_renderer.set_property("ypad", 2) |
900 | @@ -340,7 +366,12 @@ class UpdatesAvailable(InternalDialog): | |||
901 | 340 | _("Download"), size_renderer, text=LIST_SIZE | 366 | _("Download"), size_renderer, text=LIST_SIZE |
902 | 341 | ) | 367 | ) |
903 | 342 | size_column.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE) | 368 | size_column.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE) |
904 | 369 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
905 | 343 | size_column.add_attribute(size_renderer, "sensitive", LIST_SENSITIVE) | 370 | size_column.add_attribute(size_renderer, "sensitive", LIST_SENSITIVE) |
906 | 371 | ======= | ||
907 | 372 | size_column.add_attribute(size_renderer, | ||
908 | 373 | 'sensitive', LIST_SENSITIVE) | ||
909 | 374 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
910 | 344 | self.treeview_update.append_column(size_column) | 375 | self.treeview_update.append_column(size_column) |
911 | 345 | 376 | ||
912 | 346 | self.treeview_update.set_headers_visible(True) | 377 | self.treeview_update.set_headers_visible(True) |
913 | @@ -365,10 +396,15 @@ class UpdatesAvailable(InternalDialog): | |||
914 | 365 | self.settings.get_boolean("show-details") | 396 | self.settings.get_boolean("show-details") |
915 | 366 | ) | 397 | ) |
916 | 367 | self.expander_details.connect("activate", self.pre_activate_details) | 398 | self.expander_details.connect("activate", self.pre_activate_details) |
917 | 399 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
918 | 368 | self.expander_details.connect( | 400 | self.expander_details.connect( |
919 | 369 | "notify::expanded", self.activate_details | 401 | "notify::expanded", self.activate_details |
920 | 370 | ) | 402 | ) |
921 | 371 | self.expander_desc.connect("notify::expanded", self.activate_desc) | 403 | self.expander_desc.connect("notify::expanded", self.activate_desc) |
922 | 404 | ======= | ||
923 | 405 | self.expander_details.connect("notify::expanded", | ||
924 | 406 | self.activate_details) | ||
925 | 407 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
926 | 372 | 408 | ||
927 | 373 | # If auto-updates are on, change cancel label | 409 | # If auto-updates are on, change cancel label |
928 | 374 | self.notifier_settings = Gio.Settings.new("com.ubuntu.update-notifier") | 410 | self.notifier_settings = Gio.Settings.new("com.ubuntu.update-notifier") |
929 | @@ -385,6 +421,8 @@ class UpdatesAvailable(InternalDialog): | |||
930 | 385 | "network-3g-alert", self._on_network_3g_alert | 421 | "network-3g-alert", self._on_network_3g_alert |
931 | 386 | ) | 422 | ) |
932 | 387 | 423 | ||
933 | 424 | self._get_apt_news("/var/lib/ubuntu-advantage/messages/apt-news") | ||
934 | 425 | |||
935 | 388 | def stop(self): | 426 | def stop(self): |
936 | 389 | InternalDialog.stop(self) | 427 | InternalDialog.stop(self) |
937 | 390 | self._save_state() | 428 | self._save_state() |
938 | @@ -539,8 +577,16 @@ class UpdatesAvailable(InternalDialog): | |||
939 | 539 | 577 | ||
940 | 540 | renderer.set_property("markup", markup) | 578 | renderer.set_property("markup", markup) |
941 | 541 | 579 | ||
944 | 542 | def set_changes_buffer(self, changes_buffer, text, name, srcpkg): | 580 | def set_changes_buffer(self, changes_buffer, long_desc, text, name, srcpkg): |
945 | 543 | changes_buffer.set_text("") | 581 | changes_buffer.set_text("") # Clear "downloading list of changes..." |
946 | 582 | |||
947 | 583 | # Write the technical description section | ||
948 | 584 | changes_buffer.insert_with_tags_by_name(changes_buffer.get_end_iter(), | ||
949 | 585 | "Technical description\n", | ||
950 | 586 | "descriptiontag") | ||
951 | 587 | changes_buffer.insert(changes_buffer.get_end_iter(), long_desc + "\n\n") | ||
952 | 588 | |||
953 | 589 | # Write the changes section | ||
954 | 544 | lines = text.split("\n") | 590 | lines = text.split("\n") |
955 | 545 | if len(lines) == 1: | 591 | if len(lines) == 1: |
956 | 546 | changes_buffer.set_text(text) | 592 | changes_buffer.set_text(text) |
957 | @@ -553,14 +599,24 @@ class UpdatesAvailable(InternalDialog): | |||
958 | 553 | ) | 599 | ) |
959 | 554 | # bullet_match = re.match("^.*[\*-]", line) | 600 | # bullet_match = re.match("^.*[\*-]", line) |
960 | 555 | author_match = re.match("^.*--.*<.*@.*>.*$", line) | 601 | author_match = re.match("^.*--.*<.*@.*>.*$", line) |
961 | 602 | changes_match = re.match(r'^Changes for [^ ]+ versions:$', line) | ||
962 | 556 | if version_match: | 603 | if version_match: |
963 | 557 | version = version_match.group(1) | 604 | version = version_match.group(1) |
964 | 558 | # upload_archive = version_match.group(2).strip() | 605 | # upload_archive = version_match.group(2).strip() |
965 | 559 | version_text = _("Version %s: \n") % version | 606 | version_text = _("Version %s: \n") % version |
966 | 607 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
967 | 560 | changes_buffer.insert_with_tags_by_name( | 608 | changes_buffer.insert_with_tags_by_name( |
968 | 561 | end_iter, version_text, "versiontag" | 609 | end_iter, version_text, "versiontag" |
969 | 562 | ) | 610 | ) |
970 | 563 | elif author_match: | 611 | elif author_match: |
971 | 612 | ======= | ||
972 | 613 | changes_buffer.insert_with_tags_by_name(end_iter, version_text, | ||
973 | 614 | "versiontag") | ||
974 | 615 | elif changes_match: | ||
975 | 616 | changes_buffer.insert_with_tags_by_name(end_iter, line + "\n", | ||
976 | 617 | "changestag") | ||
977 | 618 | elif (author_match): | ||
978 | 619 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
979 | 564 | pass | 620 | pass |
980 | 565 | else: | 621 | else: |
981 | 566 | changes_buffer.insert(end_iter, line + "\n") | 622 | changes_buffer.insert(end_iter, line + "\n") |
982 | @@ -590,12 +646,8 @@ class UpdatesAvailable(InternalDialog): | |||
983 | 590 | ): | 646 | ): |
984 | 591 | changes_buffer = self.textview_changes.get_buffer() | 647 | changes_buffer = self.textview_changes.get_buffer() |
985 | 592 | changes_buffer.set_text("") | 648 | changes_buffer.set_text("") |
986 | 593 | desc_buffer = self.textview_descr.get_buffer() | ||
987 | 594 | desc_buffer.set_text("") | ||
988 | 595 | self.notebook_details.set_sensitive(False) | ||
989 | 596 | return | 649 | return |
990 | 597 | long_desc = item.pkg.candidate.description | 650 | long_desc = item.pkg.candidate.description |
991 | 598 | self.notebook_details.set_sensitive(True) | ||
992 | 599 | # do some regular expression magic on the description | 651 | # do some regular expression magic on the description |
993 | 600 | # Add a newline before each bullet | 652 | # Add a newline before each bullet |
994 | 601 | p = re.compile(r"^(\s|\t)*(\*|0|-)", re.MULTILINE) | 653 | p = re.compile(r"^(\s|\t)*(\*|0|-)", re.MULTILINE) |
995 | @@ -608,9 +660,6 @@ class UpdatesAvailable(InternalDialog): | |||
996 | 608 | long_desc = p.sub("\n", long_desc) | 660 | long_desc = p.sub("\n", long_desc) |
997 | 609 | long_desc = "Package: %s\n%s" % (item.pkg.name, long_desc) | 661 | long_desc = "Package: %s\n%s" % (item.pkg.name, long_desc) |
998 | 610 | 662 | ||
999 | 611 | desc_buffer = self.textview_descr.get_buffer() | ||
1000 | 612 | desc_buffer.set_text(long_desc) | ||
1001 | 613 | |||
1002 | 614 | # now do the changelog | 663 | # now do the changelog |
1003 | 615 | name = item.pkg.name | 664 | name = item.pkg.name |
1004 | 616 | if name is None: | 665 | if name is None: |
1005 | @@ -623,7 +672,7 @@ class UpdatesAvailable(InternalDialog): | |||
1006 | 623 | if name in self.cache.all_changes: | 672 | if name in self.cache.all_changes: |
1007 | 624 | changes = self.cache.all_changes[name] | 673 | changes = self.cache.all_changes[name] |
1008 | 625 | srcpkg = self.cache[name].candidate.source_name | 674 | srcpkg = self.cache[name].candidate.source_name |
1010 | 626 | self.set_changes_buffer(changes_buffer, changes, name, srcpkg) | 675 | self.set_changes_buffer(changes_buffer, long_desc, changes, name, srcpkg) |
1011 | 627 | # if not connected, do not even attempt to get the changes | 676 | # if not connected, do not even attempt to get the changes |
1012 | 628 | elif not self.connected: | 677 | elif not self.connected: |
1013 | 629 | changes_buffer.set_text( | 678 | changes_buffer.set_text( |
1014 | @@ -674,8 +723,9 @@ class UpdatesAvailable(InternalDialog): | |||
1015 | 674 | changes += self.cache.all_news[name] | 723 | changes += self.cache.all_news[name] |
1016 | 675 | if name in self.cache.all_changes: | 724 | if name in self.cache.all_changes: |
1017 | 676 | changes += self.cache.all_changes[name] | 725 | changes += self.cache.all_changes[name] |
1020 | 677 | if changes: | 726 | |
1021 | 678 | self.set_changes_buffer(changes_buffer, changes, name, srcpkg) | 727 | if changes or long_desc: |
1022 | 728 | self.set_changes_buffer(changes_buffer, long_desc, changes, name, srcpkg) | ||
1023 | 679 | 729 | ||
1024 | 680 | def on_treeview_button_press(self, widget, event): | 730 | def on_treeview_button_press(self, widget, event): |
1025 | 681 | """ | 731 | """ |
1026 | @@ -704,6 +754,14 @@ class UpdatesAvailable(InternalDialog): | |||
1027 | 704 | menu.show() | 754 | menu.show() |
1028 | 705 | return True | 755 | return True |
1029 | 706 | 756 | ||
1030 | 757 | def _get_apt_news(self, apt_news_file): | ||
1031 | 758 | if os.access(apt_news_file, os.R_OK): | ||
1032 | 759 | with open(apt_news_file) as f: | ||
1033 | 760 | apt_news = f.read() | ||
1034 | 761 | if apt_news: | ||
1035 | 762 | self.news.get_buffer().set_text(apt_news) | ||
1036 | 763 | self.expander_news.set_visible(True) | ||
1037 | 764 | |||
1038 | 707 | # we need this for select all/unselect all | 765 | # we need this for select all/unselect all |
1039 | 708 | def _toggle_group_headers(self, new_selection_value): | 766 | def _toggle_group_headers(self, new_selection_value): |
1040 | 709 | """small helper that will set/unset the group headers""" | 767 | """small helper that will set/unset the group headers""" |
1041 | @@ -806,6 +864,7 @@ class UpdatesAvailable(InternalDialog): | |||
1042 | 806 | # self.button_install.set_sensitive(True) | 864 | # self.button_install.set_sensitive(True) |
1043 | 807 | self.button_install.set_sensitive(True) | 865 | self.button_install.set_sensitive(True) |
1044 | 808 | self.unity.set_install_menuitem_visible(True) | 866 | self.unity.set_install_menuitem_visible(True) |
1045 | 867 | self.button_pro.destroy() | ||
1046 | 809 | else: | 868 | else: |
1047 | 810 | if inst_count > 0: | 869 | if inst_count > 0: |
1048 | 811 | download_str = ngettext( | 870 | download_str = ngettext( |
1049 | @@ -815,10 +874,15 @@ class UpdatesAvailable(InternalDialog): | |||
1050 | 815 | ) | 874 | ) |
1051 | 816 | self.button_install.set_sensitive(True) | 875 | self.button_install.set_sensitive(True) |
1052 | 817 | self.unity.set_install_menuitem_visible(True) | 876 | self.unity.set_install_menuitem_visible(True) |
1053 | 877 | self.button_pro.destroy() | ||
1054 | 878 | elif self.list.ubuntu_pro_groups: | ||
1055 | 879 | download_str = _("You need to enable Ubuntu Pro to install these updates.") | ||
1056 | 880 | self.button_install.destroy() | ||
1057 | 818 | else: | 881 | else: |
1058 | 819 | download_str = _("There are no updates to install.") | 882 | download_str = _("There are no updates to install.") |
1059 | 820 | self.button_install.set_sensitive(False) | 883 | self.button_install.set_sensitive(False) |
1060 | 821 | self.unity.set_install_menuitem_visible(False) | 884 | self.unity.set_install_menuitem_visible(False) |
1061 | 885 | self.button_pro.destroy() | ||
1062 | 822 | self.image_downsize.set_sensitive(False) | 886 | self.image_downsize.set_sensitive(False) |
1063 | 823 | self.label_downsize.set_text(download_str) | 887 | self.label_downsize.set_text(download_str) |
1064 | 824 | self.hbox_downsize.show() | 888 | self.hbox_downsize.show() |
1065 | @@ -868,7 +932,6 @@ class UpdatesAvailable(InternalDialog): | |||
1066 | 868 | "to finish installing previous updates." | 932 | "to finish installing previous updates." |
1067 | 869 | ) | 933 | ) |
1068 | 870 | 934 | ||
1069 | 871 | self.notebook_details.set_sensitive(True) | ||
1070 | 872 | self.treeview_update.set_sensitive(True) | 935 | self.treeview_update.set_sensitive(True) |
1071 | 873 | self.set_header(text_header) | 936 | self.set_header(text_header) |
1072 | 874 | self.set_desc(text_desc) | 937 | self.set_desc(text_desc) |
1073 | @@ -889,8 +952,10 @@ class UpdatesAvailable(InternalDialog): | |||
1074 | 889 | self._restore_state() | 952 | self._restore_state() |
1075 | 890 | 953 | ||
1076 | 891 | def activate_desc(self, expander, data): | 954 | def activate_desc(self, expander, data): |
1079 | 892 | expanded = self.expander_desc.get_expanded() | 955 | return |
1080 | 893 | self.expander_desc.set_vexpand(expanded) | 956 | |
1081 | 957 | def on_button_pro_clicked(self): | ||
1082 | 958 | self.window_main.show_settings(6) | ||
1083 | 894 | 959 | ||
1084 | 895 | def on_button_install_clicked(self): | 960 | def on_button_install_clicked(self): |
1085 | 896 | self.unity.set_install_menuitem_visible(False) | 961 | self.unity.set_install_menuitem_visible(False) |
1086 | @@ -1099,11 +1164,15 @@ class UpdatesAvailable(InternalDialog): | |||
1087 | 1099 | UpdateData(groups, None, None), | 1164 | UpdateData(groups, None, None), |
1088 | 1100 | humanize_size(total_size), | 1165 | humanize_size(total_size), |
1089 | 1101 | True, | 1166 | True, |
1090 | 1167 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
1091 | 1102 | sensitive, | 1168 | sensitive, |
1092 | 1169 | ======= | ||
1093 | 1170 | sensitive | ||
1094 | 1171 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
1095 | 1103 | ] | 1172 | ] |
1096 | 1104 | return self.store.append(None, header_row) | 1173 | return self.store.append(None, header_row) |
1097 | 1105 | 1174 | ||
1099 | 1106 | def _add_groups(self, groups): | 1175 | def _add_groups(self, groups, parent = None): |
1100 | 1107 | # Each row contains: | 1176 | # Each row contains: |
1101 | 1108 | # row label (for screen reader), | 1177 | # row label (for screen reader), |
1102 | 1109 | # update data tuple (is_toplevel, group object, package object), | 1178 | # update data tuple (is_toplevel, group object, package object), |
1103 | @@ -1120,18 +1189,27 @@ class UpdatesAvailable(InternalDialog): | |||
1104 | 1120 | ): | 1189 | ): |
1105 | 1121 | group_is_item = group.items[0] | 1190 | group_is_item = group.items[0] |
1106 | 1122 | 1191 | ||
1107 | 1192 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
1108 | 1123 | name = group.name | 1193 | name = group.name |
1109 | 1124 | if len(group.items) > 1: | 1194 | if len(group.items) > 1: |
1110 | 1125 | name = '%s (%d)' % (group.name, len(group.items)) | 1195 | name = '%s (%d)' % (group.name, len(group.items)) |
1111 | 1126 | 1196 | ||
1112 | 1197 | ======= | ||
1113 | 1198 | if group.name == "Ubuntu base": | ||
1114 | 1199 | group.name = "System components" | ||
1115 | 1200 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
1116 | 1127 | group_row = [ | 1201 | group_row = [ |
1117 | 1128 | name, | 1202 | name, |
1118 | 1129 | UpdateData(None, group, group_is_item), | 1203 | UpdateData(None, group, group_is_item), |
1119 | 1130 | humanize_size(group.get_total_size()), | 1204 | humanize_size(group.get_total_size()), |
1120 | 1131 | True, | 1205 | True, |
1121 | 1206 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
1122 | 1132 | group.sensitive, | 1207 | group.sensitive, |
1123 | 1208 | ======= | ||
1124 | 1209 | group.sensitive | ||
1125 | 1210 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
1126 | 1133 | ] | 1211 | ] |
1128 | 1134 | group_iter = self.store.append(None, group_row) | 1212 | group_iter = self.store.append(parent, group_row) |
1129 | 1135 | 1213 | ||
1130 | 1136 | if group_is_item: | 1214 | if group_is_item: |
1131 | 1137 | continue | 1215 | continue |
1132 | @@ -1141,7 +1219,11 @@ class UpdatesAvailable(InternalDialog): | |||
1133 | 1141 | UpdateData(None, None, item), | 1219 | UpdateData(None, None, item), |
1134 | 1142 | humanize_size(getattr(item.pkg.candidate, "size", 0)), | 1220 | humanize_size(getattr(item.pkg.candidate, "size", 0)), |
1135 | 1143 | True, | 1221 | True, |
1136 | 1222 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
1137 | 1144 | group.sensitive, | 1223 | group.sensitive, |
1138 | 1224 | ======= | ||
1139 | 1225 | group.sensitive | ||
1140 | 1226 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
1141 | 1145 | ] | 1227 | ] |
1142 | 1146 | self.store.append(group_iter, item_row) | 1228 | self.store.append(group_iter, item_row) |
1143 | 1147 | 1229 | ||
1144 | @@ -1183,6 +1265,7 @@ class UpdatesAvailable(InternalDialog): | |||
1145 | 1183 | self.list.kernel_autoremove_groups, | 1265 | self.list.kernel_autoremove_groups, |
1146 | 1184 | ) | 1266 | ) |
1147 | 1185 | self._add_groups(self.list.kernel_autoremove_groups) | 1267 | self._add_groups(self.list.kernel_autoremove_groups) |
1148 | 1268 | <<<<<<< UpdateManager/UpdatesAvailable.py | ||
1149 | 1186 | if self.list.duplicate_groups: | 1269 | if self.list.duplicate_groups: |
1150 | 1187 | self._add_header( | 1270 | self._add_header( |
1151 | 1188 | _("Duplicate packages to be removed"), | 1271 | _("Duplicate packages to be removed"), |
1152 | @@ -1196,6 +1279,11 @@ class UpdatesAvailable(InternalDialog): | |||
1153 | 1196 | sensitive=False, | 1279 | sensitive=False, |
1154 | 1197 | ) | 1280 | ) |
1155 | 1198 | self._add_groups(self.list.ubuntu_pro_groups) | 1281 | self._add_groups(self.list.ubuntu_pro_groups) |
1156 | 1282 | ======= | ||
1157 | 1283 | if self.list.ubuntu_pro_groups: | ||
1158 | 1284 | header = self._add_header(_("Ubuntu Pro security updates (enable in Settings…)"), self.list.ubuntu_pro_groups, sensitive=False) | ||
1159 | 1285 | self._add_groups(self.list.ubuntu_pro_groups, header) | ||
1160 | 1286 | >>>>>>> UpdateManager/UpdatesAvailable.py | ||
1161 | 1199 | 1287 | ||
1162 | 1200 | self.treeview_update.set_model(self.store) | 1288 | self.treeview_update.set_model(self.store) |
1163 | 1201 | self.pkg_cell_area.indent_toplevel = ( | 1289 | self.pkg_cell_area.indent_toplevel = ( |
1164 | diff --git a/UpdateManager/backend/InstallBackendAptdaemon.py b/UpdateManager/backend/InstallBackendAptdaemon.py | |||
1165 | index 2959aa6..aed2548 100644 | |||
1166 | --- a/UpdateManager/backend/InstallBackendAptdaemon.py | |||
1167 | +++ b/UpdateManager/backend/InstallBackendAptdaemon.py | |||
1168 | @@ -129,9 +129,12 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog): | |||
1169 | 129 | self._expanded_size = None | 129 | self._expanded_size = None |
1170 | 130 | self.button_cancel = None | 130 | self.button_cancel = None |
1171 | 131 | self.trans_failed_msg = None | 131 | self.trans_failed_msg = None |
1172 | 132 | <<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py | ||
1173 | 132 | self.progressbar = None | 133 | self.progressbar = None |
1174 | 133 | self._active_transaction = None | 134 | self._active_transaction = None |
1175 | 134 | self._expander = None | 135 | self._expander = None |
1176 | 136 | ======= | ||
1177 | 137 | >>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py | ||
1178 | 135 | 138 | ||
1179 | 136 | def close(self): | 139 | def close(self): |
1180 | 137 | if self.button_cancel and self.button_cancel.get_sensitive(): | 140 | if self.button_cancel and self.button_cancel.get_sensitive(): |
1181 | @@ -328,6 +331,7 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog): | |||
1182 | 328 | try: | 331 | try: |
1183 | 329 | reinstall = purge = downgrade = [] | 332 | reinstall = purge = downgrade = [] |
1184 | 330 | trans = yield self.client.commit_packages( | 333 | trans = yield self.client.commit_packages( |
1185 | 334 | <<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py | ||
1186 | 331 | pkgs_install, | 335 | pkgs_install, |
1187 | 332 | reinstall, | 336 | reinstall, |
1188 | 333 | pkgs_remove, | 337 | pkgs_remove, |
1189 | @@ -347,6 +351,17 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog): | |||
1190 | 347 | error_string=None, | 351 | error_string=None, |
1191 | 348 | error_desc=None, | 352 | error_desc=None, |
1192 | 349 | ) | 353 | ) |
1193 | 354 | ======= | ||
1194 | 355 | pkgs_install, reinstall, pkgs_remove, purge, pkgs_upgrade, | ||
1195 | 356 | downgrade, defer=True) | ||
1196 | 357 | trans.connect("progress-changed", self._on_progress_changed) | ||
1197 | 358 | yield self._show_transaction(trans, self.ACTION_INSTALL, | ||
1198 | 359 | _("Installing updates…"), True) | ||
1199 | 360 | except errors.NotAuthorizedError as e: | ||
1200 | 361 | self._action_done(self.ACTION_INSTALL, | ||
1201 | 362 | authorized=False, success=False, | ||
1202 | 363 | error_string=None, error_desc=None) | ||
1203 | 364 | >>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py | ||
1204 | 350 | except errors.TransactionFailed as e: | 365 | except errors.TransactionFailed as e: |
1205 | 351 | self.trans_failed_msg = str(e) | 366 | self.trans_failed_msg = str(e) |
1206 | 352 | except dbus.DBusException as e: | 367 | except dbus.DBusException as e: |
1207 | @@ -524,6 +539,7 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog): | |||
1208 | 524 | error_desc = error_desc + "\n" + self.trans_failed_msg | 539 | error_desc = error_desc + "\n" + self.trans_failed_msg |
1209 | 525 | # tell unity to hide the progress again | 540 | # tell unity to hide the progress again |
1210 | 526 | self.unity.set_progress(-1) | 541 | self.unity.set_progress(-1) |
1211 | 542 | <<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py | ||
1212 | 527 | is_success = status == EXIT_SUCCESS | 543 | is_success = status == EXIT_SUCCESS |
1213 | 528 | try: | 544 | try: |
1214 | 529 | self._action_done( | 545 | self._action_done( |
1215 | @@ -534,10 +550,19 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog): | |||
1216 | 534 | error_desc=error_desc, | 550 | error_desc=error_desc, |
1217 | 535 | trans_failed=trans_failed, | 551 | trans_failed=trans_failed, |
1218 | 536 | ) | 552 | ) |
1219 | 553 | ======= | ||
1220 | 554 | is_success = (status == EXIT_SUCCESS) | ||
1221 | 555 | try: | ||
1222 | 556 | self._action_done(action, | ||
1223 | 557 | authorized=True, success=is_success, | ||
1224 | 558 | error_string=error_string, error_desc=error_desc, | ||
1225 | 559 | trans_failed=trans_failed) | ||
1226 | 560 | >>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py | ||
1227 | 537 | except TypeError: | 561 | except TypeError: |
1228 | 538 | # this module used to be be lazily imported and in older code | 562 | # this module used to be be lazily imported and in older code |
1229 | 539 | # trans_failed= is not accepted | 563 | # trans_failed= is not accepted |
1230 | 540 | # TODO: this workaround can be dropped in Ubuntu 20.10 | 564 | # TODO: this workaround can be dropped in Ubuntu 20.10 |
1231 | 565 | <<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py | ||
1232 | 541 | self._action_done( | 566 | self._action_done( |
1233 | 542 | action, | 567 | action, |
1234 | 543 | authorized=True, | 568 | authorized=True, |
1235 | @@ -545,6 +570,11 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog): | |||
1236 | 545 | error_string=error_string, | 570 | error_string=error_string, |
1237 | 546 | error_desc=error_desc, | 571 | error_desc=error_desc, |
1238 | 547 | ) | 572 | ) |
1239 | 573 | ======= | ||
1240 | 574 | self._action_done(action, | ||
1241 | 575 | authorized=True, success=is_success, | ||
1242 | 576 | error_string=error_string, error_desc=error_desc) | ||
1243 | 577 | >>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py | ||
1244 | 548 | 578 | ||
1245 | 549 | 579 | ||
1246 | 550 | if __name__ == "__main__": | 580 | if __name__ == "__main__": |
1247 | diff --git a/UpdateManager/backend/__init__.py b/UpdateManager/backend/__init__.py | |||
1248 | index 72a6031..9c669e6 100644 | |||
1249 | --- a/UpdateManager/backend/__init__.py | |||
1250 | +++ b/UpdateManager/backend/__init__.py | |||
1251 | @@ -11,8 +11,11 @@ gi.require_version("Snapd", "2") | |||
1252 | 11 | from gi.repository import GLib, Gtk, Snapd | 11 | from gi.repository import GLib, Gtk, Snapd |
1253 | 12 | 12 | ||
1254 | 13 | from apt import Cache | 13 | from apt import Cache |
1255 | 14 | <<<<<<< UpdateManager/backend/__init__.py | ||
1256 | 14 | import json | 15 | import json |
1257 | 15 | import logging | 16 | import logging |
1258 | 17 | ======= | ||
1259 | 18 | >>>>>>> UpdateManager/backend/__init__.py | ||
1260 | 16 | import os | 19 | import os |
1261 | 17 | import re | 20 | import re |
1262 | 18 | import subprocess | 21 | import subprocess |
1263 | @@ -65,14 +68,20 @@ class InstallBackend(Dialog): | |||
1264 | 65 | fresh_cache = Cache(rootdir=self.window_main.cache.rootdir) | 68 | fresh_cache = Cache(rootdir=self.window_main.cache.rootdir) |
1265 | 66 | for pkg in self.window_main.cache: | 69 | for pkg in self.window_main.cache: |
1266 | 67 | try: | 70 | try: |
1267 | 71 | <<<<<<< UpdateManager/backend/__init__.py | ||
1268 | 68 | if ( | 72 | if ( |
1269 | 69 | pkg.marked_install | 73 | pkg.marked_install |
1270 | 70 | and not fresh_cache[pkg.name].is_installed | 74 | and not fresh_cache[pkg.name].is_installed |
1271 | 71 | ): | 75 | ): |
1272 | 76 | ======= | ||
1273 | 77 | if pkg.marked_install and \ | ||
1274 | 78 | not fresh_cache[pkg.name].is_installed: | ||
1275 | 79 | >>>>>>> UpdateManager/backend/__init__.py | ||
1276 | 72 | pkgname = pkg.name | 80 | pkgname = pkg.name |
1277 | 73 | if pkg.is_auto_installed: | 81 | if pkg.is_auto_installed: |
1278 | 74 | pkgname += "#auto" | 82 | pkgname += "#auto" |
1279 | 75 | pkgs_install.append(pkgname) | 83 | pkgs_install.append(pkgname) |
1280 | 84 | <<<<<<< UpdateManager/backend/__init__.py | ||
1281 | 76 | elif ( | 85 | elif ( |
1282 | 77 | pkg.marked_upgrade | 86 | pkg.marked_upgrade |
1283 | 78 | and fresh_cache[pkg.name].is_upgradable | 87 | and fresh_cache[pkg.name].is_upgradable |
1284 | @@ -82,6 +91,13 @@ class InstallBackend(Dialog): | |||
1285 | 82 | pkg.marked_delete | 91 | pkg.marked_delete |
1286 | 83 | and fresh_cache[pkg.name].is_installed | 92 | and fresh_cache[pkg.name].is_installed |
1287 | 84 | ): | 93 | ): |
1288 | 94 | ======= | ||
1289 | 95 | elif (pkg.marked_upgrade and | ||
1290 | 96 | fresh_cache[pkg.name].is_upgradable): | ||
1291 | 97 | pkgs_upgrade.append(pkg.name) | ||
1292 | 98 | elif (pkg.marked_delete and | ||
1293 | 99 | fresh_cache[pkg.name].is_installed): | ||
1294 | 100 | >>>>>>> UpdateManager/backend/__init__.py | ||
1295 | 85 | pkgs_remove.append(pkg.name) | 101 | pkgs_remove.append(pkg.name) |
1296 | 86 | except KeyError: | 102 | except KeyError: |
1297 | 87 | # pkg missing from fresh_cache can't be modified | 103 | # pkg missing from fresh_cache can't be modified |
1298 | @@ -247,6 +263,7 @@ class InstallBackend(Dialog): | |||
1299 | 247 | plug = conn_cols[1] | 263 | plug = conn_cols[1] |
1300 | 248 | slot = conn_cols[2] | 264 | slot = conn_cols[2] |
1301 | 249 | 265 | ||
1302 | 266 | <<<<<<< UpdateManager/backend/__init__.py | ||
1303 | 250 | if slot.startswith(snap + ":"): | 267 | if slot.startswith(snap + ":"): |
1304 | 251 | plug_snap = plug.split(":")[0] | 268 | plug_snap = plug.split(":")[0] |
1305 | 252 | if ( | 269 | if ( |
1306 | @@ -373,6 +390,10 @@ class InstallBackend(Dialog): | |||
1307 | 373 | error_desc, | 390 | error_desc, |
1308 | 374 | trans_failed=False, | 391 | trans_failed=False, |
1309 | 375 | ): | 392 | ): |
1310 | 393 | ======= | ||
1311 | 394 | def _action_done(self, action, authorized, success, error_string, | ||
1312 | 395 | error_desc, trans_failed=False): | ||
1313 | 396 | >>>>>>> UpdateManager/backend/__init__.py | ||
1314 | 376 | 397 | ||
1315 | 377 | # If the progress dialog should be closed automatically afterwards | 398 | # If the progress dialog should be closed automatically afterwards |
1316 | 378 | # settings = Gio.Settings.new("com.ubuntu.update-manager") | 399 | # settings = Gio.Settings.new("com.ubuntu.update-manager") |
1317 | @@ -395,9 +416,14 @@ class InstallBackend(Dialog): | |||
1318 | 395 | elif success: | 416 | elif success: |
1319 | 396 | self.window_main.start_available() | 417 | self.window_main.start_available() |
1320 | 397 | elif error_string: | 418 | elif error_string: |
1321 | 419 | <<<<<<< UpdateManager/backend/__init__.py | ||
1322 | 398 | self.window_main.start_error( | 420 | self.window_main.start_error( |
1323 | 399 | trans_failed, error_string, error_desc | 421 | trans_failed, error_string, error_desc |
1324 | 400 | ) | 422 | ) |
1325 | 423 | ======= | ||
1326 | 424 | self.window_main.start_error(trans_failed, error_string, | ||
1327 | 425 | error_desc) | ||
1328 | 426 | >>>>>>> UpdateManager/backend/__init__.py | ||
1329 | 401 | else: | 427 | else: |
1330 | 402 | # exit gracefuly, we can't just exit as this will trigger | 428 | # exit gracefuly, we can't just exit as this will trigger |
1331 | 403 | # a crash if system.exit() is called in a exception handler | 429 | # a crash if system.exit() is called in a exception handler |
1332 | @@ -418,14 +444,20 @@ class InstallBackend(Dialog): | |||
1333 | 418 | 444 | ||
1334 | 419 | 445 | ||
1335 | 420 | # try aptdaemon | 446 | # try aptdaemon |
1336 | 447 | <<<<<<< UpdateManager/backend/__init__.py | ||
1337 | 421 | if ( | 448 | if ( |
1338 | 422 | os.path.exists("/usr/sbin/aptd") | 449 | os.path.exists("/usr/sbin/aptd") |
1339 | 423 | and "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" not in os.environ | 450 | and "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" not in os.environ |
1340 | 424 | ): | 451 | ): |
1341 | 452 | ======= | ||
1342 | 453 | if os.path.exists("/usr/sbin/aptd") \ | ||
1343 | 454 | and "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" not in os.environ: | ||
1344 | 455 | >>>>>>> UpdateManager/backend/__init__.py | ||
1345 | 425 | # check if the gtkwidgets are installed as well | 456 | # check if the gtkwidgets are installed as well |
1346 | 426 | try: | 457 | try: |
1347 | 427 | from .InstallBackendAptdaemon import InstallBackendAptdaemon | 458 | from .InstallBackendAptdaemon import InstallBackendAptdaemon |
1348 | 428 | except ImportError: | 459 | except ImportError: |
1349 | 460 | <<<<<<< UpdateManager/backend/__init__.py | ||
1350 | 429 | logging.exception("importing aptdaemon") | 461 | logging.exception("importing aptdaemon") |
1351 | 430 | # try synaptic | 462 | # try synaptic |
1352 | 431 | if ( | 463 | if ( |
1353 | @@ -435,6 +467,17 @@ if ( | |||
1354 | 435 | try: | 467 | try: |
1355 | 436 | from .InstallBackendSynaptic import InstallBackendSynaptic | 468 | from .InstallBackendSynaptic import InstallBackendSynaptic |
1356 | 437 | except ImportError: | 469 | except ImportError: |
1357 | 470 | ======= | ||
1358 | 471 | import logging | ||
1359 | 472 | logging.exception("importing aptdaemon") | ||
1360 | 473 | # try synaptic | ||
1361 | 474 | if os.path.exists("/usr/sbin/synaptic") \ | ||
1362 | 475 | and "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ: | ||
1363 | 476 | try: | ||
1364 | 477 | from .InstallBackendSynaptic import InstallBackendSynaptic | ||
1365 | 478 | except ImportError: | ||
1366 | 479 | import logging | ||
1367 | 480 | >>>>>>> UpdateManager/backend/__init__.py | ||
1368 | 438 | logging.exception("importing synaptic") | 481 | logging.exception("importing synaptic") |
1369 | 439 | 482 | ||
1370 | 440 | 483 | ||
1371 | @@ -449,18 +492,31 @@ def get_backend(*args, **kwargs): | |||
1372 | 449 | try: | 492 | try: |
1373 | 450 | return InstallBackendAptdaemon(*args, **kwargs) | 493 | return InstallBackendAptdaemon(*args, **kwargs) |
1374 | 451 | except NameError: | 494 | except NameError: |
1375 | 495 | <<<<<<< UpdateManager/backend/__init__.py | ||
1376 | 452 | logging.exception("using aptdaemon failed") | 496 | logging.exception("using aptdaemon failed") |
1377 | 453 | # try synaptic | 497 | # try synaptic |
1378 | 454 | if ( | 498 | if ( |
1379 | 455 | os.path.exists("/usr/sbin/synaptic") | 499 | os.path.exists("/usr/sbin/synaptic") |
1380 | 456 | and "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ | 500 | and "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ |
1381 | 457 | ): | 501 | ): |
1382 | 502 | ======= | ||
1383 | 503 | import logging | ||
1384 | 504 | logging.exception("using aptdaemon failed") | ||
1385 | 505 | # try synaptic | ||
1386 | 506 | if (os.path.exists("/usr/sbin/synaptic") | ||
1387 | 507 | and "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ): | ||
1388 | 508 | >>>>>>> UpdateManager/backend/__init__.py | ||
1389 | 458 | try: | 509 | try: |
1390 | 459 | return InstallBackendSynaptic(*args, **kwargs) | 510 | return InstallBackendSynaptic(*args, **kwargs) |
1391 | 460 | except NameError: | 511 | except NameError: |
1392 | 461 | pass | 512 | pass |
1393 | 462 | # nothing found, raise | 513 | # nothing found, raise |
1394 | 514 | <<<<<<< UpdateManager/backend/__init__.py | ||
1395 | 463 | raise Exception( | 515 | raise Exception( |
1396 | 464 | "No working backend found, please try installing " | 516 | "No working backend found, please try installing " |
1397 | 465 | "aptdaemon or synaptic" | 517 | "aptdaemon or synaptic" |
1398 | 466 | ) | 518 | ) |
1399 | 519 | ======= | ||
1400 | 520 | raise Exception("No working backend found, please try installing " | ||
1401 | 521 | "aptdaemon or synaptic") | ||
1402 | 522 | >>>>>>> UpdateManager/backend/__init__.py | ||
1403 | diff --git a/data/gtkbuilder/UpdateManager.ui b/data/gtkbuilder/UpdateManager.ui | |||
1404 | index d38eeaf..e7b9dee 100644 | |||
1405 | --- a/data/gtkbuilder/UpdateManager.ui | |||
1406 | +++ b/data/gtkbuilder/UpdateManager.ui | |||
1407 | @@ -6,17 +6,47 @@ | |||
1408 | 6 | <property name="can_focus">False</property> | 6 | <property name="can_focus">False</property> |
1409 | 7 | <property name="spacing">12</property> | 7 | <property name="spacing">12</property> |
1410 | 8 | <child> | 8 | <child> |
1411 | 9 | <object class="GtkExpander" id="expander_news"> | ||
1412 | 10 | <property name="visible">False</property> | ||
1413 | 11 | <property name="can_focus">True</property> | ||
1414 | 12 | <property name="label">News</property> | ||
1415 | 13 | <property name="spacing">6</property> | ||
1416 | 14 | <child> | ||
1417 | 15 | <object class="GtkScrolledWindow"> | ||
1418 | 16 | <property name="visible">True</property> | ||
1419 | 17 | <property name="can_focus">True</property> | ||
1420 | 18 | <property name="shadow_type">in</property> | ||
1421 | 19 | <property name="min_content_height">80</property> | ||
1422 | 20 | <child> | ||
1423 | 21 | <object class="GtkTextView" id="news"> | ||
1424 | 22 | <property name="visible">True</property> | ||
1425 | 23 | <property name="editable">False</property> | ||
1426 | 24 | <property name="pixels_above_lines">6</property> | ||
1427 | 25 | <property name="left_margin">6</property> | ||
1428 | 26 | <property name="right_margin">6</property> | ||
1429 | 27 | <property name="wrap_mode">word</property> | ||
1430 | 28 | <property name="cursor_visible">False</property> | ||
1431 | 29 | <property name="accepts_tab">False</property> | ||
1432 | 30 | </object> | ||
1433 | 31 | </child> | ||
1434 | 32 | </object> | ||
1435 | 33 | </child> | ||
1436 | 34 | </object> | ||
1437 | 35 | <packing> | ||
1438 | 36 | <property name="expand">False</property> | ||
1439 | 37 | <property name="position">0</property> | ||
1440 | 38 | </packing> | ||
1441 | 39 | </child> | ||
1442 | 40 | <child> | ||
1443 | 9 | <object class="GtkExpander" id="expander_details"> | 41 | <object class="GtkExpander" id="expander_details"> |
1444 | 10 | <property name="visible">True</property> | 42 | <property name="visible">True</property> |
1445 | 11 | <property name="can_focus">True</property> | 43 | <property name="can_focus">True</property> |
1446 | 12 | <property name="spacing">6</property> | 44 | <property name="spacing">6</property> |
1447 | 13 | <property name="resize_toplevel">True</property> | 45 | <property name="resize_toplevel">True</property> |
1448 | 14 | <child> | 46 | <child> |
1450 | 15 | <object class="GtkVBox" id="vbox4"> | 47 | <object class="GtkPaned" id="paned"> |
1451 | 16 | <property name="visible">True</property> | 48 | <property name="visible">True</property> |
1455 | 17 | <property name="can_focus">False</property> | 49 | <property name="orientation">vertical</property> |
1453 | 18 | <property name="vexpand">True</property> | ||
1454 | 19 | <property name="spacing">6</property> | ||
1456 | 20 | <child> | 50 | <child> |
1457 | 21 | <object class="GtkScrolledWindow" id="scrolledwindow_update"> | 51 | <object class="GtkScrolledWindow" id="scrolledwindow_update"> |
1458 | 22 | <property name="visible">True</property> | 52 | <property name="visible">True</property> |
1459 | @@ -44,113 +74,21 @@ | |||
1460 | 44 | </child> | 74 | </child> |
1461 | 45 | </object> | 75 | </object> |
1462 | 46 | <packing> | 76 | <packing> |
1466 | 47 | <property name="expand">True</property> | 77 | <property name="shrink">False</property> |
1467 | 48 | <property name="fill">True</property> | 78 | <property name="resize">True</property> |
1465 | 49 | <property name="position">0</property> | ||
1468 | 50 | </packing> | 79 | </packing> |
1469 | 51 | </child> | 80 | </child> |
1470 | 52 | <child> | 81 | <child> |
1472 | 53 | <object class="GtkExpander" id="expander_desc"> | 82 | <object class="GtkScrolledWindow" id="scrolledwindow_changes"> |
1473 | 54 | <property name="visible">True</property> | 83 | <property name="visible">True</property> |
1474 | 55 | <property name="can_focus">True</property> | 84 | <property name="can_focus">True</property> |
1475 | 85 | <property name="shadow_type">in</property> | ||
1476 | 56 | <child> | 86 | <child> |
1568 | 57 | <object class="GtkNotebook" id="notebook_details"> | 87 | <placeholder/> |
1478 | 58 | <property name="visible">True</property> | ||
1479 | 59 | <property name="can_focus">True</property> | ||
1480 | 60 | <property name="show_border">False</property> | ||
1481 | 61 | <child> | ||
1482 | 62 | <object class="GtkVBox" id="vbox5"> | ||
1483 | 63 | <property name="visible">True</property> | ||
1484 | 64 | <property name="can_focus">False</property> | ||
1485 | 65 | <property name="border_width">6</property> | ||
1486 | 66 | <property name="spacing">6</property> | ||
1487 | 67 | <child> | ||
1488 | 68 | <object class="GtkScrolledWindow" id="scrolledwindow_changes"> | ||
1489 | 69 | <property name="visible">True</property> | ||
1490 | 70 | <property name="can_focus">True</property> | ||
1491 | 71 | <property name="shadow_type">in</property> | ||
1492 | 72 | <child> | ||
1493 | 73 | <placeholder/> | ||
1494 | 74 | </child> | ||
1495 | 75 | </object> | ||
1496 | 76 | <packing> | ||
1497 | 77 | <property name="expand">True</property> | ||
1498 | 78 | <property name="fill">True</property> | ||
1499 | 79 | <property name="position">0</property> | ||
1500 | 80 | </packing> | ||
1501 | 81 | </child> | ||
1502 | 82 | </object> | ||
1503 | 83 | </child> | ||
1504 | 84 | <child type="tab"> | ||
1505 | 85 | <object class="GtkLabel" id="label8"> | ||
1506 | 86 | <property name="visible">True</property> | ||
1507 | 87 | <property name="can_focus">False</property> | ||
1508 | 88 | <property name="label" translatable="yes">Changes</property> | ||
1509 | 89 | </object> | ||
1510 | 90 | <packing> | ||
1511 | 91 | <property name="tab_fill">False</property> | ||
1512 | 92 | </packing> | ||
1513 | 93 | </child> | ||
1514 | 94 | <child> | ||
1515 | 95 | <object class="GtkScrolledWindow" id="scrolledwindow3"> | ||
1516 | 96 | <property name="visible">True</property> | ||
1517 | 97 | <property name="can_focus">True</property> | ||
1518 | 98 | <property name="border_width">6</property> | ||
1519 | 99 | <property name="shadow_type">in</property> | ||
1520 | 100 | <property name="min_content_height">80</property> | ||
1521 | 101 | <child> | ||
1522 | 102 | <object class="GtkTextView" id="textview_descr"> | ||
1523 | 103 | <property name="visible">True</property> | ||
1524 | 104 | <property name="can_focus">True</property> | ||
1525 | 105 | <property name="pixels_above_lines">6</property> | ||
1526 | 106 | <property name="editable">False</property> | ||
1527 | 107 | <property name="wrap_mode">word</property> | ||
1528 | 108 | <property name="left_margin">6</property> | ||
1529 | 109 | <property name="right_margin">6</property> | ||
1530 | 110 | <property name="cursor_visible">False</property> | ||
1531 | 111 | <property name="accepts_tab">False</property> | ||
1532 | 112 | <child internal-child="accessible"> | ||
1533 | 113 | <object class="AtkObject" id="textview_descr-atkobject"> | ||
1534 | 114 | <property name="AtkObject::accessible-name" translatable="yes">Description</property> | ||
1535 | 115 | </object> | ||
1536 | 116 | </child> | ||
1537 | 117 | </object> | ||
1538 | 118 | </child> | ||
1539 | 119 | </object> | ||
1540 | 120 | <packing> | ||
1541 | 121 | <property name="position">1</property> | ||
1542 | 122 | </packing> | ||
1543 | 123 | </child> | ||
1544 | 124 | <child type="tab"> | ||
1545 | 125 | <object class="GtkLabel" id="label9"> | ||
1546 | 126 | <property name="visible">True</property> | ||
1547 | 127 | <property name="can_focus">False</property> | ||
1548 | 128 | <property name="label" translatable="yes">Description</property> | ||
1549 | 129 | <child internal-child="accessible"> | ||
1550 | 130 | <object class="AtkObject" id="label9-atkobject"> | ||
1551 | 131 | <property name="AtkObject::accessible-name" translatable="yes">Description</property> | ||
1552 | 132 | </object> | ||
1553 | 133 | </child> | ||
1554 | 134 | </object> | ||
1555 | 135 | <packing> | ||
1556 | 136 | <property name="position">1</property> | ||
1557 | 137 | <property name="tab_fill">False</property> | ||
1558 | 138 | </packing> | ||
1559 | 139 | </child> | ||
1560 | 140 | </object> | ||
1561 | 141 | </child> | ||
1562 | 142 | <child type="label"> | ||
1563 | 143 | <object class="GtkLabel" id="label13"> | ||
1564 | 144 | <property name="visible">True</property> | ||
1565 | 145 | <property name="can_focus">False</property> | ||
1566 | 146 | <property name="label" translatable="yes">Technical description</property> | ||
1567 | 147 | </object> | ||
1569 | 148 | </child> | 88 | </child> |
1570 | 149 | </object> | 89 | </object> |
1571 | 150 | <packing> | 90 | <packing> |
1575 | 151 | <property name="expand">False</property> | 91 | <property name="resize">True</property> |
1573 | 152 | <property name="fill">True</property> | ||
1574 | 153 | <property name="position">1</property> | ||
1576 | 154 | </packing> | 92 | </packing> |
1577 | 155 | </child> | 93 | </child> |
1578 | 156 | </object> | 94 | </object> |
1579 | @@ -167,7 +105,7 @@ | |||
1580 | 167 | <packing> | 105 | <packing> |
1581 | 168 | <property name="expand">True</property> | 106 | <property name="expand">True</property> |
1582 | 169 | <property name="fill">True</property> | 107 | <property name="fill">True</property> |
1584 | 170 | <property name="position">2</property> | 108 | <property name="position">1</property> |
1585 | 171 | </packing> | 109 | </packing> |
1586 | 172 | </child> | 110 | </child> |
1587 | 173 | <child> | 111 | <child> |
1588 | @@ -177,13 +115,14 @@ | |||
1589 | 177 | <child> | 115 | <child> |
1590 | 178 | <object class="GtkHBox" id="hbox_downsize"> | 116 | <object class="GtkHBox" id="hbox_downsize"> |
1591 | 179 | <property name="can_focus">False</property> | 117 | <property name="can_focus">False</property> |
1593 | 180 | <property name="spacing">12</property> | 118 | <property name="spacing">8</property> |
1594 | 181 | <child> | 119 | <child> |
1595 | 182 | <object class="GtkImage" id="image_downsize"> | 120 | <object class="GtkImage" id="image_downsize"> |
1596 | 183 | <property name="visible">True</property> | 121 | <property name="visible">True</property> |
1597 | 184 | <property name="can_focus">False</property> | 122 | <property name="can_focus">False</property> |
1598 | 185 | <property name="pixel-size">16</property> | 123 | <property name="pixel-size">16</property> |
1599 | 186 | <property name="icon_name">aptdaemon-download</property> | 124 | <property name="icon_name">aptdaemon-download</property> |
1600 | 125 | <property name="pixel_size">16</property> | ||
1601 | 187 | </object> | 126 | </object> |
1602 | 188 | <packing> | 127 | <packing> |
1603 | 189 | <property name="expand">False</property> | 128 | <property name="expand">False</property> |
1604 | @@ -401,7 +340,7 @@ | |||
1605 | 401 | <packing> | 340 | <packing> |
1606 | 402 | <property name="expand">False</property> | 341 | <property name="expand">False</property> |
1607 | 403 | <property name="fill">True</property> | 342 | <property name="fill">True</property> |
1609 | 404 | <property name="position">3</property> | 343 | <property name="position">2</property> |
1610 | 405 | </packing> | 344 | </packing> |
1611 | 406 | </child> | 345 | </child> |
1612 | 407 | </object> | 346 | </object> |
1613 | diff --git a/debian/changelog b/debian/changelog | |||
1614 | index e8e7e44..55ae22c 100644 | |||
1615 | --- a/debian/changelog | |||
1616 | +++ b/debian/changelog | |||
1617 | @@ -1,3 +1,4 @@ | |||
1618 | 1 | <<<<<<< debian/changelog | ||
1619 | 1 | update-manager (1:23.10.1) mantic; urgency=medium | 2 | update-manager (1:23.10.1) mantic; urgency=medium |
1620 | 2 | 3 | ||
1621 | 3 | * When displaying updates also include the quantity of updates in each | 4 | * When displaying updates also include the quantity of updates in each |
1622 | @@ -276,12 +277,54 @@ update-manager (1:20.04.12) groovy; urgency=medium | |||
1623 | 276 | -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Thu, 28 May 2020 10:11:51 +0100 | 277 | -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Thu, 28 May 2020 10:11:51 +0100 |
1624 | 277 | 278 | ||
1625 | 278 | update-manager (1:20.04.11) groovy; urgency=medium | 279 | update-manager (1:20.04.11) groovy; urgency=medium |
1626 | 280 | ======= | ||
1627 | 281 | update-manager (1:18.04.11.18) unreleased; urgency=medium | ||
1628 | 282 | |||
1629 | 283 | * Implement the new Ubuntu Pro design. | ||
1630 | 284 | - Fuse the description and changes tabs into a single view. | ||
1631 | 285 | - Add button to attach to enable Ubuntu Pro if it is the only action | ||
1632 | 286 | available. | ||
1633 | 287 | - Ubuntu base -> System components. | ||
1634 | 288 | - Fix Ubuntu Pro item not being a parent group of its corresponding | ||
1635 | 289 | packages. | ||
1636 | 290 | |||
1637 | 291 | -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Mon, 17 Jul 2023 15:45:42 +0200 | ||
1638 | 292 | |||
1639 | 293 | update-manager (1:18.04.11.17) bionic; urgency=medium | ||
1640 | 294 | |||
1641 | 295 | * Fix Ubuntu Pro updates checkbox and expander widget from overlapping | ||
1642 | 296 | (LP: #1990450) | ||
1643 | 297 | |||
1644 | 298 | -- Robert Ancell <robert.ancell@canonical.com> Fri, 03 Feb 2023 14:55:56 +1300 | ||
1645 | 299 | |||
1646 | 300 | update-manager (1:18.04.11.16) bionic; urgency=medium | ||
1647 | 301 | |||
1648 | 302 | * Update of the parsing for pro client changes (lp: #1990450) | ||
1649 | 303 | |||
1650 | 304 | -- Sebastien Bacher <seb128@ubuntu.com> Thu, 26 Jan 2023 12:05:05 +0100 | ||
1651 | 305 | |||
1652 | 306 | update-manager (1:18.04.11.15) bionic; urgency=medium | ||
1653 | 307 | |||
1654 | 308 | * Show pending Ubuntu pro packages (LP: #1990450) | ||
1655 | 309 | |||
1656 | 310 | -- Robert Ancell <robert.ancell@canonical.com> Wed, 18 Jan 2023 15:09:17 +1300 | ||
1657 | 311 | |||
1658 | 312 | update-manager (1:18.04.11.14) bionic; urgency=medium | ||
1659 | 313 | |||
1660 | 314 | * tests/test_meta_release_core.py: switch a test from using lucid to bionic | ||
1661 | 315 | as precise was removed from the archive. (LP: #1929865) | ||
1662 | 316 | |||
1663 | 317 | -- Brian Murray <brian@ubuntu.com> Thu, 27 May 2021 13:54:14 -0700 | ||
1664 | 318 | |||
1665 | 319 | update-manager (1:18.04.11.13) bionic; urgency=medium | ||
1666 | 320 | >>>>>>> debian/changelog | ||
1667 | 279 | 321 | ||
1668 | 280 | * UpdateManager/UpdateManager.py: when refreshing the cache and encountering | 322 | * UpdateManager/UpdateManager.py: when refreshing the cache and encountering |
1669 | 281 | an error return rather than trying to use the undefined cache which causes | 323 | an error return rather than trying to use the undefined cache which causes |
1670 | 282 | crashes. Additionally, don't present the dialog with a "Try Again" button | 324 | crashes. Additionally, don't present the dialog with a "Try Again" button |
1671 | 283 | which won't do anything. (LP: #1826213) | 325 | which won't do anything. (LP: #1826213) |
1672 | 284 | 326 | ||
1673 | 327 | <<<<<<< debian/changelog | ||
1674 | 285 | -- Brian Murray <brian@ubuntu.com> Wed, 27 May 2020 13:29:24 -0700 | 328 | -- Brian Murray <brian@ubuntu.com> Wed, 27 May 2020 13:29:24 -0700 |
1675 | 286 | 329 | ||
1676 | 287 | update-manager (1:20.04.10) focal; urgency=medium | 330 | update-manager (1:20.04.10) focal; urgency=medium |
1677 | @@ -409,11 +452,37 @@ update-manager (1:19.04.3) disco; urgency=medium | |||
1678 | 409 | -- Jeremy Bicha <jbicha@ubuntu.com> Sun, 10 Feb 2019 13:23:47 -0500 | 452 | -- Jeremy Bicha <jbicha@ubuntu.com> Sun, 10 Feb 2019 13:23:47 -0500 |
1679 | 410 | 453 | ||
1680 | 411 | update-manager (1:19.04.2) disco; urgency=medium | 454 | update-manager (1:19.04.2) disco; urgency=medium |
1681 | 455 | ======= | ||
1682 | 456 | -- Brian Murray <brian@ubuntu.com> Wed, 03 Jun 2020 11:41:50 -0700 | ||
1683 | 457 | |||
1684 | 458 | update-manager (1:18.04.11.12) bionic; urgency=medium | ||
1685 | 459 | |||
1686 | 460 | * Resolve pep8 failures. | ||
1687 | 461 | |||
1688 | 462 | -- Brian Murray <brian@ubuntu.com> Tue, 21 Apr 2020 07:27:24 -0700 | ||
1689 | 463 | |||
1690 | 464 | update-manager (1:18.04.11.11) bionic; urgency=medium | ||
1691 | 465 | |||
1692 | 466 | * UpdateManager/UpdateManager.py: Do not offer to upgrade systems running on | ||
1693 | 467 | an i386 host architecture to another release. (LP: #1845690) | ||
1694 | 468 | |||
1695 | 469 | -- Brian Murray <brian@ubuntu.com> Thu, 09 Apr 2020 13:39:04 -0700 | ||
1696 | 470 | |||
1697 | 471 | update-manager (1:18.04.11.10) bionic; urgency=medium | ||
1698 | 472 | |||
1699 | 473 | * UpdateManager/Core/utils.py: when testing to see if a url is downloadable | ||
1700 | 474 | support https in addition to http and ftp. (LP: #1823410) | ||
1701 | 475 | |||
1702 | 476 | -- Brian Murray <brian@ubuntu.com> Tue, 09 Apr 2019 16:03:46 -0700 | ||
1703 | 477 | |||
1704 | 478 | update-manager (1:18.04.11.9) bionic; urgency=medium | ||
1705 | 479 | >>>>>>> debian/changelog | ||
1706 | 412 | 480 | ||
1707 | 413 | * UpdateManager/Core/MetaRelease.py: set prompt in MetaReleaseCore so that | 481 | * UpdateManager/Core/MetaRelease.py: set prompt in MetaReleaseCore so that |
1708 | 414 | do-release-upgrade can provide more informative error messages. | 482 | do-release-upgrade can provide more informative error messages. |
1709 | 415 | (LP: #1798618, LP: #1795024) | 483 | (LP: #1798618, LP: #1795024) |
1710 | 416 | 484 | ||
1711 | 485 | <<<<<<< debian/changelog | ||
1712 | 417 | -- Brian Murray <brian@ubuntu.com> Wed, 28 Nov 2018 09:49:44 -0800 | 486 | -- Brian Murray <brian@ubuntu.com> Wed, 28 Nov 2018 09:49:44 -0800 |
1713 | 418 | 487 | ||
1714 | 419 | update-manager (1:19.04.1) disco; urgency=medium | 488 | update-manager (1:19.04.1) disco; urgency=medium |
1715 | @@ -449,6 +518,39 @@ update-manager (1:18.10.9) cosmic; urgency=medium | |||
1716 | 449 | -- Balint Reczey <rbalint@ubuntu.com> Mon, 01 Oct 2018 18:00:40 +0200 | 518 | -- Balint Reczey <rbalint@ubuntu.com> Mon, 01 Oct 2018 18:00:40 +0200 |
1717 | 450 | 519 | ||
1718 | 451 | update-manager (1:18.10.8) cosmic; urgency=medium | 520 | update-manager (1:18.10.8) cosmic; urgency=medium |
1719 | 521 | ======= | ||
1720 | 522 | -- Brian Murray <brian@ubuntu.com> Mon, 14 Jan 2019 13:40:08 -0800 | ||
1721 | 523 | |||
1722 | 524 | update-manager (1:18.04.11.8) bionic; urgency=medium | ||
1723 | 525 | |||
1724 | 526 | * Do not show the livepatch reminder if update-manager is running | ||
1725 | 527 | on a distribution without software-properties-gtk. (LP: #1805118) | ||
1726 | 528 | |||
1727 | 529 | -- Andrea Azzarone <andrea.azzarone@canonical.com> Tue, 27 Nov 2018 13:26:00 +0000 | ||
1728 | 530 | |||
1729 | 531 | update-manager (1:18.04.11.7) bionic; urgency=medium | ||
1730 | 532 | |||
1731 | 533 | * Add a reminder to enable Livepatch (LP: #1787553). | ||
1732 | 534 | * Build-Depends on python3-distro-info. | ||
1733 | 535 | |||
1734 | 536 | -- Andrea Azzarone <andrea.azzarone@canonical.com> Fri, 07 Sep 2018 10:41:28 +0200 | ||
1735 | 537 | |||
1736 | 538 | update-manager (1:18.04.11.6) bionic; urgency=medium | ||
1737 | 539 | |||
1738 | 540 | * Keep or delete packages after looping over all of them. | ||
1739 | 541 | This prevents the resolver from changing the packages in the loop resulting | ||
1740 | 542 | in not keeping some phased packages back from being upgraded. (LP: #1072136) | ||
1741 | 543 | * Stop lazy import of InstallBackends. | ||
1742 | 544 | Lazy imports made update-manager crash when an update-manager | ||
1743 | 545 | update changed the backend API and an updated incompatible backend | ||
1744 | 546 | was loaded to the not updated running update-manager process. (LP: #1795898) | ||
1745 | 547 | * Cancel transaction on exit only when Cancel button is active. | ||
1746 | 548 | Also ignore exception when cancellation fails. (LP: #1790670) | ||
1747 | 549 | |||
1748 | 550 | -- Balint Reczey <rbalint@ubuntu.com> Thu, 04 Oct 2018 21:33:57 +0200 | ||
1749 | 551 | |||
1750 | 552 | update-manager (1:18.04.11.5) bionic; urgency=medium | ||
1751 | 553 | >>>>>>> debian/changelog | ||
1752 | 452 | 554 | ||
1753 | 453 | * Print transaction error and let the user try again applying updates | 555 | * Print transaction error and let the user try again applying updates |
1754 | 454 | (LP: #1317164) | 556 | (LP: #1317164) |
1755 | @@ -460,6 +562,7 @@ update-manager (1:18.10.8) cosmic; urgency=medium | |||
1756 | 460 | a race condition where packages to be removed are already removed. | 562 | a race condition where packages to be removed are already removed. |
1757 | 461 | (LP: #1791931) | 563 | (LP: #1791931) |
1758 | 462 | 564 | ||
1759 | 565 | <<<<<<< debian/changelog | ||
1760 | 463 | -- Balint Reczey <rbalint@ubuntu.com> Tue, 11 Sep 2018 13:40:57 +0200 | 566 | -- Balint Reczey <rbalint@ubuntu.com> Tue, 11 Sep 2018 13:40:57 +0200 |
1761 | 464 | 567 | ||
1762 | 465 | update-manager (1:18.10.7) cosmic; urgency=medium | 568 | update-manager (1:18.10.7) cosmic; urgency=medium |
1763 | @@ -492,10 +595,22 @@ update-manager (1:18.10.4) cosmic; urgency=medium | |||
1764 | 492 | -- Brian Murray <brian@ubuntu.com> Fri, 31 Aug 2018 15:38:33 -0700 | 595 | -- Brian Murray <brian@ubuntu.com> Fri, 31 Aug 2018 15:38:33 -0700 |
1765 | 493 | 596 | ||
1766 | 494 | update-manager (1:18.10.3) cosmic; urgency=medium | 597 | update-manager (1:18.10.3) cosmic; urgency=medium |
1767 | 598 | ======= | ||
1768 | 599 | -- Balint Reczey <rbalint@ubuntu.com> Mon, 17 Sep 2018 17:16:38 +0200 | ||
1769 | 600 | |||
1770 | 601 | update-manager (1:18.04.11.4) bionic; urgency=medium | ||
1771 | 602 | |||
1772 | 603 | * Adjust dates in hwe-support-status for bionic (LP: #1775236) | ||
1773 | 604 | |||
1774 | 605 | -- Julian Andres Klode <juliank@ubuntu.com> Fri, 20 Jul 2018 12:26:28 +0200 | ||
1775 | 606 | |||
1776 | 607 | update-manager (1:18.04.11.3) bionic; urgency=medium | ||
1777 | 608 | >>>>>>> debian/changelog | ||
1778 | 495 | 609 | ||
1779 | 496 | * Add support for HTTPS proxies; this breaks UpdateManager.Core.utils.init_proxy() | 610 | * Add support for HTTPS proxies; this breaks UpdateManager.Core.utils.init_proxy() |
1780 | 497 | API - the return value is now a dict, rather than a string (LP: #1771914). | 611 | API - the return value is now a dict, rather than a string (LP: #1771914). |
1781 | 498 | 612 | ||
1782 | 613 | <<<<<<< debian/changelog | ||
1783 | 499 | -- Julian Andres Klode <juliank@ubuntu.com> Wed, 27 Jun 2018 14:16:45 +0200 | 614 | -- Julian Andres Klode <juliank@ubuntu.com> Wed, 27 Jun 2018 14:16:45 +0200 |
1784 | 500 | 615 | ||
1785 | 501 | update-manager (1:18.10.2) cosmic; urgency=medium | 616 | update-manager (1:18.10.2) cosmic; urgency=medium |
1786 | @@ -511,6 +626,24 @@ update-manager (1:18.10.1) cosmic; urgency=medium | |||
1787 | 511 | initial analysis of this bug. (LP: #1637180) | 626 | initial analysis of this bug. (LP: #1637180) |
1788 | 512 | 627 | ||
1789 | 513 | -- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com> Mon, 28 May 2018 10:03:52 -0400 | 628 | -- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com> Mon, 28 May 2018 10:03:52 -0400 |
1790 | 629 | ======= | ||
1791 | 630 | -- Julian Andres Klode <juliank@ubuntu.com> Fri, 29 Jun 2018 14:44:16 +0200 | ||
1792 | 631 | |||
1793 | 632 | update-manager (1:18.04.11.2) bionic; urgency=medium | ||
1794 | 633 | |||
1795 | 634 | * Fix my embarassing typo that makes update-manager report crashes, when | ||
1796 | 635 | instanciating the "reboot" dialog and mangling signals. (LP: #1774131) | ||
1797 | 636 | |||
1798 | 637 | -- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com> Fri, 08 Jun 2018 11:50:10 -0700 | ||
1799 | 638 | |||
1800 | 639 | update-manager (1:18.04.11.1) bionic; urgency=medium | ||
1801 | 640 | |||
1802 | 641 | * Block style context changed signal while enforcing the main window's | ||
1803 | 642 | constant size. Thanks to Thomas Waldmann and Sebastien Bacher for the | ||
1804 | 643 | initial analysis of this bug. (LP: #1637180) | ||
1805 | 644 | |||
1806 | 645 | -- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com> Mon, 28 May 2018 10:13:12 -0400 | ||
1807 | 646 | >>>>>>> debian/changelog | ||
1808 | 514 | 647 | ||
1809 | 515 | update-manager (1:18.04.11) bionic; urgency=medium | 648 | update-manager (1:18.04.11) bionic; urgency=medium |
1810 | 516 | 649 | ||
1811 | diff --git a/debian/control b/debian/control | |||
1812 | index c481028..aaf080a 100644 | |||
1813 | --- a/debian/control | |||
1814 | +++ b/debian/control | |||
1815 | @@ -9,8 +9,11 @@ Build-Depends: debhelper (>= 9), | |||
1816 | 9 | python3-all (>= 3.3.0-2), | 9 | python3-all (>= 3.3.0-2), |
1817 | 10 | python3-dbus, | 10 | python3-dbus, |
1818 | 11 | python3-distro-info, | 11 | python3-distro-info, |
1819 | 12 | <<<<<<< debian/control | ||
1820 | 12 | python3-distupgrade, | 13 | python3-distupgrade, |
1821 | 13 | python3-distutils-extra (>= 2.38), | 14 | python3-distutils-extra (>= 2.38), |
1822 | 15 | ======= | ||
1823 | 16 | >>>>>>> debian/control | ||
1824 | 14 | python3-gi (>= 3.8), | 17 | python3-gi (>= 3.8), |
1825 | 15 | python3-yaml, | 18 | python3-yaml, |
1826 | 16 | Build-Depends-Indep: intltool, | 19 | Build-Depends-Indep: intltool, |
1827 | diff --git a/hwe-support-status b/hwe-support-status | |||
1828 | index fd484a3..fa14477 100755 | |||
1829 | --- a/hwe-support-status | |||
1830 | +++ b/hwe-support-status | |||
1831 | @@ -42,8 +42,13 @@ UNSUPPORTED_KERNEL_IMAGE_REGEX = ( | |||
1832 | 42 | ) | 42 | ) |
1833 | 43 | 43 | ||
1834 | 44 | # HWE stack with a long support period | 44 | # HWE stack with a long support period |
1835 | 45 | <<<<<<< hwe-support-status | ||
1836 | 45 | HWE_SUPPORTED_BACKPORT = "-hwe-22.04" | 46 | HWE_SUPPORTED_BACKPORT = "-hwe-22.04" |
1837 | 46 | SUPPORTED_KERNEL_IMAGE_REGEX = r"^$" # No fixed backported kernel yet | 47 | SUPPORTED_KERNEL_IMAGE_REGEX = r"^$" # No fixed backported kernel yet |
1838 | 48 | ======= | ||
1839 | 49 | HWE_SUPPORTED_BACKPORT = "-hwe-18.04" | ||
1840 | 50 | SUPPORTED_KERNEL_IMAGE_REGEX = r'^$' # No fixed backported kernel yet | ||
1841 | 51 | >>>>>>> hwe-support-status | ||
1842 | 47 | 52 | ||
1843 | 48 | 53 | ||
1844 | 49 | KERNEL_METAPKGS = ( | 54 | KERNEL_METAPKGS = ( |
1845 | diff --git a/tests/test_backend_error.py b/tests/test_backend_error.py | |||
1846 | index 38785cb..611bf0f 100644 | |||
1847 | --- a/tests/test_backend_error.py | |||
1848 | +++ b/tests/test_backend_error.py | |||
1849 | @@ -5,14 +5,26 @@ import logging | |||
1850 | 5 | import mock | 5 | import mock |
1851 | 6 | import sys | 6 | import sys |
1852 | 7 | import unittest | 7 | import unittest |
1853 | 8 | <<<<<<< tests/test_backend_error.py | ||
1854 | 8 | from mock import patch | 9 | from mock import patch |
1855 | 9 | 10 | ||
1856 | 10 | import os | 11 | import os |
1857 | 11 | 12 | ||
1858 | 13 | ======= | ||
1859 | 14 | from gettext import gettext as _ | ||
1860 | 15 | from mock import patch | ||
1861 | 16 | |||
1862 | 17 | from UpdateManager.Dialogs import NoUpdatesDialog | ||
1863 | 18 | from UpdateManager.UpdateManager import UpdateManager | ||
1864 | 19 | from UpdateManager.UpdatesAvailable import UpdatesAvailable | ||
1865 | 20 | |||
1866 | 21 | import os | ||
1867 | 22 | >>>>>>> tests/test_backend_error.py | ||
1868 | 12 | CURDIR = os.path.dirname(os.path.abspath(__file__)) | 23 | CURDIR = os.path.dirname(os.path.abspath(__file__)) |
1869 | 13 | 24 | ||
1870 | 14 | 25 | ||
1871 | 15 | class TestBackendError(unittest.TestCase): | 26 | class TestBackendError(unittest.TestCase): |
1872 | 27 | <<<<<<< tests/test_backend_error.py | ||
1873 | 16 | def setUp(self): | 28 | def setUp(self): |
1874 | 17 | os.environ["UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON"] = "1" | 29 | os.environ["UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON"] = "1" |
1875 | 18 | 30 | ||
1876 | @@ -32,11 +44,35 @@ class TestBackendError(unittest.TestCase): | |||
1877 | 32 | update.side_effect = lambda: update_backend._action_done( | 44 | update.side_effect = lambda: update_backend._action_done( |
1878 | 33 | InstallBackend.ACTION_UPDATE, True, False, "string", "desc" | 45 | InstallBackend.ACTION_UPDATE, True, False, "string", "desc" |
1879 | 34 | ) | 46 | ) |
1880 | 47 | ======= | ||
1881 | 48 | |||
1882 | 49 | def setUp(self): | ||
1883 | 50 | os.environ['UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON'] = '1' | ||
1884 | 51 | |||
1885 | 52 | def clear_environ(): | ||
1886 | 53 | del os.environ['UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON'] | ||
1887 | 54 | |||
1888 | 55 | self.addCleanup(clear_environ) | ||
1889 | 56 | |||
1890 | 57 | @patch('UpdateManager.backend.InstallBackendAptdaemon.update') | ||
1891 | 58 | def test_backend_error(self, update): | ||
1892 | 59 | main = mock.MagicMock() | ||
1893 | 60 | main.datadir = os.path.join(CURDIR, '..', 'data') | ||
1894 | 61 | |||
1895 | 62 | from UpdateManager.backend import (InstallBackend, get_backend) | ||
1896 | 63 | update_backend = get_backend(main, InstallBackend.ACTION_UPDATE) | ||
1897 | 64 | update.side_effect = lambda: update_backend._action_done( | ||
1898 | 65 | InstallBackend.ACTION_UPDATE, True, False, "string", "desc") | ||
1899 | 66 | >>>>>>> tests/test_backend_error.py | ||
1900 | 35 | update_backend.start() | 67 | update_backend.start() |
1901 | 36 | main.start_error.assert_called_once_with(True, "string", "desc") | 68 | main.start_error.assert_called_once_with(True, "string", "desc") |
1902 | 37 | 69 | ||
1903 | 38 | 70 | ||
1904 | 71 | <<<<<<< tests/test_backend_error.py | ||
1905 | 39 | if __name__ == "__main__": | 72 | if __name__ == "__main__": |
1906 | 73 | ======= | ||
1907 | 74 | if __name__ == '__main__': | ||
1908 | 75 | >>>>>>> tests/test_backend_error.py | ||
1909 | 40 | if len(sys.argv) > 1 and sys.argv[1] == "-v": | 76 | if len(sys.argv) > 1 and sys.argv[1] == "-v": |
1910 | 41 | logging.basicConfig(level=logging.DEBUG) | 77 | logging.basicConfig(level=logging.DEBUG) |
1911 | 42 | unittest.main() | 78 | unittest.main() |
1912 | diff --git a/tests/test_hwe_support_status.py b/tests/test_hwe_support_status.py | |||
1913 | index e811ef9..a4449eb 100644 | |||
1914 | --- a/tests/test_hwe_support_status.py | |||
1915 | +++ b/tests/test_hwe_support_status.py | |||
1916 | @@ -153,8 +153,12 @@ class HweSupportStatusTestCase(TestCase): | |||
1917 | 153 | text = mock_print.call_args[0][0] | 153 | text = mock_print.call_args[0][0] |
1918 | 154 | print("43242343243", mock_print.call_count) | 154 | print("43242343243", mock_print.call_count) |
1919 | 155 | self.assertIn( | 155 | self.assertIn( |
1920 | 156 | <<<<<<< tests/test_hwe_support_status.py | ||
1921 | 156 | "Your system is supported until April 2027", text | 157 | "Your system is supported until April 2027", text |
1922 | 157 | ) | 158 | ) |
1923 | 159 | ======= | ||
1924 | 160 | "Your system is supported until April 2023", text) | ||
1925 | 161 | >>>>>>> tests/test_hwe_support_status.py | ||
1926 | 158 | 162 | ||
1927 | 159 | def test_advice_about_hwe_status_supported_hwe_stack(self): | 163 | def test_advice_about_hwe_status_supported_hwe_stack(self): |
1928 | 160 | with patch("hwe_support_status.is_unsupported_hwe_running") as m: | 164 | with patch("hwe_support_status.is_unsupported_hwe_running") as m: |
1929 | @@ -174,9 +178,13 @@ class HweSupportStatusTestCase(TestCase): | |||
1930 | 174 | text = mock_print.call_args[0][0] | 178 | text = mock_print.call_args[0][0] |
1931 | 175 | self.assertIn( | 179 | self.assertIn( |
1932 | 176 | "Your Hardware Enablement Stack (HWE) is supported " | 180 | "Your Hardware Enablement Stack (HWE) is supported " |
1933 | 181 | <<<<<<< tests/test_hwe_support_status.py | ||
1934 | 177 | "until April 2027", | 182 | "until April 2027", |
1935 | 178 | text, | 183 | text, |
1936 | 179 | ) | 184 | ) |
1937 | 185 | ======= | ||
1938 | 186 | "until April 2023", text) | ||
1939 | 187 | >>>>>>> tests/test_hwe_support_status.py | ||
1940 | 180 | 188 | ||
1941 | 181 | 189 | ||
1942 | 182 | if __name__ == "__main__": | 190 | if __name__ == "__main__": |
1943 | diff --git a/tests/test_meta_release_core.py b/tests/test_meta_release_core.py | |||
1944 | index 954a0ba..37af4ae 100644 | |||
1945 | --- a/tests/test_meta_release_core.py | |||
1946 | +++ b/tests/test_meta_release_core.py | |||
1947 | @@ -121,6 +121,18 @@ class TestMetaReleaseCore(unittest.TestCase): | |||
1948 | 121 | "download https with no proxy failed", | 121 | "download https with no proxy failed", |
1949 | 122 | ) | 122 | ) |
1950 | 123 | 123 | ||
1951 | 124 | @unittest.skipUnless(url_downloadable( | ||
1952 | 125 | "https://ubuntu.com", logging.debug), | ||
1953 | 126 | "Could not reach https test site") | ||
1954 | 127 | def test_https_url_downloadable(self): | ||
1955 | 128 | with EnvironmentVarGuard() as environ: | ||
1956 | 129 | logging.debug("no proxy, https address") | ||
1957 | 130 | del environ["http_proxy"] | ||
1958 | 131 | install_opener(None) | ||
1959 | 132 | self.assertTrue(url_downloadable("https://ubuntu.com", | ||
1960 | 133 | logging.debug), | ||
1961 | 134 | "download https with no proxy failed") | ||
1962 | 135 | |||
1963 | 124 | def test_url_downloadable(self): | 136 | def test_url_downloadable(self): |
1964 | 125 | from UpdateManager.Core.utils import url_downloadable | 137 | from UpdateManager.Core.utils import url_downloadable |
1965 | 126 | 138 | ||
1966 | @@ -154,12 +166,18 @@ class TestMetaReleaseCore(unittest.TestCase): | |||
1967 | 154 | ) | 166 | ) |
1968 | 155 | 167 | ||
1969 | 156 | logging.debug("no proxy, no valid address") | 168 | logging.debug("no proxy, no valid address") |
1970 | 169 | <<<<<<< tests/test_meta_release_core.py | ||
1971 | 157 | self.assertFalse( | 170 | self.assertFalse( |
1972 | 158 | url_downloadable( | 171 | url_downloadable( |
1973 | 159 | "http://archive.ubuntu.com/xxx", logging.debug | 172 | "http://archive.ubuntu.com/xxx", logging.debug |
1974 | 160 | ), | 173 | ), |
1975 | 161 | "download with no proxy failed", | 174 | "download with no proxy failed", |
1976 | 162 | ) | 175 | ) |
1977 | 176 | ======= | ||
1978 | 177 | self.assertFalse(url_downloadable("http://archive.ubuntu.com/xxx", | ||
1979 | 178 | logging.debug), | ||
1980 | 179 | "download with no proxy failed") | ||
1981 | 180 | >>>>>>> tests/test_meta_release_core.py | ||
1982 | 163 | 181 | ||
1983 | 164 | logging.debug("proxy, no valid address") | 182 | logging.debug("proxy, no valid address") |
1984 | 165 | environ["http_proxy"] = "http://localhost:%s" % self.port | 183 | environ["http_proxy"] = "http://localhost:%s" % self.port |
1985 | @@ -186,7 +204,11 @@ class TestMetaReleaseCore(unittest.TestCase): | |||
1986 | 186 | supported for supported in di.supported() if di.is_lts(supported) | 204 | supported for supported in di.supported() if di.is_lts(supported) |
1987 | 187 | ] | 205 | ] |
1988 | 188 | with EnvironmentVarGuard() as environ: | 206 | with EnvironmentVarGuard() as environ: |
1989 | 207 | <<<<<<< tests/test_meta_release_core.py | ||
1990 | 189 | environ["META_RELEASE_FAKE_CODENAME"] = ltses[-2] | 208 | environ["META_RELEASE_FAKE_CODENAME"] = ltses[-2] |
1991 | 209 | ======= | ||
1992 | 210 | environ["META_RELEASE_FAKE_CODENAME"] = "bionic" | ||
1993 | 211 | >>>>>>> tests/test_meta_release_core.py | ||
1994 | 190 | meta = MetaReleaseCore(forceDownload=True) | 212 | meta = MetaReleaseCore(forceDownload=True) |
1995 | 191 | while meta.downloading: | 213 | while meta.downloading: |
1996 | 192 | time.sleep(0.1) | 214 | time.sleep(0.1) |
1997 | diff --git a/tests/test_pep8.py b/tests/test_pep8.py | |||
1998 | 193 | new file mode 100644 | 215 | new file mode 100644 |
1999 | index 0000000..5127dfe | |||
2000 | --- /dev/null | |||
2001 | +++ b/tests/test_pep8.py | |||
2002 | @@ -0,0 +1,42 @@ | |||
2003 | 1 | <<<<<<< tests/test_pep8.py | ||
2004 | 2 | ======= | ||
2005 | 3 | #!/usr/bin/python3 | ||
2006 | 4 | # -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*- | ||
2007 | 5 | |||
2008 | 6 | import os | ||
2009 | 7 | import subprocess | ||
2010 | 8 | import unittest | ||
2011 | 9 | |||
2012 | 10 | # pep8 is overdoing it a bit IMO | ||
2013 | 11 | IGNORE_PEP8 = "E265,E402,W503" | ||
2014 | 12 | IGNORE_FILES = ( | ||
2015 | 13 | ) | ||
2016 | 14 | |||
2017 | 15 | |||
2018 | 16 | class TestPep8Clean(unittest.TestCase): | ||
2019 | 17 | """ ensure that the tree is pep8 clean """ | ||
2020 | 18 | |||
2021 | 19 | def test_pep8_clean(self): | ||
2022 | 20 | CURDIR = os.path.dirname(os.path.abspath(__file__)) | ||
2023 | 21 | py_files = set() | ||
2024 | 22 | for dirpath, dirs, files in os.walk(os.path.join(CURDIR, "..")): | ||
2025 | 23 | for f in files: | ||
2026 | 24 | if os.path.splitext(f)[1] != ".py": | ||
2027 | 25 | continue | ||
2028 | 26 | # islink to avoid running pep8 on imported files | ||
2029 | 27 | # that are symlinks to other packages | ||
2030 | 28 | if os.path.islink(os.path.join(dirpath, f)): | ||
2031 | 29 | continue | ||
2032 | 30 | if f in IGNORE_FILES: | ||
2033 | 31 | continue | ||
2034 | 32 | py_files.add(os.path.join(dirpath, f)) | ||
2035 | 33 | ret_code = subprocess.call( | ||
2036 | 34 | ["pep8", "--ignore={0}".format(IGNORE_PEP8)] + list(py_files)) | ||
2037 | 35 | self.assertEqual(0, ret_code) | ||
2038 | 36 | |||
2039 | 37 | |||
2040 | 38 | if __name__ == "__main__": | ||
2041 | 39 | import logging | ||
2042 | 40 | logging.basicConfig(level=logging.DEBUG) | ||
2043 | 41 | unittest.main() | ||
2044 | 42 | >>>>>>> tests/test_pep8.py | ||
2045 | diff --git a/tests/test_proxy.py b/tests/test_proxy.py | |||
2046 | index 266f173..1146fb4 100644 | |||
2047 | --- a/tests/test_proxy.py | |||
2048 | +++ b/tests/test_proxy.py | |||
2049 | @@ -31,16 +31,24 @@ class TestInitProxy(unittest.TestCase): | |||
2050 | 31 | apt_pkg.config.set("Acquire::http::proxy", self.proxy) | 31 | apt_pkg.config.set("Acquire::http::proxy", self.proxy) |
2051 | 32 | apt_pkg.config.set("Acquire::https::proxy", self.https_proxy) | 32 | apt_pkg.config.set("Acquire::https::proxy", self.https_proxy) |
2052 | 33 | from gi.repository import Gio | 33 | from gi.repository import Gio |
2053 | 34 | <<<<<<< tests/test_proxy.py | ||
2054 | 34 | 35 | ||
2055 | 35 | settings = Gio.Settings.new("com.ubuntu.update-manager") | 36 | settings = Gio.Settings.new("com.ubuntu.update-manager") |
2056 | 36 | detected_proxy = init_proxy(settings) | 37 | detected_proxy = init_proxy(settings) |
2057 | 37 | self.assertEqual( | 38 | self.assertEqual( |
2058 | 38 | detected_proxy, {"http": self.proxy, "https": self.https_proxy} | 39 | detected_proxy, {"http": self.proxy, "https": self.https_proxy} |
2059 | 39 | ) | 40 | ) |
2060 | 41 | ======= | ||
2061 | 42 | settings = Gio.Settings.new("com.ubuntu.update-manager") | ||
2062 | 43 | detected_proxy = init_proxy(settings) | ||
2063 | 44 | self.assertEqual(detected_proxy, {"http": self.proxy, | ||
2064 | 45 | "https": self.https_proxy}) | ||
2065 | 46 | >>>>>>> tests/test_proxy.py | ||
2066 | 40 | 47 | ||
2067 | 41 | def testinitproxyHttpOnly(self): | 48 | def testinitproxyHttpOnly(self): |
2068 | 42 | apt_pkg.config.set("Acquire::http::proxy", self.proxy) | 49 | apt_pkg.config.set("Acquire::http::proxy", self.proxy) |
2069 | 43 | from gi.repository import Gio | 50 | from gi.repository import Gio |
2070 | 51 | <<<<<<< tests/test_proxy.py | ||
2071 | 44 | 52 | ||
2072 | 45 | settings = Gio.Settings.new("com.ubuntu.update-manager") | 53 | settings = Gio.Settings.new("com.ubuntu.update-manager") |
2073 | 46 | detected_proxy = init_proxy(settings) | 54 | detected_proxy = init_proxy(settings) |
2074 | @@ -50,6 +58,29 @@ class TestInitProxy(unittest.TestCase): | |||
2075 | 50 | 58 | ||
2076 | 51 | def testinitproxyHttpOnlyWithHttpsUri(self): | 59 | def testinitproxyHttpOnlyWithHttpsUri(self): |
2077 | 52 | apt_pkg.config.set("Acquire::http::proxy", self.https_proxy) | 60 | apt_pkg.config.set("Acquire::http::proxy", self.https_proxy) |
2078 | 61 | ======= | ||
2079 | 62 | settings = Gio.Settings.new("com.ubuntu.update-manager") | ||
2080 | 63 | detected_proxy = init_proxy(settings) | ||
2081 | 64 | self.assertEqual(detected_proxy, {"http": self.proxy, | ||
2082 | 65 | "https": self.proxy}) | ||
2083 | 66 | |||
2084 | 67 | def testinitproxyHttpOnlyWithHttpsUri(self): | ||
2085 | 68 | apt_pkg.config.set("Acquire::http::proxy", self.https_proxy) | ||
2086 | 69 | from gi.repository import Gio | ||
2087 | 70 | settings = Gio.Settings.new("com.ubuntu.update-manager") | ||
2088 | 71 | detected_proxy = init_proxy(settings) | ||
2089 | 72 | self.assertEqual(detected_proxy, {"http": self.https_proxy, | ||
2090 | 73 | "https": self.https_proxy}) | ||
2091 | 74 | |||
2092 | 75 | def testinitproxyHttpsOnly(self): | ||
2093 | 76 | apt_pkg.config.set("Acquire::https::proxy", self.https_proxy) | ||
2094 | 77 | from gi.repository import Gio | ||
2095 | 78 | settings = Gio.Settings.new("com.ubuntu.update-manager") | ||
2096 | 79 | detected_proxy = init_proxy(settings) | ||
2097 | 80 | self.assertEqual(detected_proxy, {"https": self.https_proxy}) | ||
2098 | 81 | |||
2099 | 82 | def testinitproxyNoProxy(self): | ||
2100 | 83 | >>>>>>> tests/test_proxy.py | ||
2101 | 53 | from gi.repository import Gio | 84 | from gi.repository import Gio |
2102 | 54 | 85 | ||
2103 | 55 | settings = Gio.Settings.new("com.ubuntu.update-manager") | 86 | settings = Gio.Settings.new("com.ubuntu.update-manager") |
2104 | diff --git a/tests/test_update_error.py b/tests/test_update_error.py | |||
2105 | index c7b2eda..1daa99f 100644 | |||
2106 | --- a/tests/test_update_error.py | |||
2107 | +++ b/tests/test_update_error.py | |||
2108 | @@ -41,12 +41,20 @@ class TestUpdateManagerError(unittest.TestCase): | |||
2109 | 41 | self.manager, 1, error_occurred=True | 41 | self.manager, 1, error_occurred=True |
2110 | 42 | ) | 42 | ) |
2111 | 43 | self.assertIsInstance(p, UpdatesAvailable) | 43 | self.assertIsInstance(p, UpdatesAvailable) |
2112 | 44 | <<<<<<< tests/test_update_error.py | ||
2113 | 44 | self.assertEqual( | 45 | self.assertEqual( |
2114 | 45 | p.custom_desc, _("Some software couldn’t be checked for updates.") | 46 | p.custom_desc, _("Some software couldn’t be checked for updates.") |
2115 | 46 | ) | 47 | ) |
2116 | 47 | 48 | ||
2117 | 48 | 49 | ||
2118 | 49 | if __name__ == "__main__": | 50 | if __name__ == "__main__": |
2119 | 51 | ======= | ||
2120 | 52 | self.assertEqual(p.custom_desc, | ||
2121 | 53 | _("Some software couldn’t be checked for updates.")) | ||
2122 | 54 | |||
2123 | 55 | |||
2124 | 56 | if __name__ == '__main__': | ||
2125 | 57 | >>>>>>> tests/test_update_error.py | ||
2126 | 50 | if len(sys.argv) > 1 and sys.argv[1] == "-v": | 58 | if len(sys.argv) > 1 and sys.argv[1] == "-v": |
2127 | 51 | logging.basicConfig(level=logging.DEBUG) | 59 | logging.basicConfig(level=logging.DEBUG) |
2128 | 52 | unittest.main() | 60 | unittest.main() |