1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

include latest commit info in source tarball

This commit is contained in:
lins05
2013-03-04 11:52:40 +08:00
parent 52703e6464
commit 1c90bdd13f

View File

@@ -5,14 +5,13 @@ import sys
import os import os
import tempfile import tempfile
import shutil import shutil
import re import commands
import subprocess import subprocess
import atexit import atexit
import optparse import optparse
cwd = os.getcwd() cwd = os.getcwd()
#################### ####################
### Common helper functions ### Common helper functions
#################### ####################
@@ -122,6 +121,8 @@ def main():
if not exist_in_path('django-admin') and not exist_in_path('django-admin.py'): if not exist_in_path('django-admin') and not exist_in_path('django-admin.py'):
error('django-admin scripts not found in PATH') error('django-admin scripts not found in PATH')
latest_commit_info = commands.getoutput('git log %s -1' % branch)
# begin # begin
tmpdir = tempfile.mkdtemp() tmpdir = tempfile.mkdtemp()
info('tmpdir is %s' % tmpdir) info('tmpdir is %s' % tmpdir)
@@ -151,6 +152,10 @@ def main():
if run('./i18n.sh compile-all', cwd=seahub_dir) != 0: if run('./i18n.sh compile-all', cwd=seahub_dir) != 0:
error('failed to compile messages') error('failed to compile messages')
with open(os.path.join(seahub_dir, 'latest_commit'), 'w') as fp:
fp.write(latest_commit_info)
fp.write('\n')
if run('tar czvf %s seahub-%s' % (tarball_name, version)) != 0: if run('tar czvf %s seahub-%s' % (tarball_name, version)) != 0:
error('failed to generate tarball') error('failed to generate tarball')