Ignore the path when comparing filenames from the md5 files.
[htsworkflow.git] / htsworkflow / util / hashfile.py
index f246410f34083fec6dd18f662d35c30613ec9bfc..fcfb7a386edbb1453d85275167be641ab358b236 100644 (file)
@@ -10,7 +10,6 @@ def make_md5sum(filename):
     """Quickly find the md5sum of a file
     """
     md5_cache = os.path.join(filename+".md5")
-    print md5_cache
     if os.path.exists(md5_cache):
         logger.debug("Found md5sum in {0}".format(md5_cache))
         stream = open(md5_cache,'r')
@@ -41,6 +40,8 @@ def make_md5sum_unix(filename, md5_cache):
 
 def parse_md5sum_line(lines, filename):
     md5sum, md5sum_filename = lines[0].split()
+    md5sum_filename = os.path.basename(md5sum_filename)
+    filename = os.path.basename(filename)
     if md5sum_filename != filename:
         errmsg = "MD5sum and I disagre about filename. {0} != {1}"
         logger.error(errmsg.format(filename, md5sum_filename))