Refactor args for Executable.__call__

- simplify output, error, and input redirection
- `return_output=True` is now `output=str`
- `return_output=True` will still work for the time being but is
  deprecated.

- previously you could say `return_output=True` and `output=<stream>`,
  which wouldn't actually write to the stream.  Now you actually can't
  specify erroneous cases since there is only one parameter with
  mutually exclusive options..
This commit is contained in:
Todd Gamblin
2016-01-21 02:40:38 -08:00
parent 25f7dbd3e9
commit 10848c2e9a
11 changed files with 116 additions and 60 deletions

View File

@@ -50,7 +50,7 @@ class Gcc(Package):
version('4.5.4', '27e459c2566b8209ab064570e1b378f7')
variant('gold', default=True, description="Build the gold linker plugin for ld-based LTO")
depends_on("mpfr")
depends_on("gmp")
depends_on("mpc") # when @4.5:
@@ -102,7 +102,7 @@ def install(self, spec, prefix):
configure(*options)
make()
make("install")
self.write_rpath_specs()
@@ -121,7 +121,7 @@ def write_rpath_specs(self):
return
gcc = Executable(join_path(self.prefix.bin, 'gcc'))
lines = gcc('-dumpspecs', return_output=True).strip().split("\n")
lines = gcc('-dumpspecs', output=str).strip().split("\n")
specs_file = join_path(self.spec_dir, 'specs')
with closing(open(specs_file, 'w')) as out:
for line in lines: