mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-12-22 18:55:30 +00:00
Fix sorting when normalizing package list.
This commit is contained in:
parent
9a4f0f7d01
commit
fa7091e9a8
5
lib.sh
5
lib.sh
|
@ -4,8 +4,9 @@
|
||||||
function normalize_package_list {
|
function normalize_package_list {
|
||||||
local stripped=$(echo "${1}" | sed 's/,//g')
|
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="$(echo "${stripped}" | sed 's/\s\+/ /g; s/^\s\+//g; s/\s\+$//g')"
|
local trimmed="$(echo "${stripped}" | sed 's/\s\+/ /g; s/^\s\+//g; s/\s\+$//g')"
|
||||||
echo "${trimmed}" | sort
|
local sorted="$(echo ${trimmed} | tr ' ' '\n' | sort | tr '\n' ' ')"
|
||||||
|
echo "${sorted}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Split fully qualified package into name and version
|
# Split fully qualified package into name and version
|
||||||
|
|
Loading…
Reference in a new issue