Share Pastebin
Guest
Public paste!

mememememe

By: a guest | Mar 15th, 2010 | Syntax: Python | Size: 0.66 KB | Hits: 31 | Expires: Never
Copy text to clipboard
  1. def _get_context():
  2.         ctx = Build.BuildContext()
  3.         ctx.load_dirs(_abspath(srcdir),_abspath(blddir))
  4.         ctx.load_envs()
  5.         return ctx
  6.  
  7. def bindist(ctx):
  8.         """creates a binary distribution that, when unzipped in the root directory of a machine, deploys the entire stack"""
  9.         ctx = _get_context()
  10.  
  11.         tarball = "%s-bindist-%s.tar.%s"%(APPNAME,VERSION,Scripting.g_gz)
  12.         zf = _join(ctx.bldnode.abspath(),tarball)
  13.         Options.options.destdir = _join(ctx.bldnode.abspath(),"bindist-destdir")
  14.         Scripting.install(ctx)
  15.        
  16.         if _exists(zf): _unlink(zf)
  17.         Utils.pprint("GREEN","Creating %s"%(zf))
  18.         z = tarfile.open(zf,"w:bz2")
  19.         _chdir(Options.options.destdir)
  20.         z.add(".")
  21.         z.close()