public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH] repoman: Check for empty files in filesdir.
@ 2017-02-12 16:48 99% Ulrich Mueller
  0 siblings, 0 replies; 1+ results
From: Ulrich Mueller @ 2017-02-12 16:48 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 2867 bytes --]

This checks for files with zero size in filesdir. The QA script at
https://qa-reports.gentoo.org/output/find-binary-files.txt reports a
couple of them which at least in part are blunders.

Should be harmless enough not to need a discussion about policy in
gentoo-dev. Patch included below.

Ulrich


From 871b92a32cf947d266d829dfe3e3095ba62c49b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Sun, 12 Feb 2017 17:21:51 +0100
Subject: [PATCH] repoman: Check for empty files in filesdir.

---
 repoman/man/repoman.1                             | 5 ++++-
 repoman/pym/repoman/modules/scan/fetch/fetches.py | 3 +++
 repoman/pym/repoman/qa_data.py                    | 3 +++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
index 3b3aec27e..9b106906f 100644
--- a/repoman/man/repoman.1
+++ b/repoman/man/repoman.1
@@ -1,4 +1,4 @@
-.TH "REPOMAN" "1" "Dec 2016" "Repoman VERSION" "Repoman"
+.TH "REPOMAN" "1" "Feb 2017" "Repoman VERSION" "Repoman"
 .SH NAME
 repoman \- Gentoo's program to enforce a minimal level of quality assurance in
 packages added to the portage tree
@@ -328,6 +328,9 @@ error or digest verification failure.
 .B file.UTF8
 File is not UTF8 compliant
 .TP
+.B file.empty
+Empty file in the files directory
+.TP
 .B file.executable
 Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do not need the
 executable bit
diff --git a/repoman/pym/repoman/modules/scan/fetch/fetches.py b/repoman/pym/repoman/modules/scan/fetch/fetches.py
index 9ee3c652a..241cfaa7b 100644
--- a/repoman/pym/repoman/modules/scan/fetch/fetches.py
+++ b/repoman/pym/repoman/modules/scan/fetch/fetches.py
@@ -130,6 +130,9 @@ class FetchChecks(ScanBase):
 					self.qatracker.add_error(
 						"file.size", "(%d KiB) %s/files/%s" % (
 							mystat.st_size // 1024, xpkg, y))
+				elif mystat.st_size == 0:
+					self.qatracker.add_error(
+						"file.empty", "%s/files/%s" % (xpkg, y))
 
 				index = self.repo_settings.repo_config.find_invalid_path_char(y)
 				if index != -1:
diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py
index 29a95abf6..0dc32789f 100644
--- a/repoman/pym/repoman/qa_data.py
+++ b/repoman/pym/repoman/qa_data.py
@@ -67,6 +67,8 @@ qahelp = {
 		"Files in the files directory must be under 20 KiB"),
 	"file.size.fatal": (
 		"Files in the files directory must be under 60 KiB"),
+	"file.empty": (
+		"Empty file in the files directory"),
 	"file.name": (
 		"File/dir name must be composed"
 		" of only the following chars: %s " % allowed_filename_chars),
@@ -262,6 +264,7 @@ qawarnings = set((
 	"ebuild.minorsyn",
 	"ebuild.badheader",
 	"ebuild.patches",
+	"file.empty",
 	"file.size",
 	"inherit.unused",
 	"inherit.deprecated",
-- 
2.11.1

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-02-12 16:48 99% [gentoo-portage-dev] [PATCH] repoman: Check for empty files in filesdir Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox