packages_tree: exact package name match is trumped by other providers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
packetary |
Fix Released
|
Undecided
|
Alexandru Avadanii |
Bug Description
Ubuntu frequently has multiple providers for the same package name,
e.g. "vim" is provided by "vim", "vim-gnome" etc.
Below is a sample dump of an internal packetary's list of matches for a generic
"vim" package requirement, without a version enforced, based on current Xenial repos:
vim-gtk3-py2 (2:7.4.
vim-gnome (2:7.4.
vim-gtk (2:7.4.
vim-nox (2:7.4.
vim-gtk-py2 (2:7.4.
vim-gnome-py2 (2:7.4.
vim-nox-py2 (2:7.4.
vim (2:7.4.
vim-gtk3 (2:7.4.
vim-athena (2:7.4.
vim-athena-py2 (2:7.4.
vim-gtk (2:7.4.
vim-gnome-py2 (2:7.4.
vim-gtk-py2 (2:7.4.
vim-nox (2:7.4.
vim-nox-py2 (2:7.4.
vim-gtk3 (2:7.4.
vim (2:7.4.
vim-athena (2:7.4.
vim-athena-py2 (2:7.4.
vim-gnome (2:7.4.
vim-gtk3-py2 (2:7.4.
Currently, packetary solves the "vim" relation by using the last item
in the sorted list, in this case "vim-gtk3-py2"; instead of using the
exact package name match "vim".
NOTE: Xenial recently added the "*-py2" packages, previously our
selection included "vim" just by chance.
This leads to our final mirror clone missing the "vim" package, and
inherintely failing to build bootstrap/target images using only the
partial Ubuntu mirror in OPNFV ISO.
To reproduce, run packetary:
$ packetary --threads-num 10 clone \
-t deb \
-r ubuntu_mirror.yaml \
-R ubuntu_
-d .
ubuntu_mirror.yaml:
- name: ubuntu
path: /home/alav/
priority: null
section:
- main
- multiverse
- restricted
- universe
suite: xenial
type: deb
uri: http://
ubuntu_
mandatory: exact
packages:
- name: vim
[...]
$ find /home/alav/
[ ... missing logs, but we have a bunch of "vim-gnome", "vim-gtk3", and no "vim" ... ]
The proposed fix is to first check the list for an exact name match,
which would trump any secondary providers, even if they have a
higher package version.
One problem with the current form of the proposed patch is that newer versions of alternative
providers are trumped by an exact package name patch.
However, one major consequence of the proposed fix is the drastic size reduction of the cloned mirror,
without any functional impact (all requirements are still satisfied with the reduced set).
I'm not really convinced my patch is the right way to do it, and I haven't tested it with RPM cloning, but it should "just work" (?).
Changed in packetary: | |
assignee: | nobody → Alexandru Avadanii (alexandru-avadanii) |
status: | New → In Progress |
Reviewed: https:/ /review. openstack. org/420815 /git.openstack. org/cgit/ openstack/ packetary/ commit/ ?id=25b8673f849 46b1072605137a4 a1f60c89586489
Committed: https:/
Submitter: Jenkins
Branch: master
commit 25b8673f84946b1 072605137a4a1f6 0c89586489
Author: Alexandru Avadanii <email address hidden>
Date: Sun Jan 15 00:40:15 2017 +0100
packages_tree: exact match trumps other providers
Ubuntu frequently has multiple providers for the same package name,
e.g. "vim" is provided by "vim", "vim-gnome" etc.
We need to adjust the resolving algorithm to:
1. lookup in virtual packages
2. lookup in packages
3. lookup in obsoletes.
Use the package which was found last (version-sorted).
Closes-bug: 1656888
Change-Id: I7279aa6526ff91 33829be2e316932 c9b052c7814
Signed-off-by: Alexandru Avadanii <email address hidden>