BGE: Adding two new functions to bge.render to allow users to change the anisotropic...
[blender-staging.git] / build_files / buildbot / master_unpack.py
index 06c11b368b04efe812e430b1bdd98899204dec5f..ad7c09933c69ad2058d4b0dcc366733ba988c28b 100644 (file)
@@ -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,22 @@ 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 +105,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 +131,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: