diff options
author | P. J. McDermott <pjm@nac.net> | 2012-09-29 02:11:46 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-09-29 02:11:46 (EDT) |
commit | 9cee0dbd39c165cb573bc090a05e36efdabcfdf7 (patch) | |
tree | 5dd34032b3bb5a34c8b7fa714294f3196e4fe234 /lib | |
parent | 95fa5c380baad9933e3528f8099392c7742a2b79 (diff) |
Implement version parsing for ProteanOS.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/metadata/proteanos.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/metadata/proteanos.sh b/lib/metadata/proteanos.sh index cc8f5b4..6ff84e2 100644 --- a/lib/metadata/proteanos.sh +++ b/lib/metadata/proteanos.sh @@ -21,6 +21,12 @@ _OB_METADATA_PROTEANOS_SM='true' _OB_NAME_RE_PROTEANOS='^[a-z0-9][a-z0-9+.-]+$' +_OB_VERSION_RE_PROTEANOS='^' +_OB_VERSION_RE_PROTEANOS=${_OB_VERSION_RE_PROTEANOS}'[0-9a-z.~]+' +_OB_VERSION_RE_PROTEANOS=${_OB_VERSION_RE_PROTEANOS}'(\+sip[1-9][0-9]*)?' +_OB_VERSION_RE_PROTEANOS=${_OB_VERSION_RE_PROTEANOS}'(-[1-9][0-9]*)?' +_OB_VERSION_RE_PROTEANOS=${_OB_VERSION_RE_PROTEANOS}'(\+[a-z0-9]+-[1-9][0-9]*)?' +_OB_VERSION_RE_PROTEANOS=${_OB_VERSION_RE_PROTEANOS}'$' _ob_validate_source_name_proteanos() { @@ -47,3 +53,40 @@ _ob_validate_binary_name_proteanos() _ob_return ${?} return ${?} } + +_ob_validate_version_proteanos() +{ + _ob_local _obvvpro_version + + _obvvpro_version="${1}" + + echo "${_obvvpro_version}" | grep -E "${_OB_VERSION_RE_PROTEANOS}" \ + >/dev/null 2>&1 + + _ob_return ${?} + return ${?} +} + +_ob_get_upstreamver_proteanos() +{ + _ob_local _obguvpro_version + + _obguvpro_version="${1}" + + echo "${_obguvpro_version%%-*}" + + _ob_return 0 + return ${?} +} + +_ob_get_distrev_proteanos() +{ + _ob_local _obgdrpro_version + + _obgdrpro_version="${1}" + + echo "${_obgdrpro_version#*-}" + + _ob_return 0 + return ${?} +} |