summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-12-29 01:52:03 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2014-12-29 01:52:03 -0800
commit226de0a42d9a59c735edaf5075cbfc7ec3c53125 (patch)
tree5811ee8b81cc3932d68b5f4a8bb7d2dafd05174f /lib
parenta6e00f6086467eda633e099d3ed7696bd85184e7 (diff)
downloadspack-226de0a42d9a59c735edaf5075cbfc7ec3c53125.tar.gz
spack-226de0a42d9a59c735edaf5075cbfc7ec3c53125.tar.bz2
spack-226de0a42d9a59c735edaf5075cbfc7ec3c53125.tar.xz
spack-226de0a42d9a59c735edaf5075cbfc7ec3c53125.zip
Spec graph works without color.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/spec.py13
-rw-r--r--lib/spack/spack/spec.py18
2 files changed, 12 insertions, 19 deletions
diff --git a/lib/spack/spack/cmd/spec.py b/lib/spack/spack/cmd/spec.py
index 6f987d96d7..71bc12d6f5 100644
--- a/lib/spack/spack/cmd/spec.py
+++ b/lib/spack/spack/cmd/spec.py
@@ -46,15 +46,12 @@ def spec(parser, args):
spec.normalize()
print spec.tree(color=True, indent=2, cover='paths')
- print
- print spec.topological_sort(reverse=True)
- print
- print "Graph"
- print "------------------------------"
- print spec.graph()
- return
-
print "Concretized"
print "------------------------------"
spec.concretize()
print spec.tree(color=True, indent=2)
+
+ print "Graph"
+ print "------------------------------"
+ spec.graph()
+ return
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 3386af8d7f..0720fe6212 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -1343,7 +1343,6 @@ class Spec(object):
frontier = []
- debug = True
debug = False
def back_edge(end, start):
@@ -1367,7 +1366,10 @@ class Spec(object):
out.write("| " * end)
out.write("|/")
out.write("| " * (start - end - 1))
- out.write(" /" * (len(frontier) - start))
+ if (start - end) > 1:
+ out.write("| " * (len(frontier) - start))
+ else:
+ out.write(" /" * (len(frontier) - start))
out.write("\n")
@@ -1424,6 +1426,9 @@ class Spec(object):
deps = [name]
connect_deps(i, deps)
+ if i+1 < len(frontier) and len(frontier[i+1]) == 1:
+ deps = frontier.pop(i+1)
+ connect_deps(i+1, deps)
else:
name = topo_order.pop()
@@ -1452,15 +1457,6 @@ class Spec(object):
out.write("\n")
- out.write("\n")
- out.write("%s\n" % frontier)
-
- # Reverse the lines in the output
- #return '\n'.join(reversed(out.getvalue().split('\n')))
-
- return "" #out.getvalue()
-
-
def topological_sort(self, **kwargs):
"""Return a list of dependency specs sorted topologically.
This spec is not modified in the process."""