Skip to content

Commit b53191d

Browse files
committed
Unquote package lists mistakenly quoted by PR awalsh128#177.
The quotes caused the package lists to be treated as one long single package name.
1 parent 2da29a2 commit b53191d

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ inputs:
1717
execute_install_scripts:
1818
description: 'Execute Debian package pre and post install script upon restore. See README.md caveats for more information.'
1919
required: false
20-
default: 'false'
20+
type: boolean
21+
default: false
2122
empty_packages_behavior:
2223
description: >
2324
Desired behavior when the provided package list is empty.
@@ -34,7 +35,8 @@ inputs:
3435
debug:
3536
description: 'Enable debugging when there are issues with action. Minor performance penalty.'
3637
required: false
37-
default: 'false'
38+
type: boolean
39+
default: false
3840
add-repository:
3941
description: 'Space delimited list of repositories to add via apt-add-repository before installing packages. Supports PPA (ppa:user/repo) and other repository formats.'
4042
required: false

install_and_cache_pkgs.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ log "Clean installing ${package_count} packages..."
7474
# Note: sudo doesn't affect redirects, but we want the output in the file anyway
7575
# shellcheck disable=SC2024
7676
# We intentionally redirect output here; the redirect happens as the current user which is fine
77-
sudo DEBIAN_FRONTEND=noninteractive apt-fast --yes install "${packages}" > "${install_log_filepath}"
77+
#
78+
# If packages is quoted, it'll be interpreted as a single long package name
79+
# instead of a list of packages.
80+
# shellcheck disable=SC2086
81+
sudo DEBIAN_FRONTEND=noninteractive apt-fast --yes install ${packages} > "${install_log_filepath}"
7882
log "done"
7983
log "Installation log written to ${install_log_filepath}"
8084

lib.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,15 @@ function get_normalized_package_list {
125125
local architecture
126126
architecture=$(dpkg --print-architecture)
127127
if [[ "${architecture}" == "arm64" ]]; then
128-
"${script_dir}"/apt_query-arm64 normalized-list "${packages}"
128+
# If packages is quoted, it'll be interpreted as a single long package name
129+
# instead of a list of packages.
130+
# shellcheck disable=SC2086
131+
"${script_dir}"/apt_query-arm64 normalized-list ${packages}
129132
else
130-
"${script_dir}"/apt_query-x86 normalized-list "${packages}"
133+
# If packages is quoted, it'll be interpreted as a single long package name
134+
# instead of a list of packages.
135+
# shellcheck disable=SC2086
136+
"${script_dir}"/apt_query-x86 normalized-list ${packages}
131137
fi
132138
}
133139

0 commit comments

Comments
 (0)