mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
Use jq to generate package json
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
from __future__ import print_function
|
||||
import urllib
|
||||
import os
|
||||
import shutil
|
||||
import errno
|
||||
import os.path
|
||||
import hashlib
|
||||
@ -56,7 +57,8 @@ def unpack(filename, destination):
|
||||
rename_to = re.match(r'^([a-z][^\-]*\-*)+', dirname).group(0).encode('ascii').strip('-')
|
||||
if rename_to != dirname:
|
||||
print('Renaming {0} to {1}'.format(dirname, rename_to))
|
||||
os.rename(dirname, rename_to)
|
||||
shutil.rmtree(rename_to)
|
||||
shutil.move(dirname, rename_to)
|
||||
|
||||
def get_tool(tool):
|
||||
archive_name = tool['archiveFileName']
|
||||
@ -77,7 +79,7 @@ def get_tool(tool):
|
||||
unpack(local_path, '.')
|
||||
|
||||
def load_tools_list(filename, platform):
|
||||
tools_info = json.load(open(filename))
|
||||
tools_info = json.load(open(filename))['packages'][0]['tools']
|
||||
tools_to_download = []
|
||||
for t in tools_info:
|
||||
tool_platform = [p for p in t['systems'] if p['host'] == platform]
|
||||
@ -97,7 +99,7 @@ def identify_platform():
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('Platform: {0}'.format(identify_platform()))
|
||||
tools_to_download = load_tools_list('tools.json', identify_platform())
|
||||
tools_to_download = load_tools_list('../package/package_esp8266com_index.template.json', identify_platform())
|
||||
mkdir_p(dist_dir)
|
||||
for tool in tools_to_download:
|
||||
get_tool(tool)
|
||||
|
123
tools/tools.json
123
tools/tools.json
@ -1,123 +0,0 @@
|
||||
[ {
|
||||
"name":"esptool",
|
||||
"version":"0.4.6",
|
||||
"systems": [
|
||||
{
|
||||
"host":"i686-mingw32",
|
||||
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.6/esptool-0.4.6-win32.zip",
|
||||
"archiveFileName":"esptool-0.4.6-win32.zip",
|
||||
"checksum":"SHA-256:0248bf78514a3195f583e29218ca7828a66e13c6e5545a078f1c1257033e4927",
|
||||
"size":"17481"
|
||||
},
|
||||
{
|
||||
"host":"x86_64-apple-darwin",
|
||||
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.6/esptool-0.4.6-osx.tar.gz",
|
||||
"archiveFileName":"esptool-0.4.6-osx.tar.gz",
|
||||
"checksum":"SHA-256:0fe87ba7e29ee90a9fc72492aada8c0796f9e8f8a1c594b6b26cee2610d09bb3",
|
||||
"size":"20926"
|
||||
},
|
||||
{
|
||||
"host":"i386-apple-darwin",
|
||||
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.6/esptool-0.4.6-osx.tar.gz",
|
||||
"archiveFileName":"esptool-0.4.6-osx.tar.gz",
|
||||
"checksum":"SHA-256:0fe87ba7e29ee90a9fc72492aada8c0796f9e8f8a1c594b6b26cee2610d09bb3",
|
||||
"size":"20926"
|
||||
},
|
||||
{
|
||||
"host":"x86_64-pc-linux-gnu",
|
||||
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.6/esptool-0.4.6-linux64.tar.gz",
|
||||
"archiveFileName":"esptool-0.4.6-linux64.tar.gz",
|
||||
"checksum":"SHA-256:f9f456e9a42bb2597126c513cb8865f923fb978865d4838b9623d322216b74d0",
|
||||
"size":"12885"
|
||||
},
|
||||
{
|
||||
"host":"i686-pc-linux-gnu",
|
||||
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.6/esptool-0.4.6-linux32.tar.gz",
|
||||
"archiveFileName":"esptool-0.4.6-linux32.tar.gz",
|
||||
"checksum":"SHA-256:85275ca03a82bfc456f5a84e86962ca1e470ea2e168829c38ca29ee668831d93",
|
||||
"size":"13417"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"xtensa-lx106-elf-gcc",
|
||||
"version":"1.20.0-26-gb404fb9-2",
|
||||
"systems": [
|
||||
{
|
||||
"host":"i686-mingw32",
|
||||
"url":"http://arduino.esp8266.com/win32-xtensa-lx106-elf-gb404fb9-2.tar.gz",
|
||||
"archiveFileName":"win32-xtensa-lx106-elf-gb404fb9-2.tar.gz",
|
||||
"checksum":"SHA-256:10476b9c11a7a90f40883413ddfb409f505b20692e316c4e597c4c175b4be09c",
|
||||
"size":"153527527"
|
||||
},
|
||||
{
|
||||
"host":"x86_64-apple-darwin",
|
||||
"url":"http://arduino.esp8266.com/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz",
|
||||
"archiveFileName":"osx-xtensa-lx106-elf-gb404fb9-2.tar.gz",
|
||||
"checksum":"SHA-256:0cf150193997bd1355e0f49d3d49711730035257bc1aee1eaaad619e56b9e4e6",
|
||||
"size":"35385382"
|
||||
},
|
||||
{
|
||||
"host":"i386-apple-darwin",
|
||||
"url":"http://arduino.esp8266.com/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz",
|
||||
"archiveFileName":"osx-xtensa-lx106-elf-gb404fb9-2.tar.gz",
|
||||
"checksum":"SHA-256:0cf150193997bd1355e0f49d3d49711730035257bc1aee1eaaad619e56b9e4e6",
|
||||
"size":"35385382"
|
||||
},
|
||||
{
|
||||
"host":"x86_64-pc-linux-gnu",
|
||||
"url":"http://arduino.esp8266.com/linux64-xtensa-lx106-elf-gb404fb9.tar.gz",
|
||||
"archiveFileName":"linux64-xtensa-lx106-elf-gb404fb9.tar.gz",
|
||||
"checksum":"SHA-256:46f057fbd8b320889a26167daf325038912096d09940b2a95489db92431473b7",
|
||||
"size":"30262903"
|
||||
},
|
||||
{
|
||||
"host":"i686-pc-linux-gnu",
|
||||
"url":"http://arduino.esp8266.com/linux32-xtensa-lx106-elf.tar.gz",
|
||||
"archiveFileName":"linux32-xtensa-lx106-elf.tar.gz",
|
||||
"checksum":"SHA-256:b24817819f0078fb05895a640e806e0aca9aa96b47b80d2390ac8e2d9ddc955a",
|
||||
"size":"32734156"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"mkspiffs",
|
||||
"version":"0.1.2",
|
||||
"systems": [
|
||||
{
|
||||
"host":"i686-mingw32",
|
||||
"url":"https://github.com/igrr/mkspiffs/releases/download/0.1.2/mkspiffs-0.1.2-windows.zip",
|
||||
"archiveFileName":"mkspiffs-0.1.2-windows.zip",
|
||||
"checksum":"SHA-256:0a29119b8458b61a877408f7995e4944623a712e0d313a2c2f76af9ab55cc9f2",
|
||||
"size":"230802"
|
||||
},
|
||||
{
|
||||
"host":"x86_64-apple-darwin",
|
||||
"url":"https://github.com/igrr/mkspiffs/releases/download/0.1.2/mkspiffs-0.1.2-osx.tar.gz",
|
||||
"archiveFileName":"mkspiffs-0.1.2-osx.tar.gz",
|
||||
"checksum":"SHA-256:df656fae21a41c1269ea50cb53752dcaf6a4e1437255f3a9fb50b4025549b58e",
|
||||
"size":"115091"
|
||||
},
|
||||
{
|
||||
"host":"i386-apple-darwin",
|
||||
"url":"https://github.com/igrr/mkspiffs/releases/download/0.1.2/mkspiffs-0.1.2-osx.tar.gz",
|
||||
"archiveFileName":"mkspiffs-0.1.2-osx.tar.gz",
|
||||
"checksum":"SHA-256:df656fae21a41c1269ea50cb53752dcaf6a4e1437255f3a9fb50b4025549b58e",
|
||||
"size":"115091"
|
||||
},
|
||||
{
|
||||
"host":"x86_64-pc-linux-gnu",
|
||||
"url":"https://github.com/igrr/mkspiffs/releases/download/0.1.2/mkspiffs-0.1.2-linux64.tar.gz",
|
||||
"archiveFileName":"mkspiffs-0.1.2-linux64.tar.gz",
|
||||
"checksum":"SHA-256:1a1dd81b51daf74c382db71b42251757ca4136e8762107e69feaa8617bac315f",
|
||||
"size":"46281"
|
||||
},
|
||||
{
|
||||
"host":"i686-pc-linux-gnu",
|
||||
"url":"https://github.com/igrr/mkspiffs/releases/download/0.1.2/mkspiffs-0.1.2-linux32.tar.gz",
|
||||
"archiveFileName":"mkspiffs-0.1.2-linux32.tar.gz",
|
||||
"checksum":"SHA-256:e990d545dfcae308aabaac5fa9e1db734cc2b08167969e7eedac88bd0839667c",
|
||||
"size":"45272"
|
||||
}
|
||||
]
|
||||
} ]
|
Reference in New Issue
Block a user