Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
eb286bb8
Unverified
Commit
eb286bb8
authored
5 years ago
by
Massimiliano Culpo
Committed by
Todd Gamblin
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Specs with quoted flags containing spaces are parsed correctly (#13521)
parent
1cc69e1c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/cmd/__init__.py
+4
-1
4 additions, 1 deletion
lib/spack/spack/cmd/__init__.py
lib/spack/spack/test/cmd/common/arguments.py
+18
-0
18 additions, 0 deletions
lib/spack/spack/test/cmd/common/arguments.py
with
22 additions
and
1 deletion
lib/spack/spack/cmd/__init__.py
+
4
−
1
View file @
eb286bb8
...
...
@@ -24,6 +24,7 @@
import
spack.spec
import
spack.store
import
spack.util.spack_json
as
sjson
import
spack.util.string
from
spack.error
import
SpackError
...
...
@@ -134,7 +135,9 @@ def parse_specs(args, **kwargs):
tests
=
kwargs
.
get
(
'
tests
'
,
False
)
try
:
sargs
=
args
if
isinstance
(
args
,
six
.
string_types
)
else
'
'
.
join
(
args
)
sargs
=
args
if
not
isinstance
(
args
,
six
.
string_types
):
sargs
=
'
'
.
join
(
spack
.
util
.
string
.
quote
(
args
))
specs
=
spack
.
spec
.
parse
(
sargs
)
for
spec
in
specs
:
if
concretize
:
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/test/cmd/common/arguments.py
+
18
−
0
View file @
eb286bb8
...
...
@@ -9,6 +9,7 @@
import
pytest
import
spack.cmd
import
spack.cmd.common.arguments
as
arguments
import
spack.config
...
...
@@ -62,3 +63,20 @@ def test_negative_integers_not_allowed_for_parallel_jobs(parser):
parser
.
parse_args
([
'
-j
'
,
'
-2
'
])
assert
'
expected a positive integer
'
in
str
(
exc_info
.
value
)
@pytest.mark.parametrize
(
'
specs,expected_variants,unexpected_variants
'
,
[
([
'
coreutils
'
,
'
cflags=-O3 -g
'
],
[],
[
'
g
'
]),
([
'
coreutils
'
,
'
cflags=-O3
'
,
'
-g
'
],
[
'
g
'
],
[]),
])
@pytest.mark.regression
(
'
12951
'
)
def
test_parse_spec_flags_with_spaces
(
specs
,
expected_variants
,
unexpected_variants
):
spec_list
=
spack
.
cmd
.
parse_specs
(
specs
)
assert
len
(
spec_list
)
==
1
s
=
spec_list
.
pop
()
assert
all
(
x
not
in
s
.
variants
for
x
in
unexpected_variants
)
assert
all
(
x
in
s
.
variants
for
x
in
expected_variants
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment