Skip to content

Clean tools key of obsolete version on next release #6258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/build_boards_manager_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ new_json=package_esp8266com_index.json

set +e
# Merge the old and new, then drop any obsolete package versions
python ../../merge_packages.py $new_json $old_json | python ../../drop_versions.py - platforms 1.6.5-947-g39819f0 2.5.0-beta1 2.5.0-beta2 2.5.0-beta3 2.4.0-rc1 2.4.0-rc2 >tmp && mv tmp $new_json && rm $old_json
python ../../merge_packages.py $new_json $old_json | python ../../drop_versions.py - tools 1.20.0-26-gb404fb9 >tmp && mv tmp $new_json && rm $old_json

# Verify the JSON file can be read, fail if it's not OK
set -e
Expand Down
5 changes: 3 additions & 2 deletions package/drop_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
from __future__ import print_function
import json
import sys
from collections import OrderedDict

def load_package(filename):
if filename == "-":
pkg = json.load(sys.stdin)['packages'][0]
pkg = json.load(sys.stdin, object_pairs_hook=OrderedDict)['packages'][0]
else:
pkg = json.load(open(filename))['packages'][0]
pkg = json.load(open(filename), object_pairs_hook=OrderedDict)['packages'][0]
print("Loaded package {0} from {1}".format(pkg['name'], filename), file=sys.stderr)
print("{0} platform(s), {1} tools".format(len(pkg['platforms']), len(pkg['tools'])), file=sys.stderr)
return pkg
Expand Down