From be01b2d5f0452a7a5f1cbc5e1d58193c899bc0cc Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 31 Oct 2017 11:39:57 -0400 Subject: [PATCH] aspell: refuse to work with non-global extensions Aspell compiles in the paths it looks for rather than looking relative to its binary location. There are also no environment variables to redirect it other than changing the path to the configuration file it looks at. --- var/spack/repos/builtin/packages/aspell/package.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/aspell/package.py b/var/spack/repos/builtin/packages/aspell/package.py index 042246bbca..f9dbfdd43c 100644 --- a/var/spack/repos/builtin/packages/aspell/package.py +++ b/var/spack/repos/builtin/packages/aspell/package.py @@ -25,7 +25,7 @@ from spack import * from llnl.util.link_tree import LinkTree import spack.store -from spack.package import ExtensionConflictError +from spack.package import ExtensionError, ExtensionConflictError # See also: AspellDictPackage @@ -47,6 +47,12 @@ class Aspell(AutotoolsPackage): # - extension.prefix.lib instead of extension.prefix in LinkTree() # - dest_dir instead of self.prefix in tree.(find_conflict|merge)() def activate(self, extension, **kwargs): + extensions_layout = kwargs.get("extensions_layout", + spack.store.extensions) + if extensions_layout is not spack.store.extensions: + raise ExtensionError( + 'aspell does not support non-global extensions') + aspell = which(self.prefix.bin.aspell) dest_dir = aspell('dump', 'config', 'dict-dir', output=str).strip() tree = LinkTree(extension.prefix.lib) @@ -62,6 +68,12 @@ def ignore(filename): tree.merge(dest_dir, ignore=ignore) def deactivate(self, extension, **kwargs): + extensions_layout = kwargs.get("extensions_layout", + spack.store.extensions) + if extensions_layout is not spack.store.extensions: + raise ExtensionError( + 'aspell does not support non-global extensions') + aspell = which(self.prefix.bin.aspell) dest_dir = aspell('dump', 'config', 'dict-dir', output=str).strip()