summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-10-22 10:39:33 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-10-22 10:39:33 +0200
commitc84123dce5a576c0f677eb5918858591851b3921 (patch)
tree971c10f736c0bb9720c488e76adfcff0e632dc57 /lib
parent482f60d1d37d8d18ff62318c23a72808ceacd99e (diff)
downloadspack-c84123dce5a576c0f677eb5918858591851b3921.tar.gz
spack-c84123dce5a576c0f677eb5918858591851b3921.tar.bz2
spack-c84123dce5a576c0f677eb5918858591851b3921.tar.xz
spack-c84123dce5a576c0f677eb5918858591851b3921.zip
spack info : shows the build-system class used
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/info.py7
-rw-r--r--lib/spack/spack/package.py12
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py
index 0171d28fde..5366ad4aa8 100644
--- a/lib/spack/spack/cmd/info.py
+++ b/lib/spack/spack/cmd/info.py
@@ -48,8 +48,11 @@ def setup_parser(subparser):
def print_text_info(pkg):
"""Print out a plain text description of a package."""
- print "Package: ", pkg.name
- print "Homepage: ", pkg.homepage
+ header = "{0}: ".format(pkg.build_system_class)
+
+ print header, pkg.name
+ whitespaces = ''.join([' '] * (len(header) - len("Homepage: ")))
+ print "Homepage:", whitespaces, pkg.homepage
print
print "Safe versions: "
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 75a708de9c..bc39c6400d 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1674,6 +1674,9 @@ class PackageBase(object):
class Package(PackageBase):
phases = ['install']
+ # To be used in UI queries that require to know which
+ # build-system class we are using
+ build_system_class = 'Package'
# This will be used as a registration decorator in user
# packages, if need be
PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)
@@ -1681,6 +1684,9 @@ class Package(PackageBase):
class EditableMakefile(PackageBase):
phases = ['edit', 'build', 'install']
+ # To be used in UI queries that require to know which
+ # build-system class we are using
+ build_system_class = 'EditableMakefile'
def wdir(self):
return self.stage.source_path
@@ -1709,6 +1715,9 @@ class EditableMakefile(PackageBase):
class AutotoolsPackage(PackageBase):
phases = ['autoreconf', 'configure', 'build', 'install']
+ # To be used in UI queries that require to know which
+ # build-system class we are using
+ build_system_class = 'AutotoolsPackage'
def autoreconf(self, spec, prefix):
"""Not needed usually, configure should be already there"""
@@ -1750,6 +1759,9 @@ class AutotoolsPackage(PackageBase):
class CMakePackage(PackageBase):
phases = ['cmake', 'build', 'install']
+ # To be used in UI queries that require to know which
+ # build-system class we are using
+ build_system_class = 'CMakePackage'
def build_type(self):
return 'RelWithDebInfo'