Skip to content
Browse files

fix loading for new layout

  • Loading branch information...
1 parent 1ea0997 commit 2603cbd1c5f3138f302d1027c8e0874142f3798e @mpapis mpapis committed
View
2 bin/bdsm
@@ -21,7 +21,7 @@ initial_pwd="$PWD"
# set BDSM basic paths
bdsm_path="/usr/local/bdsm"
-modules_path="${bdsm_path}/extensions/builtin/core/modules"
+modules_path="${bdsm_path}/core/bdsm/modules"
export initial_pwd bdsm_path modules_path
# basic options parsing
View
2 core/bdsm/modules/shell/core/cli
@@ -89,7 +89,7 @@ then
extension_args=()
fi
-PS4="# \${BASH_SOURCE##\${bdsm_path}\/extensions\/} \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} $ "
+PS4="# \${BASH_SOURCE##\${bdsm_path}\/} \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} $ "
export PS4
if [[ " ${trace_flags} " =~ " all " ]]
View
2 core/bdsm/modules/shell/core/dsl
@@ -64,7 +64,7 @@ bdsm_exports()
#
bdsm_version()
{
- if file_is_nonempty "$bdsm_path/VERSION"
+ if [[ -s "$bdsm_path/VERSION" ]]
then
read -r bdsm_version < "$bdsm_path/VERSION"
else
View
8 core/bdsm/modules/shell/core/initialize
@@ -34,13 +34,13 @@ else
fi
true \
- "${modules_path:="${bdsm_path}/extensions/builtin/core/modules"}" \
+ "${modules_path:="${bdsm_path}/core/bdsm/modules"}" \
"${templates_path:="${bdsm_path}/templates"}" \
"${src_path:="${bdsm_path}/src"}" \
"${md5_path:="${bdsm_path}/md5"}" \
"${archives_path:="${bdsm_path}/archives"}" \
"${scm_path:="${bdsm_path}/scm"}" \
- "${extension_sets_path:="${bdsm_path}/extensions"}" \
+ "${extension_sets_path:="${bdsm_path}/sets"}" \
"${extensions_src_path:="${src_path}/extensions"}" \
"${tmp_path:="${bdsm_path}/tmp"}" \
"${bin_path:="${bdsm_path}/bin"}" \
@@ -53,7 +53,7 @@ true \
"${keep_releases:=4}" \
"${hooks_flag:=1}" \
"${PAGER:="less"}" \
- "${config_path:="${bdsm_path}/extensions/builtin/core/config"}" \
+ "${config_path:="${bdsm_path}/core/bdsm/config"}" \
"${packages_path:="${bdsm_path}/pkg"}" \
"${active_path:="${packages_path}/active"}" \
"${extension_args:=""}"
@@ -64,7 +64,7 @@ then
then
extension_sets_home="${extension_sets_path}"
else
- extension_sets_home="${user_bdsm_path}/extensions"
+ extension_sets_home="${user_bdsm_path}/sets"
fi
fi
View
4 core/bdsm/modules/shell/logging/dsl
@@ -219,7 +219,7 @@ core_log_todo()
if (( debug_flag == 1 )) && options_check "$debug_flags" "todo"
then
local file="${BASH_SOURCE[2]}" line="${BASH_LINENO[1]}"
- printf "DEBUG todo: ${file##${bdsm_path}\/extensions\/}:${line}:\n"
+ printf "DEBUG todo: ${file##${bdsm_path}\/}:${line}:\n"
printf "$*" | xargs -s 72 | xargs -I {} printf "DEBUG todo: # {}\n"
else
return 0
@@ -401,7 +401,7 @@ set_ps4()
# Set and export the PS4 variable, so that this script -- and called bash scripts --
# will display more detailed and formatted trace output.
# Finally, return true, 0, for success.
- PS4="# \${BASH_SOURCE##\${bdsm_path}\/extensions\/} \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} $ "
+ PS4="# \${BASH_SOURCE##\${bdsm_path}\/} \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} $ "
export PS4
return 0
}
View
19 core/bdsm/modules/shell/modules/dsl
@@ -45,7 +45,8 @@ init_extensions_search_paths()
{
if [[ -z "${extensions_search_paths[*]}" ]]
then
- extensions_search_paths=( )
+ extensions_search_paths=( "${bdsm_path}/exts" )
+
local extension
for extension in ${extension_sets_path}/*
do
@@ -68,9 +69,9 @@ init_extensions_search_paths()
fi
fi
- if ! string_contains "${extensions_search_paths[*]}" "${bdsm_path}/extensions/builtin"
+ if ! string_contains "${extensions_search_paths[*]}" "${bdsm_path}/core"
then
- extensions_search_paths+=( "${bdsm_path}/extensions/builtin" )
+ extensions_search_paths+=( "${bdsm_path}/core" )
fi
export extensions_search_paths
}
@@ -130,7 +131,7 @@ in_search_paths()
trace_filter search
local callback=$1
shift
- local args=( "$@" ) path builtin_extension
+ local args=( "$@" ) path
for path in "${extensions_search_paths[@]}"
do
@@ -140,7 +141,7 @@ in_search_paths()
fi
done
- if "${callback}" "${bdsm_path}/extensions/builtin" "bdsm" "${args[@]}"
+ if "${callback}" "${bdsm_path}/core" "cli" "${args[@]}"
then
return 0
fi
@@ -193,8 +194,8 @@ module()
# Search for module.
if in_search_paths detect_module "${_module}"
then
- log_search module "$module_name" "${module_path##${bdsm_path}\/extensions\/}"
- modules+=("${module_name}=${module_path##${bdsm_path}\/extensions\/}")
+ log_search module "$module_name" "${module_path##${bdsm_path}\/}"
+ modules+=("${module_name}=${module_path##${bdsm_path}\/}")
else
log_search module "${_module}" "Not found !!!"
return 1
@@ -213,10 +214,10 @@ module()
# Load module dependencies.
if [[ -s "${module_path}/modules" ]]
then
- for _module_dependency in $( cat ${module_path}/modules )
+ for _module_dependency in $( cat ${_module_path}/modules )
do
module_or_error "${_module_dependency}" \
- "Could not find module dependency '${_module_dependency}' from '${_module_path##${bdsm_path}\/extensions\/}/modules'."
+ "Could not find module dependency '${_module_dependency}' from '${_module_path##${bdsm_path}\/}/modules'."
done
fi
View
8 core/bdsm/modules/shell/modules/initialize
@@ -11,10 +11,10 @@ then
#core is loaded as BDSM starts
modules=(
- "core/core=builtin/core/modules/shell/core"
- "core/string=builtin/core/modules/shell/string"
- "core/logging=builtin/core/modules/shell/logging"
- "core/modules=builtin/core/modules/shell/modules"
+ "bdsm/core=core/bdsm/modules/shell/core"
+ "bdsm/string=core/bdsm/modules/shell/string"
+ "bdsm/logging=core/bdsm/modules/shell/logging"
+ "bdsm/modules=core/bdsm/modules/shell/modules"
)
for module_def in ${modules[@]}
View
10 core/cli/actions/dev/create
@@ -11,9 +11,9 @@ then
error "Extension '${extension}' already exists "\
"at ${target_path}/${extension}."
else
- if path_exists "${bdsm_path}/extensions/builtin/bdsm/templates/ext/${language:-shell}"
+ if path_exists "${bdsm_path}/core/cli/templates/ext/${language:-shell}"
then
- enter "${bdsm_path}/extensions/builtin/bdsm/templates/ext/${language:-shell}"
+ enter "${bdsm_path}/core/cli/templates/ext/${language:-shell}"
_path="${target_path}/${extension}"
@@ -28,9 +28,9 @@ then
extension_module_add "${extension}" "${_module}" "${_path}"
# Run the module's extension setup function, if it exists.
- if file_exists "${bdsm_path}/extensions/builtin/core/modules/shell/${_module}/extensions"
+ if file_exists "${bdsm_path}/core/cli/modules/shell/${_module}/extensions"
then
- source_files "${bdsm_path}/extensions/builtin/core/modules/shell/${_module}/extensions"
+ source_files "${bdsm_path}/core/cli/modules/shell/${_module}/extensions"
if command_exists "${_module}_extension_setup"
then
"${_module}_extension_setup" "${extension}" "${_module}" "${_path}"
@@ -41,7 +41,7 @@ then
log "Extension created from template at ${target_path}/${extension}/."
else
fail "Extension template files are missing from "\
- "$target_path/core/templates/ext/${language:-shell}."
+ "$target_path/core/cli/templates/ext/${language:-shell}."
fi
fi
done
View
20 core/cli/modules/shell/ext/dsl
@@ -29,7 +29,7 @@ ext_help()
ext_list()
{
local extensions COLUMNS=80
- extensions_in "${bdsm_path}/extensions/ext"
+ extensions_in "${bdsm_path}/exts"
extensions=( ${found_extensions[@]} )
if array_is_nonempty extensions
@@ -46,7 +46,7 @@ ext_list_known()
local COLUMNS=80
awk -F = '/^[^#]/ {printf "# %18s | %s\n", $1, $2 }' <<<"Extension name=Repository"
- awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/extensions/builtin/bdsm/config/known_ext"
+ awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/core/cli/config/known_ext"
}
ext_install()
@@ -55,7 +55,7 @@ ext_install()
shift || fail "Cannot install extension ext without name."
[[ -n "${_uri}" ]] ||
- _uri=$( awk -F = "/^${_name}=/ {print \$2 }" < "${bdsm_path}/extensions/builtin/bdsm/config/known_ext" )
+ _uri=$( awk -F = "/^${_name}=/ {print \$2 }" < "${bdsm_path}/core/cli/config/known_ext" )
[[ -n "${_uri}" ]] ||
error "Cannot find ${_name} in known extension ext list."
@@ -63,7 +63,7 @@ ext_install()
local _identifier="$(scm_identifier "${_uri}")"
log_step "bdsm_${_name}" # TODO: if fail, log_step failure
- enter "${bdsm_path}/extensions/ext"
+ enter "${bdsm_path}/exts"
fetch_uri "${_uri}" "${src_path}/${_identifier}"
remove_paths "${_name}"
copy_directory "${src_path}/${_identifier}" to "${_name}"
@@ -73,7 +73,7 @@ ext_install()
ext_install_all()
{
local _set _name _uri COLUMNS=80
- for _set in $( awk '/^[^#]/' < "${bdsm_path}/extensions/builtin/bdsm/config/known_ext" )
+ for _set in $( awk '/^[^#]/' < "${bdsm_path}/core/cli/config/known_ext" )
do
_name="${_set%%=*}"
_uri="${_set##*=}"
@@ -95,16 +95,16 @@ ext_update()
error "Extension ${_name} cannot be updated."
;;
esac
- if [[ ! -d "${bdsm_path}/extensions/ext/${_name}" ]]
+ if [[ ! -d "${bdsm_path}/exts/${_name}" ]]
then
error "Extension ${_name} does not exist."
fi
- if [[ ! -s "${bdsm_path}/extensions/ext/${_name}/.uri" ]]
+ if [[ ! -s "${bdsm_path}/exts/${_name}/.uri" ]]
then
log "Extension ${_name} does not contain stored uri.\n"
continue
fi
- _uri=$( cat "${bdsm_path}/extensions/ext/${_name}/.uri" )
+ _uri=$( cat "${bdsm_path}/exts/${_name}/.uri" )
if [[ -z "${_uri}" ]]
then
log "Extension ${_name} does not contain stored uri."
@@ -141,7 +141,7 @@ ext_uninstall()
error "Extension ${_name} cannot be removed."
;;
esac
- enter "${bdsm_path}/extensions/ext"
+ enter "${bdsm_path}/exts"
if [[ ! -d "${_name}" ]]
then
error "Please specify a valid extension name."
@@ -155,7 +155,7 @@ ext_uninstall()
ext_check_availability()
{
- awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/extensions/builtin/bdsm/config/known_ext" |
+ awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/core/cli/config/known_ext" |
"${bdsm_path}/bin/bdsm-ll" \
printf "%s: " {} \; curl -s --head https://github.com/wayneeseguin/bdsm-{} \| awk "'/Status/{print \$2}'"
}
View
2 core/cli/modules/shell/ext/initialize
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
-ensure_paths_exist "${bdsm_path}/extensions/ext"
+ensure_paths_exist "${bdsm_path}/exts"
View
2 core/cli/modules/shell/initialize
@@ -19,7 +19,7 @@ true \
${remote:="origin"} \
${branch:="master"}
-for config in "${bdsm_path}/extensions/core/config/defaults" "${bdsm_path}/extensions/core/config/defaults"
+for config in "${bdsm_path}/core/bdsm/config/defaults" "${bdsm_path}/core/bdsm/config/defaults"
do
if file_exists "$config"
then
View
2 core/cli/modules/shell/modules
@@ -2,4 +2,4 @@ ext/system
ext/filesystem
ext/environment
ext/vcs
-bdsm/module_utils
+cli/module_utils
View
8 core/cli/modules/shell/sets/dsl
@@ -57,7 +57,7 @@ sets_list_known()
{
local COLUMNS=80
awk -F = '/^[^#]/ {printf "# %18s | %s\n", $1, $2 }' <<<"Set name=Repository"
- awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/extensions/builtin/bdsm/config/known_sets"
+ awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/core/cli/config/known_sets"
}
sets_install()
@@ -70,7 +70,7 @@ sets_install()
error "builtin extension set may not be (re-)installed, except by updating BDSM core (bdsm get head)."
[[ -n "${_uri}" ]] ||
- _uri=$( awk -F = "/^${_name}=/ {print \$2 }" < "${bdsm_path}/extensions/builtin/bdsm/config/known_sets" )
+ _uri=$( awk -F = "/^${_name}=/ {print \$2 }" < "${bdsm_path}/core/cli/config/known_sets" )
[[ -n "${_uri}" ]] ||
error "Cannot find ${_name} in known extension sets list."
@@ -90,7 +90,7 @@ sets_install_all()
{
local _set _name _uri COLUMNS=80
- for _set in $( awk '/^[^#]/' < "${bdsm_path}/extensions/builtin/bdsm/config/known_sets" )
+ for _set in $( awk '/^[^#]/' < "${bdsm_path}/core/cli/config/known_sets" )
do
_name="${_set%%=*}"
_uri="${_set##*=}"
@@ -193,7 +193,7 @@ sets_check_availability()
{
# TODO: refactor this to take argument of uri to check instead.
# provide check_known_sets_availability or some such to wrap this.
- awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/extensions/builtin/bdsm/config/known_sets" |
+ awk -F = '/^[^#]/ {printf "%20s %s\n", $1, $2 }' < "${bdsm_path}/core/cli/config/known_sets" |
"${bdsm_path}/bin/bdsm-ll" \
printf "%s: " {} \; curl -s --head https://github.com/wayneeseguin/bdsm-{} \| awk "'/Status/{print \$2}'"
}
View
2 core/ext/modules/shell/extensions/detection/dsl
@@ -467,7 +467,7 @@ extension_action()
|| in_search_paths detect_unique_2nd_level_action "${extension_args[@]}" \
|| in_search_paths detect_modules_action "${extension_args[@]}"
then
- log_search action "$action" "${action_path##${bdsm_path}\/extensions\/} params:${extension_args[@]}"
+ log_search action "$action" "${action_path##${bdsm_path}\/} params:${extension_args[@]}"
else
if in_search_paths detect_extension_existence "${extension_args[@]}" \
&& [[ "${extension}" == "${extension_args}" ]]
View
8 core/ext/modules/shell/extensions/manipulation/dsl
@@ -216,15 +216,15 @@ extension_install()
if extension_is_valid "${extensions_src_path}/${_src}"
then
log "Installing ${_extension}"
- if path_exists "${bdsm_path}/extensions/external/${_extension}"
+ if path_exists "${bdsm_path}/exts/${_extension}"
then
- remove_paths "${bdsm_path}/extensions/external/${_extension}"
+ remove_paths "${bdsm_path}/exts/${_extension}"
fi
copy_directory "${extensions_src_path}/${_src}" \
- to "${bdsm_path}/extensions/external/${_extension}"
+ to "${bdsm_path}/exts/${_extension}"
- write "${extension_uri}" to "${bdsm_path}/extensions/external/${_extension}/.uri"
+ write "${extension_uri}" to "${bdsm_path}/exts/${_extension}/.uri"
#
# TODO: Process extension dependencies...
View
3 core/ext/modules/shell/service/dsl
@@ -1033,8 +1033,7 @@ service_install_init_d()
mode 0755
else
# Use core srv init.d template
- install_template "init.d" \
- from "${bdsm_path}/extensions/builtin/srv/templates" \
+ install_template "cli/init.d" \
to "${init_scripts_path}/${_service}" mode 0755
seed_template "${init_scripts_path}/${_service}" \
View
2 core/ext/modules/shell/templates/dsl
@@ -54,7 +54,7 @@ template_exists()
{
if in_search_paths detect_template "$@"
then
- log_search "template" "$template_name" "${template_path##${bdsm_path}\/extensions\/}"
+ log_search "template" "$template_name" "${template_path##${bdsm_path}\/}"
return 0
else
return 1
View
2 core/install/modules/shell/modules
@@ -1,4 +1,4 @@
ext/filesystem
ext/vcs
ext/users
-bdsm/sets
+cli/sets
View
2 install
@@ -18,7 +18,7 @@ install_path="${bdsm_path}" # Path to install everything to.
archives_path="${bdsm_path}/archives"
scm_path="${bdsm_path}/scm"
src_path="${bdsm_path}/src"
-extension_sets_home="${bdsm_path}/extensions"
+extension_sets_home="${bdsm_path}/sets"
export install_path archives_path scm_path src_path extension_sets_home
View
2 local
@@ -21,7 +21,7 @@ initial_pwd="$PWD"
# Path to load everything from.
bdsm_path="$PWD"
-modules_path="${bdsm_path}/extensions/builtin/core/modules"
+modules_path="${bdsm_path}/core/bdsm/modules"
export initial_pwd bdsm_path modules_path
# Basic options parsing.

0 comments on commit 2603cbd

Please sign in to comment.
Something went wrong with that request. Please try again.