Permalink
Browse files

Fix for update-problem. Fixes #1

  • Loading branch information...
1 parent 4b1eaed commit a009a3fa88e6862baad1268688c7634395b2177e @zerok committed Jul 5, 2009
Showing with 8 additions and 3 deletions.
  1. +1 −1 setup.py
  2. +3 −1 zerokspot/recipe/git/__init__.py
  3. +4 −1 zerokspot/recipe/git/tests.py
View
@@ -6,7 +6,7 @@
author_email='zerok@zerokspot.com',
description='Simple zc.buildout recipe for sources in a git repository',
long_description = open('README.rst', 'r').read(),
- version='0.4.1',
+ version='0.4.2',
url='http://github.com/zerok/zerokspot.gitrecipe/',
install_requires=['setuptools', 'zc.buildout'],
namespace_packages=['zerokspot'],
@@ -93,6 +93,8 @@ def __init__(self, buildout, name, options):
self.cache_path = os.path.join(
buildout['buildout']['download-cache'],
self.cache_name)
+ else:
+ self.cache_path = None
options['location'] = os.path.join(
buildout['buildout']['parts-directory'], name)
self.as_egg = options.get('as_egg', 'false').lower() == 'true'
@@ -147,7 +149,7 @@ def update(self):
if self.rev is None and self.newest:
# Do an update of the current branch
print "Pulling updates from origin"
- if not self.cache_install:
+ if not self.cache_install and self.download_cache:
self._update_cache()
self._update_part()
os.chdir(self.options['location'])
@@ -87,7 +87,7 @@ def _buildout(self, options=None):
def testFetch(self):
"""
- Tests if the basic cloning of the repository works.
+ Tests if the basic cloning and updating of the repository works.
"""
testing.write(self.tempdir, 'buildout.cfg', """
@@ -100,6 +100,7 @@ def testFetch(self):
""" % {'repo' : self.temprepo})
self._buildout()
self.assertTrue(os.path.exists(os.path.join(self.tempdir, 'parts', 'gittest', 'test.txt')))
+ self._buildout()
def testRaiseExceptionOnAbsentCache(self):
"""
@@ -146,6 +147,7 @@ def testOffline(self):
# now install from cache
build = self._buildout([('buildout', 'install-from-cache', 'true')])
self.assertTrue(build['gittest'].recipe.installed_from_cache)
+ build = self._buildout([('buildout', 'install-from-cache', 'true')])
def testNonstandardBranch(self):
"""
@@ -165,6 +167,7 @@ def testNonstandardBranch(self):
recipe = build['gittest'].recipe
self.assertTrue(os.path.exists(os.path.join(recipe.cache_path, 'test2.txt')))
self.assertTrue(os.path.exists(os.path.join(recipe.options['location'], 'test2.txt')))
+ self._buildout()
if __name__ == '__main__':
sys.path.insert(0, os.path.normpath(

0 comments on commit a009a3f

Please sign in to comment.