Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
installer
Commits
36a7d0a3
Commit
36a7d0a3
authored
Jul 13, 2021
by
Paul McCarthy
🚵
Browse files
ENH: Post install finalisation tasks
parent
cd3c53a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
fslinstaller.py
View file @
36a7d0a3
...
...
@@ -47,6 +47,9 @@ PY2 = sys.version[0] == '2'
log
=
logging
.
getLogger
(
__name__
)
__absfile__
=
op
.
abspath
(
__file__
)
__version__
=
'0.0.0'
"""Installer version number. This is automatically updated in release versions
whenever a new version is released.
...
...
@@ -1078,6 +1081,25 @@ def install_fsl(ctx):
Process
.
monitor_progress
(
cmd
,
output
,
ctx
.
need_admin
,
ctx
,
env
=
env
)
def
finalise_installation
(
ctx
):
"""Performs some finalisation tasks. Includes:
- Saving the installed version to $FSLDIR/etc/fslversion
- Saving this installer script and the environment file to
$FSLDIR/share/fsl/installer/
"""
with
open
(
'fslversion'
,
'wt'
)
as
f
:
f
.
write
(
ctx
.
build
[
'version'
])
call
=
ft
.
partial
(
Process
.
check_call
,
admin
=
ctx
.
need_admin
,
ctx
=
ctx
)
etcdir
=
op
.
join
(
ctx
.
destdir
,
'etc'
)
instdir
=
op
.
join
(
ctx
.
destdir
,
'share'
,
'fsl'
,
'installer'
)
call
(
'cp fslversion {}'
.
format
(
etcdir
))
call
(
'mkdir -p {}'
.
format
(
instdir
))
call
(
'cp environment.yml {}'
.
format
(
instdir
))
call
(
'cp {} {}'
.
format
(
__absfile__
,
instdir
))
def
post_install_cleanup
(
ctx
):
"""Cleans up the FSL directory after installation. """
...
...
@@ -1506,11 +1528,12 @@ def main(argv=None):
if
update
:
action
=
'Updating'
else
:
action
=
'Installing'
printmsg
(
'
\n
{} FSL in
to
{}
\n
'
.
format
(
action
,
ctx
.
destdir
),
EMPHASIS
)
printmsg
(
'
\n
{} FSL in {}
\n
'
.
format
(
action
,
ctx
.
destdir
),
EMPHASIS
)
if
not
update
:
install_miniconda
(
ctx
)
install_fsl
(
ctx
)
finalise_installation
(
ctx
)
post_install_cleanup
(
ctx
)
if
not
(
update
or
args
.
no_shell
):
configure_shell
(
ctx
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment