Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Pmodules
buildblocks
Commits
2fb13788
Commit
2fb13788
authored
Mar 17, 2015
by
gsell
Browse files
scripts/Bootstrap/Pmodules/modmanage.in: sub-command 'install' implemented
parent
2c2a4f66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
scripts/Bootstrap/Pmodules/modmanage.in
scripts/Bootstrap/Pmodules/modmanage.in
+37
-3
No files found.
scripts/Bootstrap/Pmodules/modmanage.in
View file @
2fb13788
...
...
@@ -267,8 +267,10 @@ subcommand_install() {
local
-a
with
=()
local
-a
releases
=()
local
-a
module_pattern
=()
local
-r
src_prefix
=
"
${
PMODULES_INSTALL_SOURCE
}
"
local
-r
target_prefix
=
"
${
PSI_PREFIX
}
"
opts
=
$(
get_options
-o
h
-l
with:
-l
release:
-l
help
--
"
$@
"
)
opts
=
$(
get_options
-o
h
-l
with:
-l
release:
-l
help
-l
src:
--
"
$@
"
)
if
[[
$?
!=
0
]]
;
then
subcommand_help_install
exit
1
...
...
@@ -278,7 +280,10 @@ subcommand_install() {
case
$1
in
--release
)
releases+
=(
"
$2
"
)
echo
$2
shift
;;
--src
)
src_prefix
=
"
$2
"
shift
;;
--with
)
...
...
@@ -299,7 +304,36 @@ subcommand_install() {
esac
shift
done
PSI_PREFIX
=
"
${
PMODULES_INSTALL_SOURCE
}
"
${
PMODULES_HOME
}
/bin/modulecmd bash search
"
${
module_pattern
[@]
}
"
"
${
with
[@]/#/--with
}
"
"
${
releases
[@]/#/--release=
}
"
--no-header
local
-A
modules_to_install
local
-i
n
=
0
while
read
rel_modulefile
;
do
modules_to_install[
"
${
rel_modulefile
}
"
]
+
=
'.'
let
n+
=
1
done
< <
(
${
PMODULES_HOME
}
/bin/modulecmd bash search
\
"
${
module_pattern
[@]
}
"
\
"
${
with
[@]/#/--with
}
"
\
"
${
releases
[@]/#/--release=
}
"
\
--no-header
--print-modulefiles
\
--src
=
"
${
src_prefix
}
"
2>&1
)
((
n
==
0
))
&&
die 0
"Nothing to install..."
echo
-e
"The following modules will be installed/updated:
\n
"
1>&2
for
key
in
"
${
!modules_to_install[@]
}
"
;
do
echo
"
${
key
}
"
1>&2
done
echo
1>&2
get_YN_answer
"Do you want to continue? [n] "
||
die 1
"Aborting..."
echo
1>&2
for
rel_modulefile
in
"
${
!modules_to_install[@]
}
"
;
do
if
[[
-d
"
${
target_prefix
}
/
${
rel_modulefile
}
"
]]
;
then
echo
" Updating;
${
rel_modulefile
}
..."
1>&2
else
echo
" Installing:
${
rel_modulefile
}
..."
fi
sync_module
"
${
rel_modulefile
}
"
\
"
${
src_prefix
}
"
\
"
${
target_prefix
}
"
done
echo
-e
"
\n
Done!
\n
"
1>&2
}
while
((
$#
>
0
))
;
do
...
...
Write
Preview
Markdown
is supported
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