* [gentoo-portage-dev] [PATCH] Fix unsupported eapi continuing with remaining checks
@ 2016-04-30 16:42 Brian Dolbec
2016-05-07 22:31 ` Zac Medico
0 siblings, 1 reply; 2+ messages in thread
From: Brian Dolbec @ 2016-04-30 16:42 UTC (permalink / raw
To: gentoo-portage-dev
From 6ead9b76de648747ae72ac572768ca1f464ff23e Mon Sep 17 00:00:00 2001
From: Brian Dolbec <dolsen@gentoo.org>
Date: Sat, 30 Apr 2016 08:55:41 -0700
Subject: [PATCH] repoman: Fix unsupported eapi continuing with remaining
checks. bug 581600
Tighten up the xpkg loop and the use of the xpkg_continue bolean for invalid pkg or ebuilds.
This still allows addtional checks for some types of errors, while completely bypassing the
remaining checks for EAPI.unsupported.
X-gentoo-bug: 581600
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=581600
---
I don't know if we should add more cases for it to abandon ship ;) and
not perform more checks on the ebuilds with some of the failures
detected in these exceptions. What wre your thoughts?
pym/repoman/modules/scan/ebuild/ebuild.py | 15 ++++++++++++---
pym/repoman/scanner.py | 7 +++++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/modules/scan/ebuild/ebuild.py b/pym/repoman/modules/scan/ebuild/ebuild.py
index 28cb8b4..ddbea2f 100644
--- a/pym/repoman/modules/scan/ebuild/ebuild.py
+++ b/pym/repoman/modules/scan/ebuild/ebuild.py
@@ -166,7 +166,8 @@ class Ebuild(ScanBase):
@param checkdir: current package directory path
@param xpkg: current package directory being checked
@param validity_future: Future instance
- @returns: dictionary, including {pkgs, can_force}
+ @param can_force: boolean
+ @returns: bolean
'''
checkdirlist = kwargs.get('checkdirlist').get()
checkdir = kwargs.get('checkdir')
@@ -208,6 +209,7 @@ class Ebuild(ScanBase):
if not portage.eapi_is_supported(myaux["EAPI"]):
fuse.set(False, ignore_InvalidState=True)
self.qatracker.add_error("EAPI.unsupported", os.path.join(xpkg, y))
+ self._abandon_ship(can_force)
continue
pkgs[pf] = Package(
cpv=cpv, metadata=myaux, root_config=self.root_config,
@@ -219,14 +221,21 @@ class Ebuild(ScanBase):
# Do not try to do any more QA checks on this package since missing
# metadata leads to false positives for several checks, and false
# positives confuse users.
- self.continue_ = True
- can_force.set(False, ignore_InvalidState=True)
+ self._abandon_ship(can_force)
self.pkgs = pkgs
# set our updated data
dyn_pkgs = kwargs.get('pkgs')
dyn_pkgs.set(pkgs)
return self.continue_
+ def _abandon_ship(self, can_force):
+ '''Internal function to set some important return values
+
+ @param can_force: boolean
+ '''
+ self.continue_ = True
+ can_force.set(False, ignore_InvalidState=True)
+
@property
def runInPkgs(self):
'''Package level scans'''
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index e383c8d..025603b 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -336,8 +336,15 @@ class Scanner(object):
# Do not try to do any more QA checks on this package since missing
# metadata leads to false positives for several checks, and false
# positives confuse users.
+ logging.debug("xpkg function loop, continue triggered from function: %s",
+ func)
xpkg_continue = True
break
+ if not dynamic_data['validity_future'].get() and xpkg_continue:
+ logging.debug("Invalid ebuild detected...Aborting")
+ break
+ elif xpkg_continue:
+ continue
if xpkg_continue:
continue
--
2.8.1
--
Brian Dolbec <dolsen>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] Fix unsupported eapi continuing with remaining checks
2016-04-30 16:42 [gentoo-portage-dev] [PATCH] Fix unsupported eapi continuing with remaining checks Brian Dolbec
@ 2016-05-07 22:31 ` Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2016-05-07 22:31 UTC (permalink / raw
To: gentoo-portage-dev
On 04/30/2016 09:42 AM, Brian Dolbec wrote:
> From 6ead9b76de648747ae72ac572768ca1f464ff23e Mon Sep 17 00:00:00 2001
> From: Brian Dolbec <dolsen@gentoo.org>
> Date: Sat, 30 Apr 2016 08:55:41 -0700
> Subject: [PATCH] repoman: Fix unsupported eapi continuing with remaining
> checks. bug 581600
>
> Tighten up the xpkg loop and the use of the xpkg_continue bolean for invalid pkg or ebuilds.
> This still allows addtional checks for some types of errors, while completely bypassing the
> remaining checks for EAPI.unsupported.
>
> X-gentoo-bug: 581600
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=581600
> ---
>
> I don't know if we should add more cases for it to abandon ship ;) and
> not perform more checks on the ebuilds with some of the failures
> detected in these exceptions. What wre your thoughts?
It seems like can_force indicates that a very severe problem has been
found, but it doesn't keep track of the specific problem that triggers
the state. I think it would make sense to use the qatracker to keep
track of this sort of state, with certain issues having a severity level
which triggers the "can't force" state.
Also, as we've discussed on irc, I think we should turn the plugin check
methods into generator methods that yield a series of issues. That way,
plugins will not need direct access to the qatracker, since they will
simply yield issues to it (including those issues that trigger the
"can't force" state).
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-07 22:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-30 16:42 [gentoo-portage-dev] [PATCH] Fix unsupported eapi continuing with remaining checks Brian Dolbec
2016-05-07 22:31 ` Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox