Skip to content

Commit c532193

Browse files
committed
Adding comments and debug messages
1 parent 35358bf commit c532193

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ada/ada

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,10 +1820,12 @@ get_checksum () {
18201820
# We output only the requested checksum, nothing else.
18211821
# If the requested checksum for this file is not in the dCache database,
18221822
# the result will be empty.
1823+
$debug && set -x
18231824
curl "${curl_authorization[@]}" \
18241825
"${curl_options_no_errors[@]}" \
18251826
-X GET "$api/namespace/$encoded_path?checksum=true" \
18261827
| jq -r ".checksums[] | select(.type == \"$type\") | .value"
1828+
{ set +x ; } &> /dev/null
18271829
}
18281830

18291831

@@ -2973,11 +2975,15 @@ api_call () {
29732975
"${curl_target[@]}"
29742976
{ set +x ; } 2>/dev/null # Silently switch off tracing
29752977
if $verify_checksum ; then
2976-
# For now, we just print the checksums; verify will be implemented later.
2978+
$debug && echo 1>&2 "Comparing checksums..."
2979+
# Get the checksum of the remote file from the dCache database.
2980+
# First try Adler32 because it is the default in dCache,
2981+
# and fastest to calculate locally.
29772982
remote_checksum=$(get_checksum ADLER32 "$path")
29782983
if [[ -n $remote_checksum ]] ; then
29792984
local_checksum=$(get_local_checksum ADLER32 "$real_target")
29802985
else
2986+
# No Adler32 in the dCache database? Then try MD5.
29812987
remote_checksum=$(get_checksum MD5 "$path")
29822988
if [[ -z $remote_checksum ]] ; then
29832989
echo 1>&2 "ERROR: unable to get a checksum for file '$path'."

0 commit comments

Comments
 (0)