Permalink
Browse files

Update tools/* to work with git

Signed-off-by: Thomas Spura <tomspur@fedoraproject.org>
  • Loading branch information...
1 parent add50ed commit 7d3c2f471b90a1d7f67823733eba2e15da22a14f @tomspur committed Aug 30, 2010
Showing with 22 additions and 25 deletions.
  1. +12 −10 tools/make_tarball.py
  2. +0 −7 tools/toollib.py
  3. +10 −8 tools/update_revnum.py
View
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-"""Simple script to create a tarball with proper bzr version info.
+"""Simple script to create a tarball with proper git version info.
"""
import os
@@ -10,14 +10,16 @@
c('python update_revnum.py')
-execfile('../IPython/core/release.py') # defines version_base
+# definges branch, revision, version_base
+execfile('../IPython/core/release.py')
-ver = version_info()
-
-if ver['branch-nick'] == 'ipython':
- tarname = 'ipython-%s.bzr.r%s.tgz' % (version_base, ver['revno'])
+if branch == 'master':
+ tarname = 'ipython-%s.git.%s.tar.xz' % (version_base, revision[:7])
else:
- tarname = 'ipython-%s.bzr.r%s.%s.tgz' % (version_base, ver['revno'],
- ver['branch-nick'])
-
-c('bzr export ' + tarname)
+ tarname = 'ipython-%s.git.%s.%s.tar.xz' % (version_base, revision[:7],
+ branch)
+
+pwd = os.path.abspath(os.path.curdir)
+os.chdir('..')
+c('git archive --format=tar --prefix=ipython-%s/ %s | xz -z --force - > %s'
+ % (version_base, revision, pwd+os.sep+tarname) )
View
@@ -46,10 +46,3 @@ def compile_tree():
msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
msg += 'See messages above for the actual file that produced it.\n'
raise SystemExit(msg)
-
-
-def version_info():
- """Return bzr version info as a dict."""
- out = os.popen('bzr version-info')
- pairs = (l.split(':',1) for l in out)
- return dict(((k,v.strip()) for (k,v) in pairs))
View
@@ -8,23 +8,25 @@
./update_revnum.py"""
import os
-import pprint
import re
from toollib import *
if __name__ == '__main__':
- ver = version_info()
-
- pprint.pprint(ver)
+ # definges branch, revision, version_base
+ execfile('../IPython/core/release.py')
rfile = open('../IPython/core/release.py','rb').read()
- newcont = re.sub(r'revision\s*=.*',
- "revision = '%s'" % ver['revno'],
+ newcont = re.sub(r'\nrevision\s*=.*',
+ "\nrevision = '%s'" % revision,
rfile)
- newcont = re.sub(r'^branch\s*=[^=].*',
- "branch = '%s'" % ver['branch-nick'],
+ newcont = re.sub(r'\nbranch\s*=[^=].*',
+ "\nbranch = '%s'" % branch,
+ newcont)
+
+ newcont = re.sub(r'\ndevelopment\s*=[^=].*',
+ "\ndevelopment = False",
newcont)
f = open('../IPython/core/release.py','wb')

0 comments on commit 7d3c2f4

Please sign in to comment.