Skip to content

Commit 373a624

Browse files
committed
qi.bash
revisions
1 parent f254d4e commit 373a624

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

qi.bash

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ verify_binary_integrity() {
256256
local tool
257257
tool=$(check_download_tools)
258258

259-
print_info "Verifying SHA256 against GitHub API..."
259+
print_action "Verifying SHA256 against GitHub API..."
260260

261261
# Fetch release assets from GitHub API
262262
local api_response
@@ -310,10 +310,10 @@ verify_binary_integrity() {
310310
done <<< "$api_digests"
311311

312312
if [[ $match_found == "true" ]]; then
313-
print_success "GitHub API SHA256 verification passed"
313+
print_success "GitHub API SHA256 verification passed"
314314
return 0
315315
else
316-
print_warning "GitHub API SHA256 verification failed"
316+
print_warning "GitHub API SHA256 verification failed"
317317
print_warning "Local SHA256: $local_sha"
318318
print_warning "API Digests:"
319319
while IFS= read -r api_digest; do
@@ -379,7 +379,15 @@ get_release_tag() {
379379
exit 1
380380
fi
381381

382-
printf '%s' "release-${qbt_ver}_v${libt_ver}"
382+
# Parse revision field
383+
local revision
384+
revision=$(printf '%s' "$response" | sed -rn 's|.*"revision": "(.*)".*|\1|p')
385+
if [[ -z $revision ]]; then
386+
print_warning "Failed to parse revision from API response"
387+
fi
388+
389+
# Output release tag and revision
390+
printf '%s %s' "release-${qbt_ver}_v${libt_ver}" "${revision:-}"
383391
}
384392

385393
# Download file
@@ -423,10 +431,18 @@ main() {
423431
local arch="${FORCE_ARCH:-$(detect_arch)}"
424432
local libtorrent_ver="${LIBTORRENT_VERSION:-v2}"
425433
local install_path="$HOME/bin/qbittorrent-nox"
434+
# Get release and download
435+
local release_tag revision
436+
# Capture release tag and revision from get_release_tag
437+
read release_tag revision <<< "$(get_release_tag)"
426438

427439
print_info "Architecture: $arch"
428440
print_info "Download tool: $(check_download_tools)"
429441
print_info "LibTorrent version: $libtorrent_ver"
442+
# Output revision if available
443+
if [[ -n $revision ]]; then
444+
print_info "Build revision: $revision"
445+
fi
430446
print_info "Attestation verification: $(check_gh_cli && printf '%s' "enabled" || printf '%s' "disabled (gh cli not found)")"
431447

432448
# Prepare installation directory
@@ -436,8 +452,6 @@ main() {
436452
}
437453

438454
# Get release and download
439-
local release_tag
440-
release_tag=$(get_release_tag)
441455
local url
442456
url=$(create_download_url "$arch" "$release_tag")
443457

0 commit comments

Comments
 (0)