From f242f5f8a99f6fa5bd2739a4f1fdd9b41c44e92e Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Wed, 17 Apr 2019 18:21:40 -0700 Subject: Features: Improve Spec format strings (#10556) * Update spec format to simpler syntax, maintain backwards compatibility * Switch to new spec.format method throughout internals * update package files for new format strings * documentation and minor code cleanup. removed nonsensical variant sigils --- var/spack/repos/builtin/packages/gcc/package.py | 2 +- var/spack/repos/builtin/packages/of-adios-write/package.py | 4 +++- var/spack/repos/builtin/packages/of-precice/package.py | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 9753a0bb93..0d4a9ace48 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -397,7 +397,7 @@ class Gcc(AutotoolsPackage): the compiler used to build the executable.""" if not self.spec_dir: tty.warn('Could not install specs for {0}.'.format( - self.spec.format('$_$@'))) + self.spec.format('{name}{@version}'))) return gcc = self.spec['gcc'].command diff --git a/var/spack/repos/builtin/packages/of-adios-write/package.py b/var/spack/repos/builtin/packages/of-adios-write/package.py index 541219da0e..f2265cc974 100644 --- a/var/spack/repos/builtin/packages/of-adios-write/package.py +++ b/var/spack/repos/builtin/packages/of-adios-write/package.py @@ -67,7 +67,9 @@ class OfAdiosWrite(Package): add_extra_files(self, self.common, self.assets) # Emit openfoam version immediately, if we resolved the wrong version # it takes a very long time to rebuild! - tty.info('Build for ' + self.spec['openfoam'].format('$_$@$%@+$+')) + tty.info('Build for ' + self.spec['openfoam'].format( + '{name}{@version}{%compiler}{compiler_flags}{variants}' + )) def configure(self, spec, prefix): """Generate spack-config.sh file.""" diff --git a/var/spack/repos/builtin/packages/of-precice/package.py b/var/spack/repos/builtin/packages/of-precice/package.py index 36ed6be5be..82e486dbfc 100644 --- a/var/spack/repos/builtin/packages/of-precice/package.py +++ b/var/spack/repos/builtin/packages/of-precice/package.py @@ -42,7 +42,9 @@ class OfPrecice(Package): add_extra_files(self, self.common, self.assets) # Emit openfoam version immediately, if we resolved the wrong version # it takes a very long time to rebuild! - tty.info('Build for ' + self.spec['openfoam'].format('$_$@$%@+$+')) + tty.info('Build for ' + self.spec['openfoam'].format( + '{name}{@version}{%compiler}{compiler_flags}{variants}' + )) def configure(self, spec, prefix): """Generate spack-config.sh file.""" -- cgit v1.2.3-70-g09d2