1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

add script to tar up releases and snapshots

This commit is contained in:
Ludwig Nussel 2009-10-02 12:06:46 +00:00
parent 9dd2878642
commit 739961adfe
2 changed files with 31 additions and 1 deletions

29
mktar.py Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/python
# tar up svn snapshot. run with -r to produce a release
import subprocess
import os
import sys
from osc import core
release = False
v = core.__version__
if (len(sys.argv) > 1 and sys.argv[1] == '-r'):
release = True
if release:
if (v.endswith('_SVN')):
v=v[:-4]
print "don't forget to increase version in osc/core.py after release"
else:
v += subprocess.Popen(["svnversion", "."], stdout=subprocess.PIPE).stdout.read().strip()
d = "osc-" + v
f = d+".tar.bz2"
subprocess.check_call(["svn", "export", ".", d])
if release:
# TODO: create tag for release
subprocess.check_call(["sed", "-ie", "/^__version__/s/_SVN//", d+"/osc/core.py"])
subprocess.check_call(["tar", "--force-local", "--owner=root", "--group=root", "-cjf", f, d])
subprocess.call(["rm", "-rf", d]) # XXX how to do this in python properly?
print f

View File

@ -5,7 +5,8 @@
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or version 3 (at your option).
__version__ = '0.123pre'
__version__ = '0.122_SVN'
# __store_version__ is to be incremented when the format of the working copy
# "store" changes in an incompatible way. Please add any needed migration
# functionality to check_store_version().