packages : moved decorators into AutotoolsPackage and CMakePackage

This commit is contained in:
alalazo
2016-10-22 01:03:07 +02:00
parent 012da99644
commit 482f60d1d3
5 changed files with 23 additions and 16 deletions

View File

@@ -1733,6 +1733,16 @@ def build(self, spec, prefix):
def install(self, spec, prefix):
inspect.getmodule(self).make('install')
@PackageBase.sanity_check('build')
@PackageBase.on_package_attributes(run_tests=True)
def _run_default_function(self):
try:
fn = getattr(self, 'check')
tty.msg('Trying default sanity checks [check]')
fn()
except AttributeError:
tty.msg('Skipping default sanity checks [method `check` not implemented]') # NOQA: ignore=E501
# This will be used as a registration decorator in user
# packages, if need be
PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)
@@ -1792,6 +1802,16 @@ def install(self, spec, prefix):
with working_dir(self.wdir()):
inspect.getmodule(self).make('install')
@PackageBase.sanity_check('build')
@PackageBase.on_package_attributes(run_tests=True)
def _run_default_function(self):
try:
fn = getattr(self, 'check')
tty.msg('Trying default sanity checks [check]')
fn()
except AttributeError:
tty.msg('Skipping default sanity checks [method `check` not implemented]') # NOQA: ignore=E501
PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)