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
39acca4b
Commit
39acca4b
authored
10 years ago
by
Todd Gamblin
Browse files
Options
Downloads
Patches
Plain Diff
Fix for bug in create introduced by LLVM merge.
parent
fa5594e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/spack/spack/cmd/create.py
+14
-13
14 additions, 13 deletions
lib/spack/spack/cmd/create.py
with
14 additions
and
13 deletions
lib/spack/spack/cmd/create.py
+
14
−
13
View file @
39acca4b
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
import
spack.cmd.checksum
import
spack.cmd.checksum
import
spack.package
import
spack.package
import
spack.url
import
spack.url
from
spack.util.naming
import
mod_to_class
from
spack.util.naming
import
*
import
spack.util.crypto
as
crypto
import
spack.util.crypto
as
crypto
from
spack.util.executable
import
which
from
spack.util.executable
import
which
...
@@ -128,21 +128,22 @@ def create(parser, args):
...
@@ -128,21 +128,22 @@ def create(parser, args):
url
=
args
.
url
url
=
args
.
url
# Try to deduce name and version of the new package from the URL
# Try to deduce name and version of the new package from the URL
name
,
version
=
spack
.
url
.
parse_name_and_version
(
url
)
version
=
spack
.
url
.
parse_version
(
url
)
# Use a user-supplied name if one is present
name
=
kwargs
.
get
(
args
,
'
alternate_name
'
,
False
)
if
args
.
name
:
name
=
args
.
name
if
not
version
:
if
not
version
:
tty
.
die
(
"
Couldn
'
t guess a version string from %s.
"
%
url
)
tty
.
die
(
"
Couldn
'
t guess a version string from %s.
"
%
url
)
if
not
name
:
# Try to guess a name. If it doesn't work, allow the user to override.
tty
.
die
(
"
Couldn
'
t guess a name for this package. Try running:
"
,
""
,
if
args
.
alternate_name
:
"
spack create --name <name> <url>
"
)
name
=
args
.
alternate_name
else
:
if
not
spack
.
db
.
valid_name
(
name
):
try
:
name
=
spack
.
url
.
parse_name
(
url
,
version
)
except
spack
.
url
.
UndetectableNameError
,
e
:
# Use a user-supplied name if one is present
tty
.
die
(
"
Couldn
'
t guess a name for this package. Try running:
"
,
""
,
"
spack create --name <name> <url>
"
)
if
not
valid_module_name
(
name
):
tty
.
die
(
"
Package name can only contain A-Z, a-z, 0-9,
'
_
'
and
'
-
'"
)
tty
.
die
(
"
Package name can only contain A-Z, a-z, 0-9,
'
_
'
and
'
-
'"
)
tty
.
msg
(
"
This looks like a URL for %s version %s.
"
%
(
name
,
version
))
tty
.
msg
(
"
This looks like a URL for %s version %s.
"
%
(
name
,
version
))
...
...
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