diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/metadata.sh | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/metadata.sh b/lib/metadata.sh index 84aa17e..fb13916 100644 --- a/lib/metadata.sh +++ b/lib/metadata.sh @@ -20,7 +20,7 @@ [ -n "${_OB_METADATA_SM}" ] && return 0 _OB_METADATA_SM='true' -_OB_NAME_RE='^[a-z0-9][a-z0-9+.-]+$' +ob_use 'metadata/@@METADATA@@' ob_validate_source_name() { @@ -33,7 +33,7 @@ ob_validate_source_name() return ${?} fi - echo "${_obvsn_name}" | grep -E "${_OB_NAME_RE}" + _ob_metadata_do 'validate_source_name' "${_obvsn_name}" _ob_return ${?} return ${?} @@ -41,5 +41,30 @@ ob_validate_source_name() ob_validate_binary_name() { - ob_validate_source_name "${@}" + _ob_local _obvbn_name + + if [ ${#} -eq 1 ]; then + _obvbn_name="${1}" + else + _ob_return 125 + return ${?} + fi + + _ob_metadata_do 'validate_binary_name' "${_obvbn_name}" + + _ob_return ${?} + return ${?} +} + +_ob_metadata_do() +{ + _ob_local _obmd_func + + _obmd_func="${1}" + shift 1 + + "_ob_${_obmd_func}_@@METADATA@@" "${@}" + + _ob_return ${?} + return ${?} } |