Merge ~ycheng-twn/ubuntu/+source/ubiquity:0001_mark_install_enhancement into ubuntu/+source/ubiquity:ubuntu/devel

Proposed by Yuan-Chen Cheng
Status: Needs review
Proposed branch: ~ycheng-twn/ubuntu/+source/ubiquity:0001_mark_install_enhancement
Merge into: ubuntu/+source/ubiquity:ubuntu/devel
Diff against target: 28 lines (+15/-2)
1 file modified
ubiquity/install_misc.py (+15/-2)
Reviewer Review Type Date Requested Status
Julian Andres Klode (community) Disapprove
git-ubuntu developers Pending
Review via email: mp+390009@code.launchpad.net

Commit message

This fix LP: #1891599. please check there for details.

To post a comment you must log in.
Revision history for this message
Julian Andres Klode (juliank) wrote :

Both the original approach as well as the proposed one are wrong. The correct approach for marking multiple packages for installation is to

1. mark all the packages with auto_inst=False, auto_fix=False
2. mark all the packages with auto_inst=True, auto_fix=False
3. run a ProblemResolver manually

This ensures that choices are propagated correctly, if you install A, B and A depends on C|B, this would install A and B, whereas the other algorithms install A, C, and B.

review: Disapprove

Unmerged commits

6049b7e... by Yuan-Chen Cheng

fix the issue of dependency resoluton order in mark_install()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubiquity/install_misc.py b/ubiquity/install_misc.py
2index 7d9f771..f996272 100644
3--- a/ubiquity/install_misc.py
4+++ b/ubiquity/install_misc.py
5@@ -934,8 +934,21 @@ class InstallBase:
6 return
7
8 with cache.actiongroup():
9- for pkg in to_install:
10- mark_install(cache, pkg)
11+ while len(to_install) > 0:
12+ failed_pkgs = set()
13+ for pkg in to_install:
14+ try:
15+ mark_install(cache, pkg)
16+ except InstallStepError as err:
17+ syslog.syslog("W: error as mark_install(" +
18+ pkg + "):" + str(err))
19+ syslog.syslog("W: will move " + pkg +
20+ "to next iteration")
21+ failed_pkgs.append(pkg)
22+ if len(to_install) == len(failed_pkgs):
23+ raise InstallStepError(
24+ "E: Re-ordered installation still failed")
25+ to_install = failed_pkgs
26
27 self.db.progress('SET', 1)
28 self.progress_region(1, 10)

Subscribers

People subscribed via source and target branches