Browse Source

fix: update jq in apt-utils to use filter arguments

This fixes the issue where jq sometimes fails to compile the filter when parsing
base-files.json
Franklyn Tackitt 1 week ago
parent
commit
58a3d74eec
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lib/functions/general/apt-utils.sh

+ 4 - 1
lib/functions/general/apt-utils.sh

@@ -51,7 +51,10 @@ function apt_find_upstream_package_version_and_download_url() {
 	esac
 	package_info_download_url_file="$(mktemp)"
 	curl --silent --show-error --max-time 10 $package_info_download_url -o $package_info_download_url_file
-	found_package_filename=$(jq -r .[\"${package_download_release}\"].${ARCH} $package_info_download_url_file)
+	found_package_filename=$(
+		jq -r --arg release "${package_download_release}" --arg arch "${ARCH}" \
+			'.[$release][$arch]' $package_info_download_url_file
+	)
 
 	if [[ "${found_package_filename}" == "${sought_package_name}_"* ]]; then
 		display_alert "Found upstream base-files package filename" "${found_package_filename}" "info"