mirror of
https://git.centos.org/centos-git-common.git
synced 2025-02-23 16:22: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}')
|
checksum=$(sha1sum ${file}|awk '{print $1}')
|
||||||
|
|
||||||
f_log "Checking if file already uploaded"
|
f_log "Checking if file already uploaded"
|
||||||
result=$(curl ${lookaside_baseurl}/sources/upload.cgi \
|
local_size=$(stat -c %s ${file})
|
||||||
--fail \
|
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')
|
||||||
-s \
|
if [ "$local_size" -eq "$remote_size" ] ; then
|
||||||
--cert ~/.centos.cert \
|
|
||||||
--form "name=${pkgname}" \
|
|
||||||
--form "branch=${branch}" \
|
|
||||||
--form "sha1sum=${checksum}")
|
|
||||||
|
|
||||||
if [ "$result" = "Available" ] ;then
|
|
||||||
f_log "File already uploaded"
|
f_log "File already uploaded"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
@ -118,7 +112,6 @@ if [ "$upload_result" -ne "0" ] ;then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
f_log "Validating that source was correctly uploaded ...."
|
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')
|
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
|
if [ "$local_size" -eq "$remote_size" ] ; then
|
||||||
f_log "[SUCCESS] 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}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue