forked from pulp/pulp_deb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial source package and source indices support
fixes pulp#409 pulp#409 (was https://pulp.plan.io/issues/8775) Allows the addition of Debian Source Packages, DSC files and any associate source files (.orig.tar.gz, .debian.tar.xz, ...), as well as synchronizing with a remote's source indices (sync_sources=True). Publishing a distribution will make available DSC files, sources and source indices in the repository, compliant with the Debian rempository format. The source files referenced in a dsc_file must be uploaded as artifacts before the dsc_file so a typical workflow might be -- apt-get source bc http --form post $BASE/pulp/api/v3/artifacts/ \ file@"/tmp/bc_1.07.1-2build1.debian.tar.xz" http --form post $BASE/pulp/api/v3/artifacts/ \ file@"/tmp/bc_1.07.1.orig.tar.gz" http --form post $BASE/pulp/api/v3/artifacts/ \ file@"/tmp/bc_1.07.1-2build1.dsc" http --form post $BASE/pulp/api/v3/content/deb/source_packages/ \ artifact=/pulp/api/v3/artifacts/3094de7e-da61-4cf6-ae75-a35b74472d9a/ -- Attempting to create the source_packages content from a DSC file artifact before its source files are present as artifacts will result validation errors. Once source_packages content has been created it can be inspected via its pulp_href or using the source_packages endpoint http get $BASE/pulp/api/v3/content/deb/source_packages/ Synchronizing with a remote with "sync_sources=True" will synchronize the Source Indicies files inspecting each contained paragraph to download all associated DSC files and referced source files (note: source file download may be deferred if remote policy="on_demand"), performing a high level of data validation and creating all required associations. As with uploading inspecting contents after a sync is complete can be done with the same endpoints as above. To remain spec compliant with https://wiki.debian.org/DebianRepository "md5" must be present in the ALLOWED_CONTENT_CHECKSUMS. In all cases the use of md5 is supplemental so security concerns around this addition, at least for use with this feature, should be minimal.
- Loading branch information
1 parent
a0816d5
commit 4070244
Showing
13 changed files
with
1,060 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for handling source packages. |
82 changes: 82 additions & 0 deletions
82
pulp_deb/app/migrations/0023_sourceindex_sourcepackage_sourcepackagereleasecomponent.py
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,82 @@ | ||
# Generated by Django 3.2.18 on 2023-05-31 20:04 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0107_distribution_hidden'), | ||
('deb', '0022_alter_aptdistribution_distribution_ptr_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='SourcePackage', | ||
fields=[ | ||
('content_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='deb_sourcepackage', serialize=False, to='core.content')), | ||
('relative_path', models.TextField()), | ||
('format', models.TextField()), | ||
('source', models.TextField()), | ||
('binary', models.TextField(null=True)), | ||
('architecture', models.TextField(null=True)), | ||
('version', models.TextField()), | ||
('maintainer', models.TextField()), | ||
('uploaders', models.TextField(null=True)), | ||
('homepage', models.TextField(null=True)), | ||
('vcs_browser', models.TextField(null=True)), | ||
('vcs_arch', models.TextField(null=True)), | ||
('vcs_bzr', models.TextField(null=True)), | ||
('vcs_cvs', models.TextField(null=True)), | ||
('vcs_darcs', models.TextField(null=True)), | ||
('vcs_git', models.TextField(null=True)), | ||
('vcs_hg', models.TextField(null=True)), | ||
('vcs_mtn', models.TextField(null=True)), | ||
('vcs_snv', models.TextField(null=True)), | ||
('testsuite', models.TextField(null=True)), | ||
('dgit', models.TextField(null=True)), | ||
('standards_version', models.TextField()), | ||
('build_depends', models.TextField(null=True)), | ||
('build_depends_indep', models.TextField(null=True)), | ||
('build_depends_arch', models.TextField(null=True)), | ||
('build_conflicts', models.TextField(null=True)), | ||
('build_conflicts_indep', models.TextField(null=True)), | ||
('build_conflicts_arch', models.TextField(null=True)), | ||
('package_list', models.TextField(null=True)), | ||
], | ||
options={ | ||
'default_related_name': '%(app_label)s_%(model_name)s', | ||
}, | ||
bases=('core.content',), | ||
), | ||
migrations.CreateModel( | ||
name='SourcePackageReleaseComponent', | ||
fields=[ | ||
('content_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='deb_sourcepackagereleasecomponent', serialize=False, to='core.content')), | ||
('release_component', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deb_sourcepackagereleasecomponent', to='deb.releasecomponent')), | ||
('source_package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deb_sourcepackagereleasecomponent', to='deb.sourcepackage')), | ||
], | ||
options={ | ||
'default_related_name': '%(app_label)s_%(model_name)s', | ||
'unique_together': {('source_package', 'release_component')}, | ||
}, | ||
bases=('core.content',), | ||
), | ||
migrations.CreateModel( | ||
name='SourceIndex', | ||
fields=[ | ||
('content_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='deb_sourceindex', serialize=False, to='core.content')), | ||
('component', models.CharField(max_length=255)), | ||
('relative_path', models.TextField()), | ||
('sha256', models.CharField(max_length=255)), | ||
('release', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deb_sourceindex', to='deb.releasefile')), | ||
], | ||
options={ | ||
'verbose_name_plural': 'SourceIndices', | ||
'default_related_name': '%(app_label)s_%(model_name)s', | ||
'unique_together': {('relative_path', 'sha256')}, | ||
}, | ||
bases=('core.content',), | ||
), | ||
] |
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
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.