diff options
author | P. J. McDermott <pjm@nac.net> | 2012-09-28 23:53:19 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-09-28 23:53:19 (EDT) |
commit | c1d78bfece321ad627812c10afda36fd465e4f5b (patch) | |
tree | f44f136b17df723be79e477aec13410808a9f538 | |
parent | 7bad14dc13e3c93d2aa8649e46724e856546f298 (diff) |
Support metadata plugins.
-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 ${?} } |