From 2fadf4ba6f411c0b74d5d443fb01d6380dc34f10 Mon Sep 17 00:00:00 2001
From: Boud Roukema <boud@cosmo.torun.pl>
Date: Tue, 21 Jul 2020 18:01:22 +0200
Subject: Printing location when downloaded input data checksum is different

There are many different directory trees involved in Maneage system: the
top directory, the 'reproduce/' directory and its sub-directories,
'.build/' (that point to a user-defined build area), and a possibly
user-defined input directory. Until now, in the case of a download checksum
failure, it was not immediately obvious [1] to the user *where* the file
with a failed checksum is.

To clarify to the user *where* the suspicious file is now located, this
commit adds a line to 'reproduce/analysis/make/download.mk' to print out
this full path location: '$$unchecked' along with the expected and
calculated checksums.

[1] Euphemism for me spending lots of time debugging and being confused.
---
 reproduce/analysis/make/download.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/reproduce/analysis/make/download.mk b/reproduce/analysis/make/download.mk
index fb3f523..0eb28ff 100644
--- a/reproduce/analysis/make/download.mk
+++ b/reproduce/analysis/make/download.mk
@@ -88,6 +88,7 @@ $(inputdatasets): $(indir)/%.fits: | $(indir) $(lockdir)
 	else
 	  echo; echo;
 	  echo "Wrong MD5 checksum for input file '$$localname':"
+	  echo "  File location: $$unchecked"; \
 	  echo "  Expected MD5 checksum:   $$mdf"; \
 	  echo "  Calculated MD5 checksum: $$sum"; \
 	  echo; exit 1
-- 
cgit v1.2.1