summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-04-30 01:21:43 +0200
committerDan McGee <dan@archlinux.org>2011-04-30 01:21:43 +0200
commit5379348c9337a4abe27e807fef7956e11eebed30 (patch)
treed85b6e3168fff72a2d179d1f4a064097e54cdef5 /devel
parente58eb76a1ab4d6f1293b717e21da68f5aa3e5c45 (diff)
downloadarchweb-5379348c9337a4abe27e807fef7956e11eebed30.tar.gz
archweb-5379348c9337a4abe27e807fef7956e11eebed30.tar.xz
Add unneeded orphans report
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/views.py9
1 files changed, 8 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