-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Each RPM can have arbitrary number of dependencies of multiple types. The types are hard-coded, and can not be extended at run-time. With this patch, it is possible to store and retrieve the dependencies. There are tests for these parts. Existing tests have been updated to pass: for RPM tests there are some minor updates. The compose/package API and its variants are updated not to include dependencies in their output. All changes to dependencies are logged in change sets as single update to the RPM. There is a single filter for each dependency type. It allows to specify an optional version. When a version is used in the filter, it removes all packages that are incompatible with that version restriction. The behaviour is documented with examples. The version comparisons are implemented with a function adhering to PEP 0440 [0], which seems to be powerful enough to do everything required. There is a wrapper that makes it work with epochs. It also works with releases. There is an additional single filter `has_no_deps`, which filters packages that have some or don't have any dependency (this works across all types). [0]: https://www.python.org/dev/peps/pep-0440/ Changes in other parts of codebase: * Custom boolean filter is updated to allow removing duplicates from the response. JIRA: PDC-955
- Loading branch information
Showing
9 changed files
with
979 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('package', '0004_rpm_linked_releases'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Dependency', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('type', models.PositiveIntegerField(choices=[(1, b'provides'), (2, b'requires'), (3, b'obsoletes'), (4, b'conflicts'), (5, b'recommends'), (6, b'suggests')])), | ||
('name', models.CharField(max_length=200)), | ||
('version', models.CharField(max_length=200, null=True, blank=True)), | ||
('comparison', models.CharField(max_length=50, null=True, blank=True)), | ||
('rpm', models.ForeignKey(to='package.RPM')), | ||
], | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='dependency', | ||
unique_together=set([('type', 'name', 'version', 'comparison', 'rpm')]), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.