diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-04 00:44:23 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-04 00:44:23 +0400 |
commit | 06ca70373768826da6c98f5eb5631f817164e11d (patch) | |
tree | 036051690d7b4406a879f988ba3b38ffd54c07e0 /build_files/buildbot/master_unpack.py | |
parent | ed072f2fef757cd46113b1216b46c40fbaa532f8 (diff) |
BuildBot: various changes to support building branches.
Diffstat (limited to 'build_files/buildbot/master_unpack.py')
-rw-r--r-- | build_files/buildbot/master_unpack.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py index 06c11b368b0..3e1dec726e5 100644 --- a/build_files/buildbot/master_unpack.py +++ b/build_files/buildbot/master_unpack.py @@ -43,6 +43,7 @@ def get_platform(filename): # platform out, but there may be some variations, so we fiddle a # bit to handle current and hopefully future names filename = strip_extension(filename) + filename = strip_extension(filename) tokens = filename.split("-") platforms = ('osx', 'mac', 'bsd', @@ -63,6 +64,21 @@ def get_platform(filename): return '-'.join(platform_tokens) +def get_branch(filename): + tokens = filename.split("-") + branch = "" + + for token in tokens: + if branch == "": + branch = token + else: + branch = branch + "-" + token + + if token == "blender": + return branch + + return "" + # get filename if len(sys.argv) < 2: sys.stderr.write("Not enough arguments, expecting file to unpack\n") @@ -88,8 +104,9 @@ if len(z.namelist()) != 1: package = z.namelist()[0] packagename = os.path.basename(package) -# detect platform +# detect platform and branch platform = get_platform(packagename) +branch = get_branch(packagename) if platform == '': sys.stderr.write('Failed to detect platform ' + @@ -113,10 +130,10 @@ except Exception, ex: sys.stderr.write('Failed to unzip package: %s\n' % str(ex)) sys.exit(1) -# remove other files from the same platform +# remove other files from the same platform and branch try: for f in os.listdir(directory): - if platform.lower() in f.lower(): + if get_platform(f) == platform and get_branch(f) == branch: if f != packagename: os.remove(os.path.join(directory, f)) except Exception, ex: |