pmDist.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # This file is Copyright 2009, 2010 Dean Hall.
00004 #
00005 # This file is part of the Python-on-a-Chip program.
00006 # Python-on-a-Chip is free software: you can redistribute it and/or modify
00007 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
00008 # 
00009 # Python-on-a-Chip is distributed in the hope that it will be useful,
00010 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00012 # A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
00013 # is seen in the file COPYING in this directory.
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 ## @file
00022 #  @brief Creates a release package for PyMite
00023 #
00024 #  Makes fresh export (no .svn folders), builds the docs, makes pymite-RR.tar.gz
00025 #  and creates release tag in the svn repository
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 # Tag the release in the repository
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 # Export (no .svn folders) the tagged release in a temporary directory
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 # Build html docs
00054 subprocess.check_call(["make", "html"],
00055                       cwd = os.path.join(tempdir, PM_RELEASE))
00056 
00057 # Make pymite-RR.tar.gz and copy it to the current directory
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."

Generated on Mon Oct 18 07:40:47 2010 for Python-on-a-chip by  doxygen 1.5.9