mirror of
https://git.centos.org/centos-git-common.git
synced 2025-02-23 16:22:56 +00:00
Cosmetic change for lookaside_upload and better curl return code check
Signed-off-by: Fabian Arrotin <arrfab@centos.org>
This commit is contained in:
parent
c43fda67c5
commit
e6e12ecbfd
1 changed files with 10 additions and 3 deletions
|
@ -109,14 +109,21 @@ curl ${lookaside_baseurl}/sources/upload.cgi \
|
|||
--form "file=@${file}" \
|
||||
--progress-bar | tee /dev/null
|
||||
|
||||
f_log "Returned value: $?"
|
||||
upload_result="${PIPESTATUS[0]}"
|
||||
|
||||
if [ "$upload_result" -ne "0" ] ;then
|
||||
f_log "[ERROR] Something didn't work to push to ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}"
|
||||
f_log "[ERROR] Verify at the server side"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
f_log "Validating that source was correctly uploaded ...."
|
||||
local_size=$(stat -c %s ${file})
|
||||
remote_size=$(curl --silent -i --head ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}|grep "Content-Length"|cut -f 2 -d ':'|tr -d [:blank:]|tr -d '\r')
|
||||
if [ "$local_size" -eq "$remote_size" ] ; then
|
||||
f_log "Source should be available at ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}"
|
||||
f_log "[SUCCESS] Source should be available at ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}"
|
||||
else
|
||||
f_log "ERROR : it seems there is a mismatch with source size and remote file size"
|
||||
f_log "[ERROR] it seems there is a mismatch with source size and remote file size"
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue