From cb6a9c2b3dc2195596616bae0a28f188cf68b074 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 08 Oct 2012 10:47:16 -0400 Subject: Update metadata plugin to comply with SPF 2.0. --- diff --git a/lib/metadata/proteanos.sh b/lib/metadata/proteanos.sh index 17198e7..52719da 100644 --- a/lib/metadata/proteanos.sh +++ b/lib/metadata/proteanos.sh @@ -22,10 +22,10 @@ _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}'[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}'(\+[a-z0-9]+~[1-9][0-9]*)?' _OB_VERSION_RE_PROTEANOS=${_OB_VERSION_RE_PROTEANOS}'$' _ob_validate_source_name_proteanos() @@ -34,10 +34,20 @@ _ob_validate_source_name_proteanos() _obvsnpro_name="${1}" - echo "${_obvsnpro_name}" | grep -E "${_OB_NAME_RE_PROTEANOS}" \ - >/dev/null 2>&1 + if echo "${_obvsnpro_name}" | grep -E "${_OB_NAME_RE_PROTEANOS}" \ + >/dev/null 2>&1; then + case "${_obvsnpro_name}" in + src-*) + _ob_return 1 + return ${?} + ;; + esac + else + _ob_return 1 + return ${?} + fi - _ob_return ${?} + _ob_return 0 return ${?} } @@ -47,10 +57,20 @@ _ob_validate_binary_name_proteanos() _obvbnpro_name="${1}" - echo "${_obvbnpro_name}" | grep -E "${_OB_NAME_RE_PROTEANOS}" \ - >/dev/null 2>&1 + if echo "${_obvbnpro_name}" | grep -E "${_OB_NAME_RE_PROTEANOS}" \ + >/dev/null 2>&1; then + case "${_obvbnpro_name}" in + src-*) + _ob_return 1 + return ${?} + ;; + esac + else + _ob_return 1 + return ${?} + fi - _ob_return ${?} + _ob_return 0 return ${?} } @@ -73,7 +93,7 @@ _ob_get_upstreamver_proteanos() _obguvpro_version="${1}" - echo "${_obguvpro_version%%-*}" + echo "${_obguvpro_version%-*}" _ob_return 0 return ${?} @@ -85,7 +105,7 @@ _ob_get_distrev_proteanos() _obgdrpro_version="${1}" - echo "${_obgdrpro_version#*-}" + echo "${_obgdrpro_version##*-}" _ob_return 0 return ${?} -- cgit v0.9.1