diff options
author | Yaakov M. Nemoy <loupgaroublond@gmail.com> | 2009-01-04 15:12:31 -0500 |
---|---|---|
committer | Yaakov M. Nemoy <loupgaroublond@gmail.com> | 2009-01-04 15:12:31 -0500 |
commit | 84289bb07a5485119fd5ec758d8b410e835e173f (patch) | |
tree | 35cf9d361c7b897f39bc8578090245d2b851e305 | |
parent | f6d858d6d2d1555e8fb6a374bb0e3071b01b0288 (diff) | |
download | fedora-devshell-84289bb07a5485119fd5ec758d8b410e835e173f.tar.gz fedora-devshell-84289bb07a5485119fd5ec758d8b410e835e173f.tar.xz fedora-devshell-84289bb07a5485119fd5ec758d8b410e835e173f.zip |
Added darcs support
it's not perfect
-rw-r--r-- | modules/cabal.py | 5 | ||||
-rw-r--r-- | modules/darcs.py | 45 | ||||
-rw-r--r-- | modules/dirfactory.py | 1 |
3 files changed, 50 insertions, 1 deletions
diff --git a/modules/cabal.py b/modules/cabal.py index ecb0f6b..89b8aad 100644 --- a/modules/cabal.py +++ b/modules/cabal.py @@ -48,6 +48,9 @@ class Cabal(Module): tarball = abspath(tarball) with pwd(self.root): self.package.add_sourceball(tarball) + + def darcs_get(self, url, tgt): + self.package.checkout(tgt, url) def find_setup(self, orig=''): setup_re = compile("Setup\.l?hs") @@ -64,7 +67,7 @@ class Cabal(Module): p = Popen([self.compiler, '--make', setup_f], stdout = ghc_out, stderr = ghc_out) log.info('Building %s, please wait...' % setup_f) - p.wait() + p.communicate() def configure(self, target='home', orig=''): user = True if target == 'home' else False diff --git a/modules/darcs.py b/modules/darcs.py new file mode 100644 index 0000000..4c73e02 --- /dev/null +++ b/modules/darcs.py @@ -0,0 +1,45 @@ +# Fedora Developer Shell +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Yaakov M. Nemoy <ynemoy@redhat.com> +# + +from __future__ import with_statement + +from subprocess import Popen + +from base.util import pwd, log +from modules.revisioncontrol import RevisionControl + +class Darcs(RevisionControl): + _type = 'darcs' + def load_dir(self, dir): + super(RevisionControl, self).load_dir(dir) + self.vc_url = self.cfg['vc_url'] + + def source_dir(self, *args): + return self.cfg['source'] + + def checkout(self, tgt, url, *args): + with pwd(self.dir): + self.cfg['source'] = tgt + self.cfg['vc_url'] = url + with file('darcs.log', 'a') as darcs_out: + p = Popen(['darcs', 'get'] + list(args) + [url, tgt], + stdout = darcs_out, stderr = darcs_out) + log.info('darcs get %s %s, please wait....' % (url, tgt)) + p.wait() + + pass diff --git a/modules/dirfactory.py b/modules/dirfactory.py index 3665a89..f394835 100644 --- a/modules/dirfactory.py +++ b/modules/dirfactory.py @@ -29,6 +29,7 @@ from modules.package import Package from modules.directory import Directory from modules.revisioncontrol import RevisionControl from modules.sourceball import SourceBall +from modules.darcs import Darcs # TODO: i'm jumping through bureaucrautic hoops right now. # Don't program at 3am kids, it's harmful to your sanity |