diff --git a/lib/scafacos/Install.py b/lib/scafacos/Install.py index 8cfe8eb3f7..91ab10e099 100644 --- a/lib/scafacos/Install.py +++ b/lib/scafacos/Install.py @@ -55,6 +55,7 @@ if args.build == False and not args.path: buildflag = args.build pathflag = args.path != None +version = args.version homepath = fullpath(".") scafacospath = "%s/scafacos-%s" % (homepath,version) diff --git a/lib/smd/Install.py b/lib/smd/Install.py index 0c33cb36ef..c0db3e9a38 100644 --- a/lib/smd/Install.py +++ b/lib/smd/Install.py @@ -6,8 +6,7 @@ from __future__ import print_function import sys,os,re,glob,subprocess,shutil sys.path.append('..') -from install_helpers import fullpath,geturl - +from install_helpers import fullpath,geturl,checkmd5sum from argparse import ArgumentParser parser = ArgumentParser(prog='Install.py', @@ -26,7 +25,6 @@ checksums = { \ '3.3.7' : 'f2a417d083fe8ca4b8ed2bc613d20f07' \ } - # help message help = """ @@ -63,6 +61,7 @@ eigenpath = "%s/eigen3" % homepath buildflag = args.build pathflag = args.path != None +version = args.version if (pathflag): eigenpath = args.path @@ -77,6 +76,13 @@ if buildflag: url = "http://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version geturl(url,"%s/%s" % (homepath,tarball)) + # verify downloaded archive integrity via md5 checksum, if known. + if version in checksums: + print("checking version %s\n" % version) + if not checkmd5sum(checksums[version],'%s/%s' % (homepath,tarball)): + sys.exit("Checksum for Eigen library does not match") + + print("Cleaning up old folders ...") edir = glob.glob("%s/eigen-eigen-*" % homepath) edir.append(eigenpath)