summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-07-18 14:12:47 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-07-18 14:12:47 +0200
commita96eb7096de0c39d9157019525b024760d2bc80b (patch)
treef61ce01349fa5a1816125d100cff935fa92514c7 /share
parent1f3cb2b93cbeb6bcf5f49f9b6921c4a1d0ddeadd (diff)
parentb3789a469317ccb0fbbe73d6ab1f883be41a35ab (diff)
downloadspack-a96eb7096de0c39d9157019525b024760d2bc80b.tar.gz
spack-a96eb7096de0c39d9157019525b024760d2bc80b.tar.bz2
spack-a96eb7096de0c39d9157019525b024760d2bc80b.tar.xz
spack-a96eb7096de0c39d9157019525b024760d2bc80b.zip
Merge branch 'develop' of https://github.com/LLNL/spack into features/module_refresh
Conflicts: share/spack/setup-env.sh
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/qa/run-flake83
-rwxr-xr-xshare/spack/setup-env.sh28
2 files changed, 22 insertions, 9 deletions
diff --git a/share/spack/qa/run-flake8 b/share/spack/qa/run-flake8
index 57534eb6e2..595df417ec 100755
--- a/share/spack/qa/run-flake8
+++ b/share/spack/qa/run-flake8
@@ -18,7 +18,7 @@ if [[ ! $flake8 ]]; then
fi
# Check if changed files are flake8 conformant [framework]
-changed=$(git diff --name-only develop... | grep '.py$')
+changed=$(git diff --name-only --find-renames develop... | grep '.py$')
# Add approved style exemptions to the changed packages.
for file in $changed; do
@@ -26,6 +26,7 @@ for file in $changed; do
cp "$file" "$file~"
# Exempt lines with urls and descriptions from overlong line errors.
+ perl -i -pe 's/^(\s*homepage\s*=.*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*url\s*=.*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*version\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*variant\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 3975672e7b..c6183f990d 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -57,6 +57,11 @@
########################################################################
function spack {
+ # Zsh does not do word splitting by default, this enables it for this function only
+ if [ -n "$ZSH_VERSION" ]; then
+ emulate -L sh
+ fi
+
# save raw arguments into an array before butchering them
args=( "$@" )
@@ -93,11 +98,18 @@ function spack {
;;
"use"|"unuse"|"load"|"unload")
# Shift any other args for use off before parsing spec.
+ _sp_subcommand_args=""
_sp_module_args=""
- if [[ "$1" =~ ^- ]]; then
- _sp_module_args="$1"; shift
- _sp_spec="$@"
- fi
+ while [[ "$1" =~ ^- ]]; do
+ if [ "$1" = "-r" -o "$1" = "--dependencies" ]; then
+ _sp_subcommand_args="$_sp_subcommand_args $1"
+ else
+ _sp_module_args="$_sp_module_args $1"
+ fi
+ shift
+ done
+
+ _sp_spec="$@"
# Here the user has run use or unuse with a spec. Find a matching
# spec using 'spack module find', then use the appropriate module
@@ -105,19 +117,19 @@ function spack {
# If spack module command comes back with an error, do nothing.
case $_sp_subcommand in
"use")
- if _sp_full_spec=$(command spack $_sp_flags module find --module-type dotkit $_sp_spec); then
+ if _sp_full_spec=$(command spack $_sp_flags module find $_sp_subcommand_args --module-type dotkit $_sp_spec); then
use $_sp_module_args $_sp_full_spec
fi ;;
"unuse")
- if _sp_full_spec=$(command spack $_sp_flags module find --module-type dotkit $_sp_spec); then
+ if _sp_full_spec=$(command spack $_sp_flags module find $_sp_subcommand_args --module-type dotkit $_sp_spec); then
unuse $_sp_module_args $_sp_full_spec
fi ;;
"load")
- if _sp_full_spec=$(command spack $_sp_flags module find --module-type tcl $_sp_spec); then
+ if _sp_full_spec=$(command spack $_sp_flags module find $_sp_subcommand_args --module-type tcl $_sp_spec); then
module load $_sp_module_args $_sp_full_spec
fi ;;
"unload")
- if _sp_full_spec=$(command spack $_sp_flags module find --module-type tcl $_sp_spec); then
+ if _sp_full_spec=$(command spack $_sp_flags module find $_sp_subcommand_args --module-type tcl $_sp_spec); then
module unload $_sp_module_args $_sp_full_spec
fi ;;
esac