Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoicon
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
w2w
autoicon
Commits
d3bc665b
Commit
d3bc665b
authored
1 year ago
by
Oriol Tintó
Browse files
Options
Downloads
Patches
Plain Diff
Add upstream file only if it doesn't exist yet
parent
0ace322d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platforms/common/spack_utils.sh
+15
-11
15 additions, 11 deletions
platforms/common/spack_utils.sh
with
15 additions
and
11 deletions
platforms/common/spack_utils.sh
+
15
−
11
View file @
d3bc665b
...
...
@@ -14,17 +14,21 @@ function _install_spack() {
if
[
!
-z
"
${
SPACK_UPSTREAMS
}
"
]
;
then
UPSTREAMS_CONFIG
=
${
SPACK_ROOT
}
/etc/spack/upstreams.yaml
tmpfile
=
$(
mktemp
)
echo
"upstreams:"
>
$tmpfile
i
=
0
for
UP
in
${
SPACK_UPSTREAMS
}
;
do
echo
"Adding upstream repo to config
$UPSTREAMS_CONFIG
<=
$UP
"
i
=
$((
i+1
))
echo
" spack-instance-
$i
:"
>>
$tmpfile
echo
" install_tree:
$UP
"
>>
$tmpfile
done
mv
$tmpfile
$UPSTREAMS_CONFIG
# If the upstream file already exists, just skip it.
if
[
!
-f
${
UPSTREAMS_CONFIG
}
]
;
then
tmpfile
=
$(
mktemp
)
echo
"upstreams:"
>
$tmpfile
i
=
0
for
UP
in
${
SPACK_UPSTREAMS
}
;
do
echo
"Adding upstream repo to config
$UPSTREAMS_CONFIG
<=
$UP
"
i
=
$((
i+1
))
echo
" spack-instance-
$i
:"
>>
$tmpfile
echo
" install_tree:
$UP
"
>>
$tmpfile
done
mv
$tmpfile
$UPSTREAMS_CONFIG
else
echo
"upstreams was already present:
${
UPSTREAMS_CONFIG
}
"
fi
fi
if
[
!
-z
"
${
SPACK_EXTERNALS
}
"
]
;
then
...
...
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