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
75f48ba6
Commit
75f48ba6
authored
Sep 28, 2015
by
gsell
Browse files
Pmodules:
- templates moved to ${module_group}/${PMODULES_TEMPLATE_DIR}
parent
3abedd8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
13 deletions
+28
-13
Bootstrap/Pmodules/libpbuild.bash
Bootstrap/Pmodules/libpbuild.bash
+13
-6
Bootstrap/Pmodules/libpmodules.bash
Bootstrap/Pmodules/libpmodules.bash
+0
-1
Bootstrap/Pmodules/modmanage.bash.in
Bootstrap/Pmodules/modmanage.bash.in
+15
-6
No files found.
Bootstrap/Pmodules/libpbuild.bash
View file @
75f48ba6
...
...
@@ -49,9 +49,6 @@ pbuild::add_to_group() {
if
[[
-z
${
1
}
]]
;
then
std::die 42
"
${
FUNCNAME
}
: Missing group argument."
fi
if
[[
!
-d
${
PMODULES_ROOT
}
/
${
PMODULES_TEMPLATES_DIR
}
/
${
1
}
]]
;
then
std::die 43
"
${
1
}
: group does not exist."
fi
MODULE_GROUP
=
$1
}
...
...
@@ -645,9 +642,9 @@ pbuild::make_all() {
cd
"
${
dir_name
}
"
local
x
IFS
=
'/'
x
=(
${
dir_name
/
${
PMODULES_ROOT
}
\/
${
MODULE_GROUP
}
\/
}
)
local
n
=
${#
x
[@]
}
local
-r
_target
=
"../"
$(
eval printf
"../%.s"
\
{
1..
${
n
}
}
)
${
PMODULES_TEMPLATES_DIR
##*/
}
/
"
${
MODULE_GROUP
}
/
${
P
}
/modulefile"
local
-i
n
=
${#
x
[@]
}
local
_target
=
$(
eval printf
"../%.s"
{
1..
${
n
}
}
)
_target+
=
"
${
PMODULES_TEMPLATES_DIR
}
/
${
P
}
/modulefile"
ln
-fs
"
${
_target
}
"
"
${
MODULE_NAME
##*/
}
"
)
fi
...
...
@@ -655,6 +652,15 @@ pbuild::make_all() {
echo
"
${
MODULE_RELEASE
}
"
>
"
${
release_file
}
"
}
##############################################################################
install_modulefile
()
{
local
-r
src
=
"
${
BUILD_BLOCK_DIR
}
/modulefile"
local
-r
dst
=
"
${
PMODULES_ROOT
}
/
${
MODULE_GROUP
}
/
${
PMODULES_TEMPLATES_DIR
}
/
${
P
}
"
std::info
"
${
MODULE_NAME
}
: installing modulefile in '
${
dst
}
'"
install
-m
0444
"
${
src
}
"
"
${
dst
}
"
}
##############################################################################
#
# here we really start with make_all()
...
...
@@ -729,6 +735,7 @@ pbuild::make_all() {
set_legacy_link
fi
set_link
install_modulefile
fi
return
0
}
...
...
Bootstrap/Pmodules/libpmodules.bash
View file @
75f48ba6
...
...
@@ -24,7 +24,6 @@ pmodules::check_directories() {
[[
-d
"
${
src_prefix
}
"
]]
&&
[[
-d
"
${
src_prefix
}
/
${
PMODULES_CONFIG_DIR
}
"
]]
&&
[[
-d
"
${
src_prefix
}
/
${
PMODULES_TEMPLATES_DIR
}
"
]]
&&
[[
-d
"
${
src_prefix
}
/Tools/Pmodules/
${
PMODULES_VERSION
}
"
]]
||
std::die 1
"
Error: the module environment '
${
src_prefix
}
' has not been initialized properly!"
}
...
...
Bootstrap/Pmodules/modmanage.bash.in
View file @
75f48ba6
...
...
@@ -184,6 +184,21 @@ sync_module() {
$DRY
rsync
--links
--perms
--recursive
\
"
${
src_releasefile
}
"
"
${
target_releasefile
}
"
2>/dev/null||
return
$?
fi
# copy modulefile template
local
-a
rel_modulefile_splitted
std::split_fname rel_modulefile_splitted
"
${
rel_modulefile
}
"
local
-r
module_group
=
"
${
rel_modulefile_splitted
[0]
}
"
local
-r
module_name
=
"
${
rel_modulefile_splitted
[-2]
}
"
local
-r
template
=
"
${
module_group
}
/
${
PMODULES_TEMPLATES_DIR
}
/
${
module_name
}
/"
local
-r
src_template
=
"
${
src_prefix
}
/
${
template
}
"
local
-r
target_template
=
"
${
target_prefix
}
/
${
template
}
"
if
[[
-e
"
${
src_template
}
"
]]
;
then
$DRY
mkdir
-p
"
${
target_template
}
"
$DRY
rsync
--links
--perms
--recursive
\
"
${
src_template
}
"
"
${
target_template
}
"
2>/dev/null||
return
$?
fi
}
#
...
...
@@ -199,12 +214,6 @@ sync_config() {
"
${
src
}
"
"
${
dst
}
"
2>/dev/null
||
return
$?
sed
-i
.bak
"s/PMODULES_VERSION=
\(
.*
\)
/PMODULES_VERSION=
${
PMODULES_VERSION
}
/"
"
${
dst
}
/environment.bash"
echo
src
=
"
$1
/
${
PMODULES_TEMPLATES_DIR
}
/"
dst
=
"
$2
/
${
PMODULES_TEMPLATES_DIR
}
/"
$DRY
rsync
--recursive
--links
--perms
--delete
--exclude
=
"
${
src
}
/.git*"
\
"
${
src
}
"
"
${
dst
}
"
2>/dev/null
||
return
$?
echo
}
#
...
...
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