mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-12-22 18:55:30 +00:00
Fix lib arg ref and quoting behavior.
This commit is contained in:
parent
1ca2ac1a4c
commit
c961be0ea5
8
lib.sh
8
lib.sh
|
@ -2,15 +2,15 @@
|
|||
|
||||
# Sort these packages by name and split on commas.
|
||||
function normalize_package_list {
|
||||
stripped="$(echo \"${0}\" | sed 's/,//g')"
|
||||
stripped=$(echo "${1}" | sed 's/,//g')
|
||||
# Remove extraneous spaces at the middle, beginning, and end.
|
||||
trimmed="$(echo \"${stripped}\" | sed 's/\s\+/ /g; s/^\s\+//g; s/\s\+$//g')"
|
||||
echo "$(\"${trimmed}\" | sort)"
|
||||
trimmed="$(echo "${stripped}" | sed 's/\s\+/ /g; s/^\s\+//g; s/\s\+$//g')"
|
||||
echo "$(echo "${trimmed}" | sort)"
|
||||
}
|
||||
|
||||
# Split fully qualified package into name and version
|
||||
function get_package_name_ver {
|
||||
IFS=\= read name ver <<< "${0}"
|
||||
IFS=\= read name ver <<< "${1}"
|
||||
# If version not found in the fully qualified package value.
|
||||
if test -z "${ver}"; then
|
||||
ver="$(grep "Version:" <<< "$(apt show ${name})" | awk '{print $2}')"
|
||||
|
|
|
@ -5,10 +5,10 @@ script_dir="$(dirname -- "$(realpath -- "${0}")")"
|
|||
source "${script_dir}/lib.sh"
|
||||
|
||||
# Directory that holds the cached packages.
|
||||
cache_dir=${1}
|
||||
cache_dir="${1}"
|
||||
|
||||
# Version of the cache to create or load.
|
||||
version=${2}
|
||||
version="${2}"
|
||||
|
||||
# List of the packages to use.
|
||||
input_packages="${@:3}"
|
||||
|
|
Loading…
Reference in a new issue