Commit 75f48ba6 authored by gsell's avatar gsell

Pmodules:

- templates moved to ${module_group}/${PMODULES_TEMPLATE_DIR}
parent 3abedd8d
......@@ -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
}
......
......@@ -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!"
}
......
......@@ -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
}
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment