1 |
From 6ead9b76de648747ae72ac572768ca1f464ff23e Mon Sep 17 00:00:00 2001 |
2 |
From: Brian Dolbec <dolsen@g.o> |
3 |
Date: Sat, 30 Apr 2016 08:55:41 -0700 |
4 |
Subject: [PATCH] repoman: Fix unsupported eapi continuing with remaining |
5 |
checks. bug 581600 |
6 |
|
7 |
Tighten up the xpkg loop and the use of the xpkg_continue bolean for invalid pkg or ebuilds. |
8 |
This still allows addtional checks for some types of errors, while completely bypassing the |
9 |
remaining checks for EAPI.unsupported. |
10 |
|
11 |
X-gentoo-bug: 581600 |
12 |
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=581600 |
13 |
--- |
14 |
|
15 |
I don't know if we should add more cases for it to abandon ship ;) and |
16 |
not perform more checks on the ebuilds with some of the failures |
17 |
detected in these exceptions. What wre your thoughts? |
18 |
|
19 |
|
20 |
pym/repoman/modules/scan/ebuild/ebuild.py | 15 ++++++++++++--- |
21 |
pym/repoman/scanner.py | 7 +++++++ |
22 |
2 files changed, 19 insertions(+), 3 deletions(-) |
23 |
|
24 |
diff --git a/pym/repoman/modules/scan/ebuild/ebuild.py b/pym/repoman/modules/scan/ebuild/ebuild.py |
25 |
index 28cb8b4..ddbea2f 100644 |
26 |
--- a/pym/repoman/modules/scan/ebuild/ebuild.py |
27 |
+++ b/pym/repoman/modules/scan/ebuild/ebuild.py |
28 |
@@ -166,7 +166,8 @@ class Ebuild(ScanBase): |
29 |
@param checkdir: current package directory path |
30 |
@param xpkg: current package directory being checked |
31 |
@param validity_future: Future instance |
32 |
- @returns: dictionary, including {pkgs, can_force} |
33 |
+ @param can_force: boolean |
34 |
+ @returns: bolean |
35 |
''' |
36 |
checkdirlist = kwargs.get('checkdirlist').get() |
37 |
checkdir = kwargs.get('checkdir') |
38 |
@@ -208,6 +209,7 @@ class Ebuild(ScanBase): |
39 |
if not portage.eapi_is_supported(myaux["EAPI"]): |
40 |
fuse.set(False, ignore_InvalidState=True) |
41 |
self.qatracker.add_error("EAPI.unsupported", os.path.join(xpkg, y)) |
42 |
+ self._abandon_ship(can_force) |
43 |
continue |
44 |
pkgs[pf] = Package( |
45 |
cpv=cpv, metadata=myaux, root_config=self.root_config, |
46 |
@@ -219,14 +221,21 @@ class Ebuild(ScanBase): |
47 |
# Do not try to do any more QA checks on this package since missing |
48 |
# metadata leads to false positives for several checks, and false |
49 |
# positives confuse users. |
50 |
- self.continue_ = True |
51 |
- can_force.set(False, ignore_InvalidState=True) |
52 |
+ self._abandon_ship(can_force) |
53 |
self.pkgs = pkgs |
54 |
# set our updated data |
55 |
dyn_pkgs = kwargs.get('pkgs') |
56 |
dyn_pkgs.set(pkgs) |
57 |
return self.continue_ |
58 |
|
59 |
+ def _abandon_ship(self, can_force): |
60 |
+ '''Internal function to set some important return values |
61 |
+ |
62 |
+ @param can_force: boolean |
63 |
+ ''' |
64 |
+ self.continue_ = True |
65 |
+ can_force.set(False, ignore_InvalidState=True) |
66 |
+ |
67 |
@property |
68 |
def runInPkgs(self): |
69 |
'''Package level scans''' |
70 |
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py |
71 |
index e383c8d..025603b 100644 |
72 |
--- a/pym/repoman/scanner.py |
73 |
+++ b/pym/repoman/scanner.py |
74 |
@@ -336,8 +336,15 @@ class Scanner(object): |
75 |
# Do not try to do any more QA checks on this package since missing |
76 |
# metadata leads to false positives for several checks, and false |
77 |
# positives confuse users. |
78 |
+ logging.debug("xpkg function loop, continue triggered from function: %s", |
79 |
+ func) |
80 |
xpkg_continue = True |
81 |
break |
82 |
+ if not dynamic_data['validity_future'].get() and xpkg_continue: |
83 |
+ logging.debug("Invalid ebuild detected...Aborting") |
84 |
+ break |
85 |
+ elif xpkg_continue: |
86 |
+ continue |
87 |
|
88 |
if xpkg_continue: |
89 |
continue |
90 |
-- |
91 |
2.8.1 |
92 |
|
93 |
|
94 |
|
95 |
-- |
96 |
Brian Dolbec <dolsen> |