diff --git a/lib.sh b/lib.sh index 2a31aac..a8011a2 100755 --- a/lib.sh +++ b/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}')" diff --git a/pre_cache_action.sh b/pre_cache_action.sh index 4bd63d4..1b0c70c 100755 --- a/pre_cache_action.sh +++ b/pre_cache_action.sh @@ -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}"