This commit is contained in:
Thomas Nagy 2011-10-23 08:18:56 +02:00
parent c6f6bb29b1
commit 9e2ab03b3c
1 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,9 @@
#! /usr/bin/env python
"""
Create a tarball of the build results
"""
top = '.'
def configure(conf):
@ -11,7 +15,7 @@ def build(bld):
# ---------------------------
import shutil
import shutil, os
from waflib import Build
class package_cls(Build.InstallContext):
@ -25,6 +29,8 @@ class package_cls(Build.InstallContext):
shutil.rmtree(self.tmp.abspath())
except:
pass
if os.path.exists(self.tmp.abspath()):
self.fatal('Could not remove the temporary directory %r' % self.tmp)
self.tmp.mkdir()
self.options.destdir = self.tmp.abspath()
@ -37,7 +43,7 @@ class package_cls(Build.InstallContext):
files = self.tmp.ant_glob('**')
# we could mess with multiple inheritance but that's probably unnecessary
# we could mess with multiple inheritance but this is probably unnecessary
from waflib import Scripting
ctx = Scripting.Dist()
ctx.files = files
@ -47,3 +53,10 @@ class package_cls(Build.InstallContext):
shutil.rmtree(self.tmp.abspath())
# for variants, add command subclasses "package_release", "package_debug", etc
#def init(ctx):
# for x in VARIANTS.split():
# class tmp(y):
# cmd = package + '_' + x
# variant = x