From 9c6184373752746e1219263c1afd9d1955911891 Mon Sep 17 00:00:00 2001
From: Todd Gamblin <tgamblin@llnl.gov>
Date: Tue, 8 Mar 2016 13:58:41 -0800
Subject: Fix bugs in DIYStage: fetch & context handling.

- DIYStage needs to be a context handler
- DIYStage.fetch needs to take 2 args.
---
 lib/spack/spack/stage.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index d2ed03c271..5354135e6a 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -477,10 +477,14 @@ class DIYStage(object):
         else:
             raise ChdirError("Setup failed: no such directory: " + self.path)
 
+    # DIY stages do nothing as context managers.
+    def __enter__(self): pass
+    def __exit__(self, exc_type, exc_val, exc_tb): pass
+
     def chdir_to_source(self):
         self.chdir()
 
-    def fetch(self):
+    def fetch(self, mirror_only):
         tty.msg("No need to fetch for DIY.")
 
     def check(self):
-- 
cgit v1.2.3-70-g09d2