diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/package.sh | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/package.sh b/lib/package.sh index 6501ba2..27ea8cb 100644 --- a/lib/package.sh +++ b/lib/package.sh @@ -125,10 +125,8 @@ ob_get_binary_packages() fi # Make sure the "clean" name is unique. - pkg_clean="$({ tr 'a-z' 'A-Z' | tr -dC 'A-Z0-9';} <<-EOF - "${pkg}" - EOF - )" + pkg_clean="$(printf '%s' "${pkg}" | tr 'a-z' 'A-Z' | \ + tr -C 'A-Z0-9' '_')" case "${pkgs_clean}" in *" ${pkg_clean} "*) _ob_warn_msg 'duplicate_clean_binary_name' \ "${pkg_clean}" @@ -211,10 +209,8 @@ ob_get_binary_parameter() fi # Convert package name to its uppercase "clean" form. - package="$({ tr 'a-z' 'A-Z' | tr -dC 'A-Z0-9'; } <<-EOF - "${pkg}" - EOF - )" + package="$(printf '%s' "${package}" | tr 'a-z' 'A-Z' | \ + tr -C 'A-Z0-9' '_')" # Convert field name to uppercase and validate. case "${name}" in *[!A-Za-z0-9-]* | '') @@ -323,10 +319,8 @@ _ob_set_binary_parameter() fi # Convert package name to its uppercase "clean" form. - package="$({ tr 'a-z' 'A-Z' | tr -dC 'A-Z0-9'; } <<-EOF - "${pkg}" - EOF - )" + package="$(printf '%s' "${package}" | tr 'a-z' 'A-Z' | \ + tr -C 'A-Z0-9' '_')" # Convert field name to uppercase and validate. case "${name}" in *[!A-Za-z0-9-]* | '') |