Stage package fetching progress is useless

Bug #1663365 reported by Kyle Fazzari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Medium
Sergio Schvezov

Bug Description

When Snapcraft fetches stage packages, as of 2.27 it does it individually, which doesn't provide an overall picture of how long pulling all of them will take. This is because fetch_archives(), the method used to do it previously, messes with some filenames so fetching from the cache didn't work. For example:

>>> import snapcraft.internal.repo as repo
>>> r = repo.Ubuntu('/tmp/foo')
>>> with r._apt.archive('/tmp/cache') as apt_cache:
....... p = apt_cache['cpp']
....... p.mark_install()
....... apt_cache.fetch_archives()

Results in 'cpp_4%3a5.3.1-1ubuntu1_amd64.deb' being fetched. Whereas:

>>> import snapcraft.internal.repo as repo
>>> r = repo.Ubuntu('/tmp/foo')
>>> with r._apt.archive('/tmp/cache') as apt_cache:
....... p = apt_cache['cpp']
....... p.candidate.fetch_binary(<downloaddir>)

Results in cpp_5.3.1-1ubuntu1_amd64.deb being fetched.

Using fetch_binary isn't ideal for the reasons stated above. A better method could be to store files in the cache by hash, but that adds overhead that should be unnecessary. Some investigation into fetch_archives() may be warranted.

Kyle Fazzari (kyrofa)
description: updated
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.