[buildinfo.debian.net] 01/03: Drop Installed-Build-Depends to recover diskspace.
Chris Lamb
chris at chris-lamb.co.uk
Thu Feb 23 02:45:58 UTC 2017
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository buildinfo.debian.net.
commit d556a0976d0c2a8fcb09f3ac117beb4493e6f7ba
Author: Chris Lamb <lamby at debian.org>
Date: Wed Feb 22 17:06:53 2017 +0800
Drop Installed-Build-Depends to recover diskspace.
Signed-off-by: Chris Lamb <lamby at debian.org>
---
bidb/api/utils.py | 15 +----------
.../migrations/0005_auto_20170222_0906.py | 26 +++++++++++++++++++
bidb/buildinfo/models.py | 29 ----------------------
bidb/buildinfo/views.py | 5 ----
templates/buildinfo/view.html | 13 ----------
5 files changed, 27 insertions(+), 61 deletions(-)
diff --git a/bidb/api/utils.py b/bidb/api/utils.py
index ed29c6c..c7bc57b 100644
--- a/bidb/api/utils.py
+++ b/bidb/api/utils.py
@@ -154,7 +154,7 @@ def parse_submission(request):
buildinfo.checksums.create(filename=k, **v)
- ## Create InstalledBuildDepends instances #################################
+ ## Validate Installed-Build-Depends #######################################
for x in data['Installed-Build-Depends'].strip().splitlines():
m = re_installed_build_depends.match(x.strip())
@@ -164,17 +164,4 @@ def parse_submission(request):
"Invalid entry in Installed-Build-Depends: {}".format(x),
)
- binary = Binary.objects.get_or_create(name=m.group('package'))[0]
-
- if buildinfo.installed_build_depends.filter(
- binary=binary,
- ).exists():
- raise InvalidSubmission("Duplicate entry in "
- "Installed-Build-Depends: {}".format(binary.name))
-
- buildinfo.installed_build_depends.create(
- binary=binary,
- version=m.group('version'),
- )
-
return create_submission(buildinfo), True
diff --git a/bidb/buildinfo/migrations/0005_auto_20170222_0906.py b/bidb/buildinfo/migrations/0005_auto_20170222_0906.py
new file mode 100644
index 0000000..dbfcc86
--- /dev/null
+++ b/bidb/buildinfo/migrations/0005_auto_20170222_0906.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.11 on 2017-02-22 09:06
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('buildinfo', '0004_remove_buildinfo_raw_text'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='installedbuilddepends',
+ name='binary',
+ ),
+ migrations.RemoveField(
+ model_name='installedbuilddepends',
+ name='buildinfo',
+ ),
+ migrations.DeleteModel(
+ name='InstalledBuildDepends',
+ ),
+ ]
diff --git a/bidb/buildinfo/models.py b/bidb/buildinfo/models.py
index 4bae6fe..28f137b 100644
--- a/bidb/buildinfo/models.py
+++ b/bidb/buildinfo/models.py
@@ -129,32 +129,3 @@ class Origin(models.Model):
self.pk,
self.name,
)
-
-class InstalledBuildDepends(models.Model):
- buildinfo = models.ForeignKey(
- Buildinfo,
- related_name='installed_build_depends',
- )
-
- binary = models.ForeignKey(
- 'packages.Binary',
- related_name='build_depends',
- )
-
- version = models.CharField(max_length=200)
-
- class Meta:
- ordering = ('binary__name',)
- get_latest_by = 'created'
- unique_together = (
- # We should really have a ('buildinfo', 'binary') here, but it
- # uses a rather lot of disk space.
- )
-
- def __unicode__(self):
- return u"pk=%d buildinfo=%r binary=%r version=%r" % (
- self.pk,
- self.buildinfo,
- self.binary,
- self.version,
- )
diff --git a/bidb/buildinfo/views.py b/bidb/buildinfo/views.py
index d055029..102afc5 100644
--- a/bidb/buildinfo/views.py
+++ b/bidb/buildinfo/views.py
@@ -11,13 +11,8 @@ def view(request, sha1, filename=None):
if filename != buildinfo.get_filename():
return redirect(buildinfo)
- installed_build_depends = buildinfo.installed_build_depends.select_related(
- 'binary',
- )
-
return render(request, 'buildinfo/view.html', {
'buildinfo': buildinfo,
- 'installed_build_depends': installed_build_depends,
})
def raw_text(request, sha1, filename=None):
diff --git a/templates/buildinfo/view.html b/templates/buildinfo/view.html
index fe9ab47..1425cd2 100644
--- a/templates/buildinfo/view.html
+++ b/templates/buildinfo/view.html
@@ -152,19 +152,6 @@
</div>
</div>
-<h3>Installed build-depends</h3>
-
-<ul class="list-unstyled">
- {% for x in installed_build_depends %}
- <li>
- <a href="{{ x.binary.get_absolute_url }}">
- <span class="label label-default">{{ x.binary.name }}</span>
- </a>
- (= <code>{{ x.version }}</code></dd>)
- </li>
- {% endfor %}
-</ul>
-
<h3>Environment</h3>
<code>{{ buildinfo.environment|linebreaksbr }}</code>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/buildinfo.debian.net.git
More information about the Reproducible-commits
mailing list