From fae067a0d7eeeaf3906d98fdd7b26d58cdefe289 Mon Sep 17 00:00:00 2001 From: Dominic Kempf Date: Thu, 14 May 2020 09:34:50 +0200 Subject: [PATCH] Use join_path from spack instead of string concatenation --- packages/dune/package.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/dune/package.py b/packages/dune/package.py index 19764c1..54617b8 100644 --- a/packages/dune/package.py +++ b/packages/dune/package.py @@ -24,8 +24,6 @@ import os from spack import * - - class Dune(CMakePackage): """ DUNE, the Distributed and Unified Numerics Environment is a modular toolbox for solving partial differential equations (PDEs) with grid-based methods. @@ -265,7 +263,7 @@ class Dune(CMakePackage): def cmake(self, spec, prefix): if self.stage.archive_file: os.remove(self.stage.archive_file) - optFile = open(self.stage.source_path+"/../dune.opts", "w") + optFile = open(join_path(self.stage.source_path, "..", "dune.opts"), "w") optFile.write('CMAKE_FLAGS="') for flag in self.cmake_args(): optFile.write(flag.replace("\"", "'")+" ") @@ -274,21 +272,21 @@ class Dune(CMakePackage): optFile.close() set_executable('bin/dunecontrol') installer = Executable('bin/dunecontrol') - options_file=self.stage.source_path+"/../dune.opts" + options_file = join_path(self.stage.source_path, "..", "dune.opts") installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'cmake') pass def install(self, spec, prefix): set_executable('bin/dunecontrol') installer = Executable('bin/dunecontrol') - options_file=self.stage.source_path+"/../dune.opts" + options_file = join_path(self.stage.source_path, "..", "dune.opts") installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'make', 'install') pass def build(self, spec, prefix): set_executable('bin/dunecontrol') installer = Executable('bin/dunecontrol') - options_file=self.stage.source_path+"/../dune.opts" + options_file = join_path(self.stage.source_path, "..", "dune.opts") installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'make') pass