diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-22 01:08:39 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-22 01:08:39 +0200 |
| commit | 73d96dce951aa2cd49c948e526ae552a05df345d (patch) | |
| tree | dbb886acffa5963e579989a9ddad5bd717ea0b94 | |
| parent | 9f7950b020ce4d9bb91e9e3722729d5b51b2ede3 (diff) | |
| download | allocbench-73d96dce951aa2cd49c948e526ae552a05df345d.tar.gz allocbench-73d96dce951aa2cd49c948e526ae552a05df345d.zip | |
fix patchdirartifact
The designated patchdir of an Allocator class is located at
src/allocators/<class name>
| -rw-r--r-- | src/allocator.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/allocator.py b/src/allocator.py index 9473f84..23b5147 100644 --- a/src/allocator.py +++ b/src/allocator.py @@ -56,10 +56,11 @@ class Allocator: "build_cmds"] def __init__(self, name, **kwargs): + self.class_file = inspect.getfile(self.__class__) self.name = name self.srcdir = os.path.join(SRCDIR, self.name) self.dir = os.path.join(BUILDDIR, self.name) - self.patchdir = os.path.join(src.globalvars.allocsrcdir, self.name) + self.patchdir = os.path.join(os.path.splitext(self.class_file)[0]) # Update attributes self.__dict__.update((k, v) for k, v in kwargs.items() if k in self.allowed_attributes) @@ -117,7 +118,7 @@ class Allocator: with open(buildtimestamp_path, "r") as buildtimestamp_file: timestamp = datetime.fromtimestamp(float(buildtimestamp_file.read())) - modtime = os.stat(inspect.getfile(self.__class__)).st_mtime + modtime = os.stat(self.class_file).st_mtime modtime = datetime.fromtimestamp(modtime) build_needed = timestamp < modtime |
