summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--devel/views.py9
-rw-r--r--templates/devel/index.html3
-rw-r--r--templates/devel/packages.html1
3 files changed, 12 insertions, 1 deletions
diff --git a/devel/views.py b/devel/views.py
index a013b32..6907de2 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -13,7 +13,7 @@ from django.template import loader, Context
from django.views.decorators.cache import never_cache
from django.views.generic.simple import direct_to_template
-from main.models import Package, PackageFile, TodolistPkg
+from main.models import Package, PackageDepend, PackageFile, TodolistPkg
from main.models import Arch, Repo
from main.models import UserProfile
from packages.models import PackageRelation
@@ -156,6 +156,13 @@ def report(request, report):
filename__endswith='.info').values_list(
'pkg_id', flat=True).distinct()
packages = packages.filter(id__in=set(bad_files))
+ elif report == 'unneeded-orphans':
+ title = 'Orphan packages required by no other packages'
+ owned = PackageRelation.objects.all().values('pkgbase')
+ required = PackageDepend.objects.all().values('depname')
+ # The two separate calls to exclude is required to do the right thing
+ packages = packages.exclude(pkgbase__in=owned).exclude(
+ pkgname__in=required)
else:
raise Http404
diff --git a/templates/devel/index.html b/templates/devel/index.html
index 8bf8c91..29b98bd 100644
--- a/templates/devel/index.html
+++ b/templates/devel/index.html
@@ -104,6 +104,9 @@
<li><a href="reports/old/">Old</a>: Packages last built more than two years ago</li>
<li><a href="reports/uncompressed-man/">Uncompressed Manpages</a>: Self-explanatory</li>
<li><a href="reports/uncompressed-info/">Uncompressed Info Pages</a>: Self-explanatory</li>
+ <li><a href="reports/unneeded-orphans/">Unneeded Orphans</a>: Packages
+ that have no maintainer and are not required by any other package in
+ any repository</li>
</ul>
</div><!-- #dev-dashboard -->
diff --git a/templates/devel/packages.html b/templates/devel/packages.html
index 3b511c9..32cdf21 100644
--- a/templates/devel/packages.html
+++ b/templates/devel/packages.html
@@ -6,6 +6,7 @@
{% block content %}
<div class="box">
<h2>{{ title }}</h2>
+ <p>{{ packages|length }} package{{ packages|pluralize }} found.</p>
<table class="results">
<thead>
<tr>