Commit 0a2ee2e1 authored by gsell's avatar gsell
Browse files

scripts/Bootstrap/Pmodules/modmanage.in: add some comments

parent b8fb76cb
...@@ -132,6 +132,7 @@ sync_module() { ...@@ -132,6 +132,7 @@ sync_module() {
local -r rel_module_prefix=$( get_module_prefix "${rel_modulefile}" ) local -r rel_module_prefix=$( get_module_prefix "${rel_modulefile}" )
local -r rel_releasefile=$( get_releasefile_name "${rel_modulefile}" ) local -r rel_releasefile=$( get_releasefile_name "${rel_modulefile}" )
# install/update module
if [[ ! -d "${target_prefix}/${rel_module_prefix}" ]] || [[ "${force}" == 'yes' ]]; then if [[ ! -d "${target_prefix}/${rel_module_prefix}" ]] || [[ "${force}" == 'yes' ]]; then
$DRY mkdir -p "${target_prefix}/${rel_module_prefix}" || return $? $DRY mkdir -p "${target_prefix}/${rel_module_prefix}" || return $?
$DRY rsync --links --perms --recursive --delete \ $DRY rsync --links --perms --recursive --delete \
...@@ -143,18 +144,25 @@ sync_module() { ...@@ -143,18 +144,25 @@ sync_module() {
local -r target_modulefile="${target_prefix}/${PSI_MODULES_ROOT}/${rel_modulefile}" local -r target_modulefile="${target_prefix}/${PSI_MODULES_ROOT}/${rel_modulefile}"
local -r target_releasefile="${target_prefix}/${PSI_MODULES_ROOT}/${rel_releasefile}" local -r target_releasefile="${target_prefix}/${PSI_MODULES_ROOT}/${rel_releasefile}"
# create target directory for module- and release-file
if [[ -e "${src_modulefile}" ]] || [[ -e "${src_releasefile}" ]]; then if [[ -e "${src_modulefile}" ]] || [[ -e "${src_releasefile}" ]]; then
local dir=$( dirname "${target_modulefile}" ) local dir=$( dirname "${target_modulefile}" )
$DRY mkdir -p "${dir}" || return $? $DRY mkdir -p "${dir}" || return $?
fi fi
# copy modulefile
if [[ -e "${src_modulefile}" ]]; then if [[ -e "${src_modulefile}" ]]; then
$DRY rsync --links --perms --recursive \ $DRY rsync --links --perms --recursive \
"${src_modulefile}" "${target_modulefile}" || return $? "${src_modulefile}" "${target_modulefile}" || return $?
fi fi
# copy release-file
if [[ -e "${src_releasefile}" ]]; then if [[ -e "${src_releasefile}" ]]; then
$DRY rsync --links --perms --recursive \ $DRY rsync --links --perms --recursive \
"${src_releasefile}" "${target_releasefile}" || return $? "${src_releasefile}" "${target_releasefile}" || return $?
fi fi
# if modulefile is a sym-link, sync link target file
if [[ -L "${src_modulefile}" ]]; then if [[ -L "${src_modulefile}" ]]; then
local canonical_fname=$(readlink -f "${src_modulefile}") local canonical_fname=$(readlink -f "${src_modulefile}")
local src_template=$(dirname "${canonical_fname}") local src_template=$(dirname "${canonical_fname}")
...@@ -238,7 +246,7 @@ subcommand_init() { ...@@ -238,7 +246,7 @@ subcommand_init() {
done done
(( ${#target_prefixes[@]} != 0 )) || die 1 "Error: no target directory specified!" (( ${#target_prefixes[@]} != 0 )) || die 1 "Error: no target directory specified!"
# if source is not passed as argument, derive it from script name # if source directory is not passed as argument, derive it from script name
if [[ -z "${src}" ]]; then if [[ -z "${src}" ]]; then
src=$(cd "${bindir}/../../../.." && pwd) src=$(cd "${bindir}/../../../.." && pwd)
fi fi
......
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