Merge ~fourdollars/ubiquity:master into ubiquity:master

Proposed by Shih-Yuan Lee
Status: Merged
Merged at revision: b8f3e13797fc4ff7c5ca72e4b4c4b60667389d9f
Proposed branch: ~fourdollars/ubiquity:master
Merge into: ubiquity:master
Diff against target: 41 lines (+6/-4)
1 file modified
scripts/plugininstall.py (+6/-4)
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+395055@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

LGTM. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/plugininstall.py b/scripts/plugininstall.py
2index acfe9d0..c635e9c 100755
3--- a/scripts/plugininstall.py
4+++ b/scripts/plugininstall.py
5@@ -1233,7 +1233,7 @@ class Install(install_misc.InstallBase):
6 # enabled
7 cache = Cache()
8 filtered_extra_packages = install_misc.query_recorded_installed()
9- for package in filtered_extra_packages.copy():
10+ for package in sorted(filtered_extra_packages):
11 pkg = cache.get(package)
12 if not pkg:
13 continue
14@@ -1245,7 +1245,8 @@ class Install(install_misc.InstallBase):
15 filtered_extra_packages.remove(package)
16 break
17
18- self.do_install(filtered_extra_packages)
19+ # An ordered list from the set() to avoid the random dependencies failure.
20+ self.do_install(sorted(filtered_extra_packages))
21
22 if self.db.get('ubiquity/install_oem') == 'true':
23 try:
24@@ -1253,7 +1254,7 @@ class Install(install_misc.InstallBase):
25 # upgrade them to their versions in the OEM archive.
26 with open('/run/ubuntu-drivers-oem.autoinstall', 'r') as f:
27 oem_pkgs = set(f.read().splitlines())
28- for oem_pkg in oem_pkgs.copy():
29+ for oem_pkg in sorted(oem_pkgs):
30 target_sources_list = self.target_file("etc/apt/sources.list.d/{}.list".format(oem_pkg))
31 if not os.path.exists(target_sources_list):
32 continue
33@@ -1265,7 +1266,8 @@ class Install(install_misc.InstallBase):
34 syslog.syslog("Failed to apt update {}".format(target_sources_list))
35 oem_pkgs.discard(oem_pkg)
36 if oem_pkgs:
37- self.do_install(oem_pkgs)
38+ # An ordered list from the set() to avoid the random dependencies failure.
39+ self.do_install(sorted(oem_pkgs))
40 except FileNotFoundError:
41 pass
42

Subscribers

People subscribed via source and target branches