add release update

This commit is contained in:
j 2014-08-05 11:47:16 +02:00
commit 81e29d1fc2
4 changed files with 121 additions and 22 deletions

View file

@ -27,14 +27,16 @@ def r(*cmd):
return subprocess.call(cmd)
def version(module):
os.chdir(join(root_dir, module))
version = get('git', 'log', '-1', '--format=%cd', '--date=iso').split(' ')[0].replace('-', '')
version += '-' + get('git', 'rev-list', 'HEAD', '--count').strip()
version += '-' + get('git', 'describe', '--always').strip()
os.chdir(root_dir)
if os.path.exists(join(root_dir, module, '.git')):
os.chdir(join(root_dir, module))
version = get('git', 'log', '-1', '--format=%cd', '--date=iso').split(' ')[0].replace('-', '')
version += '-' + get('git', 'rev-list', 'HEAD', '--count').strip()
version += '-' + get('git', 'describe', '--always').strip()
os.chdir(root_dir)
else:
version = settings.release['modules'][module]['version']
return version
class Version(Command):
"""
Print current version
@ -68,7 +70,11 @@ class Update(Command):
Update to latest development version
"""
def run(self):
pass
import update
if update.update():
print "OK"
else:
print "FAILED"
class PostUpdate(Command):
"""