diff options
Diffstat (limited to 'lib/metadata.sh')
-rw-r--r-- | lib/metadata.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/metadata.sh b/lib/metadata.sh index da0c893..bc7e717 100644 --- a/lib/metadata.sh +++ b/lib/metadata.sh @@ -61,6 +61,25 @@ ob_validate_binary_name() return 0 } +## @brief Convert a source or binary package name to a "clean" identifier name +## @details \fBob_clean_name\fP() encodes characters in a source or binary +## package name that would be invalid in a shell variable or function +## name. This conversion is performed by the metadata plugin selected +## at libopkbuild's build time. +## @operand name req The source or binary package name to convert. +## @return Returns 0 on success. +## @stdout Prints the converted name. +## @pure yes This function has no side effects. +ob_clean_name() +{ + local name="${1}" + shift 1 || _ob_abort + + _ob_metadata_do 'clean_name' "${name}" || return ${?} + + return 0 +} + ## @brief Parse a source package version ## @details \fBob_parse_version\fP() validates and parses a source package ## version identifier using the metadata plugin selected at |