Commit Graph

7 Commits

Author SHA1 Message Date
Alexandru Avadanii 25b8673f84 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: I7279aa6526ff9133829be2e316932c9b052c7814
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2017-01-26 19:00:00 +01:00
Sergey Kulanov 54e5912a88 Fix rpm package equality issue
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
2016-06-06 15:15:05 +03:00
Sergey Kulanov ff85847eca Fix rpm package provides/obsoletes relations
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
2016-05-26 16:45:31 +03:00
Bulat Gaifullin 1ce69b4fef Unify input data format
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
2016-01-28 17:27:15 +00:00
Bulat Gaifullin 15cbcf5e0a Update file-headers 2015-12-29 12:08:39 +03:00
Bulat Gaifullin af0a66d31c [packetary] Introduce command-line interface
Available commands:
- clone - Clones specified repository(es) to local folder.
  packetary clone -o "http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" -t deb -d /var/www/mirror/ubuntu

- packages - Gets the list of packages from repository(es).
  packetary packages -o http://mirror.fuel-infra.org/mos-repos/centos/mos8.0-centos6-fuel/os -t yum

- unresolved - Get the list of external dependencies for repository.
  packetary unresolved -o "http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0 mos8.0 main"

Change-Id: I4b3f3fb7b7f2967cf596ed3c7758cfbbf76dfe73
Partial-Bug: #1487077
2015-12-03 09:45:38 +00:00
Bulat Gaifullin 671af8e611 [packetary] Repository class
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
2015-11-09 16:22:18 +03:00