externals: using v21

This commit is contained in:
Ricardo Quesada 2014-11-14 15:31:48 -08:00
parent 4ab77acd57
commit 8fd633926f
2 changed files with 18 additions and 9 deletions

View File

@ -34,7 +34,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************"""
import os.path,zipfile
import os.path
import zipfile
import shutil
import sys
import traceback
@ -48,18 +49,26 @@ from sys import stdout
from distutils.errors import DistutilsError
from distutils.dir_util import copy_tree, remove_tree
class UnrecognizedFormat:
def __init__(self, prompt):
self._prompt = prompt
def __str__(self):
return self._prompt
class CocosZipInstaller(object):
def __init__(self, workpath, config_path, version_path, remote_version_key = None):
def __init__(self, workpath, config_path, version_path, remote_version_key=None):
self._workpath = workpath
self._config_path = config_path
self._version_path = version_path
print self._config_path
print self._version_path
adfasdf()
data = self.load_json_file(config_path)
self._current_version = data["version"]
@ -76,7 +85,7 @@ class CocosZipInstaller(object):
try:
data = self.load_json_file(version_path)
if remote_version_key == None:
if remote_version_key is None:
self._remote_version = data["version"]
else:
self._remote_version = data[remote_version_key]
@ -117,7 +126,7 @@ class CocosZipInstaller(object):
file_size_dl = 0
block_sz = 8192
block_size_per_second = 0
old_time=time()
old_time = time()
while True:
buffer = u.read(block_sz)
@ -192,7 +201,6 @@ class CocosZipInstaller(object):
z.close()
print("==> Extraction done!")
def ask_to_delete_downloaded_zip_file(self):
ret = self.get_input_value("==> Do you want to keep '%s'? So you don't have to download it later. (yes/no): " % self._filename)
ret = ret.strip()
@ -200,7 +208,7 @@ class CocosZipInstaller(object):
print("==> Cache the dependency libraries by default")
return False
else:
return True if ret == 'no' or ret =='n' else False
return True if ret == 'no' or ret == 'n' else False
def download_zip_file(self):
if not os.path.isfile(self._filename):
@ -260,7 +268,7 @@ class CocosZipInstaller(object):
if os.path.exists(self._extracted_folder_name):
shutil.rmtree(self._extracted_folder_name)
if os.path.isfile(self._filename):
if remove_downloaded != None:
if remove_downloaded is not None:
if remove_downloaded == 'yes':
os.remove(self._filename)
elif self.ask_to_delete_downloaded_zip_file():
@ -278,6 +286,7 @@ def _check_python_version():
return True
def main():
workpath = os.path.dirname(os.path.realpath(__file__))
@ -303,7 +312,7 @@ def main():
print("==> Prepare to download external libraries!")
external_path = os.path.join(workpath, 'external')
installer = CocosZipInstaller(workpath, os.path.join(workpath, 'external', 'config.json'), os.path.join(workpath, 'external', 'version.json'), "prebuilt_libs_version")
installer.run(workpath,external_path, opts.remove_downloaded, opts.force_update, opts.download_only)
installer.run(workpath, external_path, opts.remove_downloaded, opts.force_update, opts.download_only)
print("=======================================================")
print("==> Prepare to download lua runtime binaries")

View File

@ -1,5 +1,5 @@
{
"version":"v3-deps-20",
"version":"v3-deps-21",
"zip_file_size":"87419231",
"repo_name":"cocos2d-x-3rd-party-libs-bin",
"repo_parent":"https://github.com/cocos2d/",