Fix sorting when normalizing package list.
This commit is contained in:
parent
9a4f0f7d01
commit
fa7091e9a8
1 changed files with 3 additions and 2 deletions
5
lib.sh
5
lib.sh
|
@ -4,8 +4,9 @@
|
|||
function normalize_package_list {
|
||||
local stripped=$(echo "${1}" | sed 's/,//g')
|
||||
# Remove extraneous spaces at the middle, beginning, and end.
|
||||
local trimmed="$(echo "${stripped}" | sed 's/\s\+/ /g; s/^\s\+//g; s/\s\+$//g')"
|
||||
echo "${trimmed}" | sort
|
||||
local trimmed="$(echo "${stripped}" | sed 's/\s\+/ /g; s/^\s\+//g; s/\s\+$//g')"
|
||||
local sorted="$(echo ${trimmed} | tr ' ' '\n' | sort | tr '\n' ' ')"
|
||||
echo "${sorted}"
|
||||
}
|
||||
|
||||
# Split fully qualified package into name and version
|
||||
|
|
Loading…
Reference in a new issue