diff options
Diffstat (limited to 'modules/cabal.py')
-rw-r--r-- | modules/cabal.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/cabal.py b/modules/cabal.py index cc82db7..db5a636 100644 --- a/modules/cabal.py +++ b/modules/cabal.py @@ -29,7 +29,7 @@ from urllib import urlopen, urlretrieve from base.base import log from base.module import Module from base.exceptions import ExecutionException -from base.util import pwd, one +from base.util import pwd, one, log_file from base.vars import orig_src_dir, haskell_compiler from modules.dirfactory import DirFactory @@ -59,7 +59,7 @@ class Cabal(Module): def compile_setup(self, orig=''): log.debug('code_dir is ' + self.package.code_dir) with pwd(self.package.code_dir): - with file('ghc.log', 'a') as ghc_out: + with log_file('ghc.log') as ghc_out: log.debug('ghc.log file is ' + str(ghc_out)) log.debug('source_dir is ' + self.package.source_dir(orig)) with pwd(self.package.source_dir(orig)): @@ -73,7 +73,7 @@ class Cabal(Module): user = True if target == 'home' else False self.compile_setup(orig) with pwd(self.package.code_dir): - with file('cabal.log', 'a') as cabal_out: + with log_file('cabal.log') as cabal_out: log.debug('source_dir is ' + self.package.source_dir(orig)) with pwd(self.package.source_dir(orig)): args = [abspath('Setup'), 'configure'] + \ @@ -86,7 +86,7 @@ class Cabal(Module): '''This is not safe to run on an unconfigured source dir''' self.compile_setup(orig) with pwd(self.package.code_dir): - with file('cabal.log', 'a') as cabal_out: + with log_file('cabal.log') as cabal_out: with pwd(self.package.source_dir(orig)): args = [abspath('Setup'), 'build'] p = Popen(args, stdout=cabal_out, stderr=cabal_out) @@ -97,7 +97,7 @@ class Cabal(Module): '''This is not safe to run on an unconfigured source dir''' self.compile_setup(orig) with pwd(self.package.code_dir): - with file('cabal.log', 'a') as cabal_out: + with log_file('cabal.log') as cabal_out: with pwd(self.package.source_dir(orig)): args = [abspath('Setup'), 'install'] p = Popen(args, stdout=cabal_out, stderr=cabal_out) |