Remove commas, and block scalar folded backslashes #84
This commit is contained in:
parent
5b6c3ab114
commit
270eae5fc9
1 changed files with 4 additions and 3 deletions
7
lib.sh
7
lib.sh
|
@ -118,14 +118,15 @@ function log_err { >&2 echo "$(date +%H:%M:%S)" "${@}"; }
|
||||||
function log_empty_line { echo ""; }
|
function log_empty_line { echo ""; }
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Sorts given packages by name and split on commas.
|
# Sorts given packages by name and split on commas and/or spaces.
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# The comma delimited list of packages.
|
# The comma and/or space delimited list of packages.
|
||||||
# Returns:
|
# Returns:
|
||||||
# Sorted list of space delimited packages.
|
# Sorted list of space delimited packages.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
function normalize_package_list {
|
function normalize_package_list {
|
||||||
local stripped=$(echo "${1}" | sed 's/,//g')
|
# Remove commas, and block scalar folded backslashes.
|
||||||
|
local stripped=$(echo "${1}" | sed 's/[,\]/ /g')
|
||||||
# Remove extraneous spaces at the middle, beginning, and end.
|
# Remove extraneous spaces at the middle, beginning, and end.
|
||||||
local trimmed="$(\
|
local trimmed="$(\
|
||||||
echo "${stripped}" \
|
echo "${stripped}" \
|
||||||
|
|
Loading…
Reference in a new issue