Fixes #1618, Problems with spack package-list

This commit is contained in:
Adam J. Stewart 2016-08-24 16:28:17 -05:00
parent 69e50595bf
commit 867a92f083

View file

@ -32,8 +32,8 @@
def github_url(pkg): def github_url(pkg):
"""Link to a package file on github.""" """Link to a package file on github."""
url = "https://github.com/llnl/spack/blob/master/var/spack/packages/%s/package.py" url = "https://github.com/LLNL/spack/blob/develop/var/spack/repos/builtin/packages/{0}/package.py"
return (url % pkg.name) return url.format(pkg.name)
def rst_table(elts): def rst_table(elts):
@ -51,35 +51,41 @@ def print_rst_package_list():
print ".. _package-list:" print ".. _package-list:"
print print
print "============"
print "Package List" print "Package List"
print "==================" print "============"
print
print "This is a list of things you can install using Spack. It is" 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 "automatically generated based on the packages in the latest Spack"
print "release." print "release."
print print
print "Spack currently has %d mainline packages:" % len(pkgs) print "Spack currently has %d mainline packages:" % len(pkgs)
print print
print rst_table("`%s`_" % p for p in pkg_names) print rst_table("`%s`_" % p for p in pkg_names)
print print
print "-----"
# Output some text for each package. # Output some text for each package.
for pkg in pkgs: for pkg in pkgs:
print "-----"
print print
print ".. _%s:" % pkg.name print ".. _%s:" % pkg.name
print print
# Must be at least 2 long, breaks for single letter packages like R.
print "-" * max(len(pkg.name), 2)
print pkg.name print pkg.name
print "-" * len(pkg.name) print "-" * max(len(pkg.name), 2)
print "Links:" print
print "Homepage:"
print " * `%s <%s>`__" % (cgi.escape(pkg.homepage), pkg.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 " * `%s/package.py <%s>`__" % (pkg.name, github_url(pkg))
print print
if pkg.versions: if pkg.versions:
print "Versions:" print "Versions:"
print " " + ", ".join(str(v) for v in print " " + ", ".join(str(v) for v in
reversed(sorted(pkg.versions))) reversed(sorted(pkg.versions)))
print
for deptype in spack.alldeps: for deptype in spack.alldeps:
deps = pkg.dependencies_of_type(deptype) deps = pkg.dependencies_of_type(deptype)
@ -92,7 +98,6 @@ def print_rst_package_list():
print "Description:" print "Description:"
print pkg.format_doc(indent=2) print pkg.format_doc(indent=2)
print print
print "-----"
def package_list(parser, args): def package_list(parser, args):