Skip to content
Snippets Groups Projects
Commit 1ea7c885 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

check if existing exec is older than installation

parent 3a30bdab
Branches
Tags
No related merge requests found
......@@ -22,6 +22,7 @@ import h5py
import subprocess
import os
import shutil
from datetime import datetime
import bfps
from bfps.base import base
......@@ -155,6 +156,11 @@ class code(base):
if not os.path.isdir(self.work_dir):
os.makedirs(self.work_dir)
if not os.path.exists(os.path.join(self.work_dir, self.name)):
need_to_compile = True
else:
need_to_compile = (datetime.fromtimestamp(os.path.getctime(os.path.join(self.work_dir, self.name))) <
bfps.install_info['install_date'])
if need_to_compile:
assert(self.compile_code() == 0)
if self.work_dir != './':
shutil.copy(self.name, self.work_dir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment