pmDist.py
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 """Creates a release package for PyMite
00016
00017 Makes fresh export (no .svn folders), builds the docs, makes pymite-RR.tar.gz
00018 and creates release tag in the svn repository
00019 """
00020
00021
00022
00023
00024
00025
00026
00027 import os, string, subprocess, sys, tempfile
00028
00029
00030 REPOS = "https://python-on-a-chip.googlecode.com/svn/"
00031
00032 RELEASE_NUM = sys.argv[1]
00033 assert string.atoi(RELEASE_NUM, 16) > 6
00034 print "Building package for release", RELEASE_NUM, "..."
00035 PM_RELEASE = "pymite-%s" % RELEASE_NUM
00036
00037
00038 subprocess.check_call(["svn",
00039 "cp",
00040 REPOS + "trunk",
00041 REPOS + "tags/%s" % PM_RELEASE,
00042 '-m "Tagging PyMite release %s"' % RELEASE_NUM],
00043 cwd = tempdir)
00044
00045
00046 tempdir = tempfile.gettempdir()
00047 subprocess.check_call(["svn",
00048 "export",
00049 REPOS + "tags/%s" % PM_RELEASE,
00050 PM_RELEASE],
00051 cwd = tempdir)
00052
00053
00054 subprocess.check_call(["make", "html"],
00055 cwd = os.path.join(tempdir, PM_RELEASE))
00056
00057
00058 subprocess.check_call(["tar -cz %s/ > %s.tar.gz" % (PM_RELEASE, PM_RELEASE)],
00059 cwd = tempdir, shell=True)
00060 subprocess.check_call(["cp %s.tar.gz ." % os.path.join(tempdir, PM_RELEASE)],
00061 shell=True)
00062
00063 print "Done."