From fa6f85f127f5f100f98c0ce130cea2277cd02a0e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 12 Feb 2012 22:47:25 -0600 Subject: Reduce false positives returned by uncompressed manpages report Explicitly exclude '.html' files from the report. This fixes the issue noted in FS#28372. We also add `is_directory=False` to both the manpage and info page queries; this could help the database come up with a better plan. Signed-off-by: Dan McGee --- devel/views.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/devel/views.py b/devel/views.py index 35918d6..5f1aed5 100644 --- a/devel/views.py +++ b/devel/views.py @@ -209,8 +209,10 @@ def report(request, report_name, username=None): elif report_name == 'uncompressed-man': title = 'Packages with uncompressed manpages' # checking for all '.0'...'.9' + '.n' extensions - bad_files = PackageFile.objects.filter(directory__contains='/man/', - filename__regex=r'\.[0-9n]').exclude(filename__endswith='.gz') + bad_files = PackageFile.objects.filter(is_directory=False, + directory__contains='/man/', + filename__regex=r'\.[0-9n]').exclude( + filename__endswith='.gz').exclude(filename__endswith='.html') if username: pkg_ids = set(packages.values_list('id', flat=True)) bad_files = bad_files.filter(pkg__in=pkg_ids) @@ -220,8 +222,8 @@ def report(request, report_name, username=None): title = 'Packages with uncompressed infopages' # we don't worry about looking for '*.info-1', etc., given that an # uncompressed root page probably exists in the package anyway - bad_files = PackageFile.objects.filter(directory__endswith='/info/', - filename__endswith='.info') + bad_files = PackageFile.objects.filter(is_directory=False, + directory__endswith='/info/', filename__endswith='.info') if username: pkg_ids = set(packages.values_list('id', flat=True)) bad_files = bad_files.filter(pkg__in=pkg_ids) -- cgit v1.2.3-24-g4f1b