From ff65ce6b4a123ca4c1193513aff39e2dca1822ad Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: May 04 2022 12:18:06 +0000 Subject: Fixed lookaside_upload_sig for missing and wrong variables Signed-off-by: Fabian Arrotin --- diff --git a/lookaside_upload_sig b/lookaside_upload_sig index 7547647..5b30e9e 100755 --- a/lookaside_upload_sig +++ b/lookaside_upload_sig @@ -78,8 +78,8 @@ checksum="$(${hash_parameter}sum ${file} | awk '{print $1}')" f_log "Checking if file already uploaded" local_size=$(stat -c %s ${file}) -http_code=$(curl -s -o /dev/null -w "%{http_code}" ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash_parameter}/${checksum}) -remote_size=$(curl --silent -i --head ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash_parameter}/${checksum} | grep "Content-Length" | cut -f 2 -d ':' | tr -d [:blank:] | tr -d '\r') +http_code=$(curl -s -o /dev/null -w "%{http_code}" ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash_parameter}/${checksum}/${file}) +remote_size=$(curl --silent -i --head ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash_parameter}/${checksum}/${file} | grep "Content-Length" | cut -f 2 -d ':' | tr -d [:blank:] | tr -d '\r') if [ "$http_code" -eq 200 ] && [ "$local_size" -eq "$remote_size" ]; then f_log "File already uploaded" @@ -115,9 +115,9 @@ if [ "$upload_result" -ne "0" ]; then fi f_log "Validating that source was correctly uploaded ...." -remote_size=$(curl --silent -i --head ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash}/${checksum} | grep "Content-Length" | cut -f 2 -d ':' | tr -d [:blank:] | tr -d '\r') +remote_size=$(curl --silent -i --head ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash_parameter}/${checksum}/${file} | grep "Content-Length" | cut -f 2 -d ':' | tr -d [:blank:] | tr -d '\r') if [ "$local_size" -eq "$remote_size" ]; then - f_log "[SUCCESS] Source should be available at ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash}/${checksum}" + f_log "[SUCCESS] Source should be available at ${lookaside_baseurl}/sources/${pkgname}/${file}/${hash_parameter}/${checksum}/${file}" else f_log "[ERROR] it seems there is a mismatch with source size and remote file size" fi