Skip to content
Snippets Groups Projects
Commit ae9a9e01 authored by Massimiliano Culpo's avatar Massimiliano Culpo Committed by GitHub
Browse files

spack: no stacktrace if not in debug mode + fix emacs variant (#4098)

* spack: no stacktrace if not in debug mode + fix emacs variant

* emacs: removed dead code
parent 72d45f7a
Branches
Tags
No related merge requests found
...@@ -194,6 +194,8 @@ def _main(args, unknown_args): ...@@ -194,6 +194,8 @@ def _main(args, unknown_args):
return_val = command(parser, args) return_val = command(parser, args)
except SpackError as e: except SpackError as e:
e.die() e.die()
except Exception as e:
tty.die(str(e))
except KeyboardInterrupt: except KeyboardInterrupt:
sys.stderr.write('\n') sys.stderr.write('\n')
tty.die("Keyboard interrupt.") tty.die("Keyboard interrupt.")
......
...@@ -389,9 +389,9 @@ def _value_setter(self, value): ...@@ -389,9 +389,9 @@ def _value_setter(self, value):
self._original_value = value self._original_value = value
self._value = False self._value = False
else: else:
msg = 'cannot construct a BoolValuedVariant from ' msg = 'cannot construct a BoolValuedVariant for "{0}" from '
msg += 'a value that does not represent a bool' msg += 'a value that does not represent a bool'
raise ValueError(msg) raise ValueError(msg.format(self.name))
def __contains__(self, item): def __contains__(self, item):
return item is self.value return item is self.value
......
...@@ -36,8 +36,12 @@ class Emacs(AutotoolsPackage): ...@@ -36,8 +36,12 @@ class Emacs(AutotoolsPackage):
version('24.5', 'd74b597503a68105e61b5b9f6d065b44') version('24.5', 'd74b597503a68105e61b5b9f6d065b44')
variant('X', default=False, description="Enable an X toolkit") variant('X', default=False, description="Enable an X toolkit")
variant('toolkit', default='gtk', variant(
description="Select an X toolkit (gtk, athena)") 'toolkit',
default='gtk',
values=('gtk', 'athena'),
description="Select an X toolkit (gtk, athena)"
)
depends_on('pkg-config@0.9.0:', type='build') depends_on('pkg-config@0.9.0:', type='build')
...@@ -53,12 +57,9 @@ class Emacs(AutotoolsPackage): ...@@ -53,12 +57,9 @@ class Emacs(AutotoolsPackage):
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
args = []
toolkit = spec.variants['toolkit'].value toolkit = spec.variants['toolkit'].value
if '+X' in spec: if '+X' in spec:
if toolkit not in ('gtk', 'athena'):
raise InstallError("toolkit must be in (gtk, athena), not %s" %
toolkit)
args = [ args = [
'--with-x', '--with-x',
'--with-x-toolkit={0}'.format(toolkit) '--with-x-toolkit={0}'.format(toolkit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment