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.
This commit is contained in:
Ben Boeckel 2017-10-31 11:39:57 -04:00 committed by scheibelp
parent a81485cb3f
commit be01b2d5f0

View file

@ -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()