summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-21 13:30:23 -0500
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-21 13:30:23 -0500
commitf421d00c34d5bc475c80a2ad0c98e3d35a63b938 (patch)
tree13526c154c6316e78b0748247d759b74c8c3e5b1
parent89a3e791631b7b04e4396374f25ed64999f3a424 (diff)
downloadfedora-devshell-f421d00c34d5bc475c80a2ad0c98e3d35a63b938.tar.gz
fedora-devshell-f421d00c34d5bc475c80a2ad0c98e3d35a63b938.tar.xz
fedora-devshell-f421d00c34d5bc475c80a2ad0c98e3d35a63b938.zip
Bug fixes to make the demo work.
-rw-r--r--TODO3
-rw-r--r--modules/cabal.py6
-rw-r--r--modules/hackage.py3
-rw-r--r--modules/haskellport.py5
-rw-r--r--modules/package.py5
5 files changed, 14 insertions, 8 deletions
diff --git a/TODO b/TODO
index faefc20..2fad075 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,4 @@
* Implement Interface metaclasses to do type checking to make sure certain functions get implemented
* Implement auto property detection somehow
-* Rewrite the documentation \ No newline at end of file
+* Rewrite the documentation
+* annotate public facing functions to take a string from the shell and convert it to an object internally for referential transparency \ No newline at end of file
diff --git a/modules/cabal.py b/modules/cabal.py
index 3c75e19..1512a9d 100644
--- a/modules/cabal.py
+++ b/modules/cabal.py
@@ -24,8 +24,6 @@ from re import compile, DOTALL
from subprocess import Popen
-from urllib import urlopen, urlretrieve
-
from base.base import log
from base.exceptions import ExecutionException
from base.factories import DirFactory
@@ -133,8 +131,8 @@ class Cabal(BuildSystem):
self.build(orig)
self.install(orig)
- def gen_spec(self):
- cabal_file = self.pkg_src.hackage_name + '.cabal'
+ def gen_spec(self, hackage_name):
+ cabal_file = hackage_name + '.cabal'
with pwd(self.pkg_src.pkg_src_dir):
with log_file('cabal2spec.log') as c2s_log:
with pwd(self.pkg_src.dir):
diff --git a/modules/hackage.py b/modules/hackage.py
index 5b704ee..a38ccab 100644
--- a/modules/hackage.py
+++ b/modules/hackage.py
@@ -16,6 +16,9 @@
# Authors: Yaakov M. Nemoy <ynemoy@redhat.com>
#
+from re import compile, DOTALL
+from urllib import urlopen, urlretrieve
+
from modules.fetcher import Fetcher
class Hackage(Fetcher):
diff --git a/modules/haskellport.py b/modules/haskellport.py
index 553b47c..3ca6555 100644
--- a/modules/haskellport.py
+++ b/modules/haskellport.py
@@ -84,7 +84,9 @@ class HaskellPort(Port):
ver is the version wanted
'''
sb_loc = self.hackage.url(pkg, ver)
- return self.add_sourceball(sb_loc)
+ sb = self.add_sourceball(sb_loc)
+ sb.cfg['hackage_name'] = pkg
+ return sb
def add_latest(self, pkg):
'''get the latest version of a package from hackage
@@ -118,6 +120,7 @@ class HaskellPort(Port):
pkg_src = self.add_upstream(pkg, tgt, *args)
Cabal(pkg_src).install_source(target)
+
def close(self):
super(HaskellPort, self).close()
self.pkg.close()
diff --git a/modules/package.py b/modules/package.py
index e53f0dd..4fb1605 100644
--- a/modules/package.py
+++ b/modules/package.py
@@ -18,7 +18,7 @@
from __future__ import with_statement
-from os.path import split
+from os.path import basename, abspath
from base.base import log
from base.factories import DirFactory
@@ -56,7 +56,8 @@ class Package(Directory):
log.debug('spec_file_name is %s' % self.name + '.spec')
#TODO: get the spec file name, copy
# Then get the actual package name and set pkg_name to the right one
- spec_fname = split(spec_file)[1]
+ spec_file = abspath(spec_file)
+ spec_fname = basename(spec_file)
with pwd(self.dir):
try:
copy(spec_file, spec_fname)