Merge lp:~mvo/snapcraft/lp1498333-even-more-apt into lp:~snappy-dev/snapcraft/core

Proposed by Michael Vogt
Status: Merged
Approved by: Daniel Holbach
Approved revision: 193
Merged at revision: 194
Proposed branch: lp:~mvo/snapcraft/lp1498333-even-more-apt
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 33 lines (+11/-3)
1 file modified
snapcraft/repo.py (+11/-3)
To merge this branch: bzr merge lp:~mvo/snapcraft/lp1498333-even-more-apt
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+271918@code.launchpad.net

Commit message

Fetch all packages in a single download run with proper progress

Description of the change

This branch will do all the fetching in a single go to get accurate
download progress reporting.

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Two small typos, apart from that great work!

review: Approve
193. By Michael Vogt

fix two typos (one is not even from me ;). Thanks dholbach!

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks. Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snapcraft/repo.py'
2--- snapcraft/repo.py 2015-09-21 15:21:15 +0000
3+++ snapcraft/repo.py 2015-09-22 08:12:26 +0000
4@@ -78,18 +78,26 @@
5 except KeyError:
6 raise PackageNotFoundError(name)
7
8+ # unmark some base packages here
9+ # note that this will break the consistency check inside apt_cache
10+ # (self.apt_cache.broken_count will be > 0)
11+ # but that is ok as it was consistent before we excluded
12+ # these base package
13 for pkg in self.apt_cache:
14 # those should be already on each system, it also prevents
15 # diving into downloading libc6
16 if (pkg.candidate.priority in 'essential' and
17 pkg.name not in package_names):
18- print('Skipping priority essential/imporant %s' % pkg.name)
19+ print('Skipping priority essential/important %s' % pkg.name)
20+ pkg.mark_keep()
21 continue
22 if (pkg.name in manifest_dep_names and pkg.name not in package_names):
23 print('Skipping blacklisted from manifest package %s' % pkg.name)
24+ pkg.mark_keep()
25 continue
26- if pkg.marked_install:
27- pkg.candidate.fetch_binary(destdir=self.downloaddir)
28+ # download the remaining ones with proper progress
29+ apt.apt_pkg.config.set("Dir::Cache::Archives", self.downloaddir)
30+ self.apt_cache.fetch_archives()
31
32 def unpack(self, rootdir):
33 pkgs_abs_path = glob.glob(os.path.join(self.downloaddir, '*.deb'))

Subscribers

People subscribed via source and target branches