Better info command.

This commit is contained in:
Todd Gamblin 2013-12-12 01:04:32 -08:00
parent 7575f99bea
commit c7539fe950
2 changed files with 38 additions and 0 deletions

View file

@ -1,5 +1,9 @@
import re
import textwrap
import spack import spack
import spack.packages as packages import spack.packages as packages
from spack.colify import colify
description = "Build and install packages" description = "Build and install packages"
@ -9,5 +13,31 @@ def setup_parser(subparser):
def info(parser, args): def info(parser, args):
package = packages.get(args.name) package = packages.get(args.name)
print "Package: ", package.name
print "Homepage: ", package.homepage print "Homepage: ", package.homepage
print "Download: ", package.url print "Download: ", package.url
print
print "Dependencies:"
if package.dependencies:
colify(package.dependencies, indent=4)
else:
print " None"
print
print "Virtual packages: "
if package.provided:
for spec, when in package.provided.items():
print " %s provides %s" % (when, spec)
else:
print " None"
print
print "Description:"
if package.__doc__:
doc = re.sub(r'\s+', ' ', package.__doc__)
lines = textwrap.wrap(doc, 72)
for line in lines:
print " " + line
else:
print " None"

View file

@ -1,6 +1,9 @@
from spack import * from spack import *
class Mpich(Package): class Mpich(Package):
"""MPICH is a high performance and widely portable implementation of
the Message Passing Interface (MPI) standard."""
homepage = "http://www.mpich.org" homepage = "http://www.mpich.org"
url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz"
md5 = "9c5d5d4fe1e17dd12153f40bc5b6dbc0" md5 = "9c5d5d4fe1e17dd12153f40bc5b6dbc0"
@ -8,6 +11,11 @@ class Mpich(Package):
list_url = "http://www.mpich.org/static/downloads/" list_url = "http://www.mpich.org/static/downloads/"
list_depth = 2 list_depth = 2
versions = ['3.0.4', '3.0.3', '3.0.2', '3.0.1', '3.0']
provides('mpi@:3', when='@3:')
provides('mpi@:1', when='@1:')
def install(self, prefix): def install(self, prefix):
configure("--prefix=%s" % prefix) configure("--prefix=%s" % prefix)
make() make()