Revision: 833
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=833&view=rev
Author: mithro
Date: 2009-01-12 07:37:43 +0000 (Mon, 12 Jan 2009)
Log Message:
-----------
Add support for BuildModule to run the osc commands which upload to the build service.
Modified Paths:
--------------
trunk/python-ogre/BuildModule.py
Modified: trunk/python-ogre/BuildModule.py
===================================================================
--- trunk/python-ogre/BuildModule.py 2009-01-05 17:59:09 UTC (rev 832)
+++ trunk/python-ogre/BuildModule.py 2009-01-12 07:37:43 UTC (rev 833)
@@ -218,6 +218,7 @@
logger.warning("Was not able to build package")
logger.info("Package successfully built!")
+BUILDSERVICE_MODULE = "home:mithro:python-ogre-build"
def buildService ( module, install = False ):
""" Create a debian package for the module
"""
@@ -226,12 +227,28 @@
if not os.path.exists(srcdir):
exit("You need to get the src first, use -r")
+ # Make sure that the build directory exists
+ buildloc = os.path.join(os.getcwd(), 'build')
+ if not os.path.exists(buildloc):
+ spawnTask("mkdir -p %s" % buildloc, os.getcwd())
+
buildbase = os.path.join(os.getcwd(), 'build', module.base)
builddir = os.path.join(buildbase, module.base)
- # Make the builddir
- spawnTask("mkdir -p %s" % buildbase, os.getcwd())
+ if not os.path.exists(buildbase):
+ # Do the initial checkout
+ logger.info("Downloading %s:%s into %s" % (BUILDSERVICE_MODULE, module.base, buildloc))
+ spawnTask("osc checkout %s %s" % (BUILDSERVICE_MODULE, module.base), buildloc)
+ spawnTask("mv %s/%s %s" % (BUILDSERVICE_MODULE, module.base, module.base), buildloc)
+ spawnTask("rm -rf %s" % (BUILDSERVICE_MODULE,), buildloc)
+ else:
+ if not os.path.exists(os.path.join(buildbase, ".osc")):
+ raise TypeError("The buildservice directory is not a osc checkout! (Please remove and rerun this command.)")
+ # Do an update so we don't get conflicts
+ logger.info("Updating home:mithro:python-ogre:%s in %s" % (module.base, buildloc))
+ spawnTask("osc update", buildbase)
+
# Create the source we are making
spawnTask("cp -rvf %s/ %s" % (srcdir, builddir), os.getcwd())
@@ -279,13 +296,15 @@
' -e "s|%%SIZE%%|`du -b '+module.base+'.tar.gz | sed -e\'s/[\t ]/ /g\'`|g" ' + \
' -e "s|%%SHORTDATE%%|`date +%Y%m%d`|g" ' + \
' -e "s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|g" ' + \
- ' -e "s^%%BUILDDEPS%%^`cat '+os.path.join(debiandir, "control")+' | grep Build-Depends:`^g"' + \
+ ' -e "s^%%BUILDDEPS%%^`cat debian.control | grep Build-Depends:`^" ' + \
' -e "s|%%VERSION%%|'+module.source_version+'|g"'
, buildbase)
# Do some cleanup
spawnTask("rm -rf %s" % builddir, buildbase)
spawnTask("rm %s.md5sum" % module.base, buildbase)
+
+ spawnTask("osc diff", buildbase)
return
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|