summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2016-08-24 16:28:17 -0500
committerAdam J. Stewart <ajstewart426@gmail.com>2016-08-30 15:32:54 -0500
commit867a92f08395aa2ceab3ba58f2fe229682b8c2c9 (patch)
treefc954f0c88d1cd3be0bfa32a42abe93e092d5e17 /lib
parent69e50595bf97fa9cd8b6b3c740f75802a6f0f0dd (diff)
downloadspack-867a92f08395aa2ceab3ba58f2fe229682b8c2c9.tar.gz
spack-867a92f08395aa2ceab3ba58f2fe229682b8c2c9.tar.bz2
spack-867a92f08395aa2ceab3ba58f2fe229682b8c2c9.tar.xz
spack-867a92f08395aa2ceab3ba58f2fe229682b8c2c9.zip
Fixes #1618, Problems with spack package-list
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/package-list.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/spack/spack/cmd/package-list.py b/lib/spack/spack/cmd/package-list.py
index 9ed42de823..42f408af96 100644
--- a/lib/spack/spack/cmd/package-list.py
+++ b/lib/spack/spack/cmd/package-list.py
@@ -32,8 +32,8 @@ description = "Print a list of all packages in reStructuredText."
def github_url(pkg):
"""Link to a package file on github."""
- url = "https://github.com/llnl/spack/blob/master/var/spack/packages/%s/package.py"
- return (url % pkg.name)
+ url = "https://github.com/LLNL/spack/blob/develop/var/spack/repos/builtin/packages/{0}/package.py"
+ return url.format(pkg.name)
def rst_table(elts):
@@ -51,35 +51,41 @@ def print_rst_package_list():
print ".. _package-list:"
print
+ print "============"
print "Package List"
- print "=================="
-
+ print "============"
+ print
print "This is a list of things you can install using Spack. It is"
print "automatically generated based on the packages in the latest Spack"
print "release."
print
-
print "Spack currently has %d mainline packages:" % len(pkgs)
print
print rst_table("`%s`_" % p for p in pkg_names)
print
- print "-----"
# Output some text for each package.
for pkg in pkgs:
+ print "-----"
print
print ".. _%s:" % pkg.name
print
+ # Must be at least 2 long, breaks for single letter packages like R.
+ print "-" * max(len(pkg.name), 2)
print pkg.name
- print "-" * len(pkg.name)
- print "Links:"
+ print "-" * max(len(pkg.name), 2)
+ print
+ print "Homepage:"
print " * `%s <%s>`__" % (cgi.escape(pkg.homepage), pkg.homepage)
+ print
+ print "Spack package:"
print " * `%s/package.py <%s>`__" % (pkg.name, github_url(pkg))
print
if pkg.versions:
print "Versions:"
print " " + ", ".join(str(v) for v in
reversed(sorted(pkg.versions)))
+ print
for deptype in spack.alldeps:
deps = pkg.dependencies_of_type(deptype)
@@ -92,7 +98,6 @@ def print_rst_package_list():
print "Description:"
print pkg.format_doc(indent=2)
print
- print "-----"
def package_list(parser, args):