mirror of
https://git.centos.org/centos-git-common.git
synced 2025-02-23 08:12:56 +00:00
Adapt the check before upload to the new format
This commit is contained in:
parent
e6e12ecbfd
commit
b045956f51
1 changed files with 3 additions and 10 deletions
|
@ -79,15 +79,9 @@ fi
|
|||
checksum=$(sha1sum ${file}|awk '{print $1}')
|
||||
|
||||
f_log "Checking if file already uploaded"
|
||||
result=$(curl ${lookaside_baseurl}/sources/upload.cgi \
|
||||
--fail \
|
||||
-s \
|
||||
--cert ~/.centos.cert \
|
||||
--form "name=${pkgname}" \
|
||||
--form "branch=${branch}" \
|
||||
--form "sha1sum=${checksum}")
|
||||
|
||||
if [ "$result" = "Available" ] ;then
|
||||
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 "File already uploaded"
|
||||
exit 3
|
||||
fi
|
||||
|
@ -118,7 +112,6 @@ if [ "$upload_result" -ne "0" ] ;then
|
|||
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 "[SUCCESS] Source should be available at ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}"
|
||||
|
|
Loading…
Add table
Reference in a new issue