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: I7279aa6526ff9133829be2e316932c9b052c7814
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
If package depends on exact equality of =name+version
we also need to search candidates in release section:
=name+version+(>=release)
eg:
name: foo-1.1-3
Requires: bar == 5.5
then the below package must meet the requiremets:
name: bar-5.5-56.el7
To make this true we need:
* always search for candidates in package.name and package.provides,
package.obsoletes, [check PackagesTree.find_all()]
* make an assumption that foo-1.1 and foo-1.1-33 has intersection,
[check RpmPackageVersion.cmp()]
Tests:
======
gen_package() in stubs.generator must always generate Provides
section, which is always: name=version, eg:
1) Name: my-python-requests
Version: 2.10.0
Release: 1.el7~mos1
will result PROVIDES:
my-python-requests = 2.10.0-1.el7~mos1
2) Name: my-python-urllib3
Version: 1.15.1
Release: 7777
Provides: test
will result PROVIDES:
test
my-python-urllib3 = 1.15.1-7777
Change-Id: Ib26918b2e1d98733fbd49f1fc05403ca5665e3fe
Closes-Bug: #1588399
Rpm package can provides and obsoletes the same package name
but with different versions, for eg:
OBSOLETES:
python-debtcollector < 1.2.0-1.el7~mos1
python-debtcollector < 0.7.0-3
PROVIDES:
python-debtcollector = 1.2.0-1.el7~mos1
python2-debtcollector = 1.2.0-1.el7~mos1
This comes from %python_provide macros, eg:
# rpm --eval '%python_provide python2-foo'
Provides: python-foo(x86-64) = %{version}-%{release}
Provides: python-foo = %{version}-%{release}
Obsoletes: python-foo(x86-64) < %{version}-%{release}
Obsoletes: python-foo < %{version}-%{release}
# rpm --eval '%python_provide python-foo'
Provides: python2-foo = %{version}-%{release}
So we need to align flow
Change-Id: I07b3d8b9a25c5c98e97e697c26e6ae9d1f4960ff
Closes-bug: #1578224
The input data is described in YAML or JSON format
Also implemented support of priorities for repositories
Change-Id: I02f11714ba8880dd06c3ceeadf230c1d812ff0be
Implements: blueprint unify-input-data
class Repository composes from:
* RepositryDriver - low-level support for physical repository. deb, yum, etc.
* RepositoryController - infrastcuture method to communicate with driver
* RepositoryApi - high-level class, that provides methods to work with repository
Change-Id: Iaf868fca982d91089e369d13a6fb381ff879ea73
Implements: blueprint refactor-local-mirror-scripts
Partial-Bug: #1487077