summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-18 21:38:15 -0500
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-18 21:38:15 -0500
commit94e4032c8119b17b9de0af39eae983127d640461 (patch)
tree9ae79c359ecd46455f2832020616c2060a05d3a3
parent104b3c4262fa3cb6b24ed0e1cd5402b14f4eab8f (diff)
downloadfedora-devshell-94e4032c8119b17b9de0af39eae983127d640461.tar.gz
fedora-devshell-94e4032c8119b17b9de0af39eae983127d640461.tar.xz
fedora-devshell-94e4032c8119b17b9de0af39eae983127d640461.zip
Add gen spec function to the cabal build system
-rw-r--r--modules/buildsystem.py3
-rw-r--r--modules/cabal.py16
2 files changed, 16 insertions, 3 deletions
diff --git a/modules/buildsystem.py b/modules/buildsystem.py
index 254b726..dbedbfc 100644
--- a/modules/buildsystem.py
+++ b/modules/buildsystem.py
@@ -52,3 +52,6 @@ class BuildSystem(Module):
'''perform configure, build, and install steps in one
'''
raise NotImplementedError
+
+ def gen_spec(self):
+ raise NotImplementedError
diff --git a/modules/cabal.py b/modules/cabal.py
index 4ddea87..a993326 100644
--- a/modules/cabal.py
+++ b/modules/cabal.py
@@ -94,7 +94,7 @@ class Cabal(BuildSystem):
+ (['--user', '--prefix=' + expanduser('~')] if user else [])
p = Popen(cmd, stdout=cabal_out, stderr=cabal_out)
log.info('Configuring %s, please wait...' % self.name)
- p.wait()
+ p.communicate()
def build(self, *args):
'''runs the build stage of cabal
@@ -111,7 +111,7 @@ class Cabal(BuildSystem):
cmd = [abspath('Setup'), 'build']
p = Popen(cmd, stdout=cabal_out, stderr=cabal_out)
log.info('Building %s, please wait...' % self.name)
- p.wait()
+ p.communicate()
def install(self, *args):
'''runs the install stage of cabal
@@ -128,7 +128,7 @@ class Cabal(BuildSystem):
cmd = [abspath('Setup'), 'install']
p = Popen(cmd, stdout=cabal_out, stderr=cabal_out)
log.info('Building %s, please wait...' % self.name)
- p.wait()
+ p.communicate()
def install_source(self, target='home', *args):
'''perform configure, build, and install steps in one
@@ -138,6 +138,16 @@ class Cabal(BuildSystem):
self.build(orig)
self.install(orig)
+ def gen_spec(self):
+ cabal_file = self.pkg_src.hackage_name + '.spec'
+ with pwd(self.pkg_src.pkg_src_dir):
+ with log_file('cabal2spec.log') as c2s_log:
+ with pwd(self.pkg_src.dir):
+ cmd = ['cabal2spec', cabal_file]
+ p = Popen(cmd, stdout=c2s_log, stderr=c2s_log)
+ log.info('Generating spec file for %s' % cabal_file)
+ p.communicate()
+
def close(self):
self.pkg_src.close()