mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2026-01-10 04:12:46 +00:00
apt-query verify
This commit is contained in:
parent
1e76f95692
commit
2305a5f8a5
6
.github/workflows/pull_request.yml
vendored
6
.github/workflows/pull_request.yml
vendored
|
|
@ -35,6 +35,12 @@ jobs:
|
|||
GOOS=linux GOARCH=amd64 go build -o ../../../apt_query-x86 .
|
||||
GOOS=linux GOARCH=arm64 go build -o ../../../apt_query-arm64 .
|
||||
chmod +x ../../../apt_query-x86 ../../../apt_query-arm64
|
||||
|
||||
- name: Verify apt_query binary works
|
||||
run: | #shell
|
||||
sudo apt-get update -qq
|
||||
./apt_query-x86 normalized-list curl wget || echo "Binary failed, checking output..."
|
||||
./apt_query-x86 normalized-list curl wget 2>&1 || true
|
||||
|
||||
- name: Test action
|
||||
id: test-action
|
||||
|
|
|
|||
14
lib.sh
14
lib.sh
|
|
@ -116,17 +116,23 @@ function get_normalized_package_list {
|
|||
architecture=$(dpkg --print-architecture)
|
||||
local result
|
||||
if [ "${architecture}" == "arm64" ]; then
|
||||
result=$("${script_dir}/apt_query-arm64" normalized-list "${packages}")
|
||||
result=$("${script_dir}/apt_query-arm64" normalized-list "${packages}" 2>&1)
|
||||
else
|
||||
result=$("${script_dir}/apt_query-x86" normalized-list "${packages}")
|
||||
result=$("${script_dir}/apt_query-x86" normalized-list "${packages}" 2>&1)
|
||||
fi
|
||||
|
||||
# Check for errors in output
|
||||
if [ -z "${result}" ] || echo "${result}" | grep -qiE "error|fatal|unable"; then
|
||||
echo "apt_query failed with output: ${result}" >&2
|
||||
fi
|
||||
|
||||
echo "original apt-query result: '${result}'" >&2
|
||||
# Remove "Reverse=Provides: " prefix from strings if present
|
||||
local clean_result
|
||||
clean_result=$(echo "${result}" | sed 's/Reverse=Provides: //g')
|
||||
# Debug logging to stderr (won't interfere with return value captured via command substitution)
|
||||
echo "cleaned result: ${clean_result}" >&2
|
||||
echo "result: ${result}" >&2
|
||||
echo "cleaned apt-query result: '${clean_result}'" >&2
|
||||
|
||||
echo "${clean_result}"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue