Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: repoman/man/, repoman/pym/repoman/modules/scan/fetch/, repoman/pym/repoman/
Date: Sun, 12 Feb 2017 17:43:08
Message-Id: 1486920165.04e5f8dee2130901386f4f1b65328bbf0b8104c1.zmedico@gentoo
1 commit: 04e5f8dee2130901386f4f1b65328bbf0b8104c1
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 12 16:21:51 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 12 17:22:45 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=04e5f8de
7
8 repoman: Check for empty files in filesdir.
9
10 This checks for files with zero size in filesdir. The QA script at
11 https://qa-reports.gentoo.org/output/find-binary-files.txt reports a
12 couple of them which at least in part are blunders.
13
14 repoman/man/repoman.1 | 5 ++++-
15 repoman/pym/repoman/modules/scan/fetch/fetches.py | 3 +++
16 repoman/pym/repoman/qa_data.py | 3 +++
17 3 files changed, 10 insertions(+), 1 deletion(-)
18
19 diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
20 index 3b3aec27e..9b106906f 100644
21 --- a/repoman/man/repoman.1
22 +++ b/repoman/man/repoman.1
23 @@ -1,4 +1,4 @@
24 -.TH "REPOMAN" "1" "Dec 2016" "Repoman VERSION" "Repoman"
25 +.TH "REPOMAN" "1" "Feb 2017" "Repoman VERSION" "Repoman"
26 .SH NAME
27 repoman \- Gentoo's program to enforce a minimal level of quality assurance in
28 packages added to the portage tree
29 @@ -328,6 +328,9 @@ error or digest verification failure.
30 .B file.UTF8
31 File is not UTF8 compliant
32 .TP
33 +.B file.empty
34 +Empty file in the files directory
35 +.TP
36 .B file.executable
37 Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do not need the
38 executable bit
39
40 diff --git a/repoman/pym/repoman/modules/scan/fetch/fetches.py b/repoman/pym/repoman/modules/scan/fetch/fetches.py
41 index 9ee3c652a..241cfaa7b 100644
42 --- a/repoman/pym/repoman/modules/scan/fetch/fetches.py
43 +++ b/repoman/pym/repoman/modules/scan/fetch/fetches.py
44 @@ -130,6 +130,9 @@ class FetchChecks(ScanBase):
45 self.qatracker.add_error(
46 "file.size", "(%d KiB) %s/files/%s" % (
47 mystat.st_size // 1024, xpkg, y))
48 + elif mystat.st_size == 0:
49 + self.qatracker.add_error(
50 + "file.empty", "%s/files/%s" % (xpkg, y))
51
52 index = self.repo_settings.repo_config.find_invalid_path_char(y)
53 if index != -1:
54
55 diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py
56 index 29a95abf6..0dc32789f 100644
57 --- a/repoman/pym/repoman/qa_data.py
58 +++ b/repoman/pym/repoman/qa_data.py
59 @@ -67,6 +67,8 @@ qahelp = {
60 "Files in the files directory must be under 20 KiB"),
61 "file.size.fatal": (
62 "Files in the files directory must be under 60 KiB"),
63 + "file.empty": (
64 + "Empty file in the files directory"),
65 "file.name": (
66 "File/dir name must be composed"
67 " of only the following chars: %s " % allowed_filename_chars),
68 @@ -262,6 +264,7 @@ qawarnings = set((
69 "ebuild.minorsyn",
70 "ebuild.badheader",
71 "ebuild.patches",
72 + "file.empty",
73 "file.size",
74 "inherit.unused",
75 "inherit.deprecated",