summaryrefslogtreecommitdiff
path: root/lib/spack/spack/hooks/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/hooks/__init__.py')
-rw-r--r--lib/spack/spack/hooks/__init__.py39
1 files changed, 10 insertions, 29 deletions
diff --git a/lib/spack/spack/hooks/__init__.py b/lib/spack/spack/hooks/__init__.py
index 5bf4110608..b25dfeade2 100644
--- a/lib/spack/spack/hooks/__init__.py
+++ b/lib/spack/spack/hooks/__init__.py
@@ -1,27 +1,8 @@
-##############################################################################
-# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
-# Produced at the Lawrence Livermore National Laboratory.
+# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
-# This file is part of Spack.
-# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
-# LLNL-CODE-647188
-#
-# For details, see https://github.com/spack/spack
-# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License (as
-# published by the Free Software Foundation) version 2.1, February 1999.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
-# conditions of the GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##############################################################################
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
"""This package contains modules with hooks for various stages in the
Spack install process. You can add modules here and they'll be
executed by package at various times during the package lifecycle.
@@ -41,20 +22,20 @@
systems (e.g. modules, dotkit, etc.) or to add other custom
features.
"""
-import imp
+import os.path
-import spack
-from llnl.util.filesystem import join_path
+import spack.paths
+import spack.util.imp as simp
from llnl.util.lang import memoized, list_modules
@memoized
def all_hook_modules():
modules = []
- for name in list_modules(spack.hooks_path):
+ for name in list_modules(spack.paths.hooks_path):
mod_name = __name__ + '.' + name
- path = join_path(spack.hooks_path, name) + ".py"
- mod = imp.load_source(mod_name, path)
+ path = os.path.join(spack.paths.hooks_path, name) + ".py"
+ mod = simp.load_source(mod_name, path)
modules.append(mod)
return modules