# HG changeset patch # User Doug Simon # Date 1417618956 -3600 # Node ID 676f1800077ca4ce1ec077116529750c87cc4682 # Parent f6ca61099649cbd3d518113cf822004e22ff788e mx: removed unused _read_projects_file function diff -r f6ca61099649 -r 676f1800077c mx/mx_graal.py --- a/mx/mx_graal.py Wed Dec 03 14:50:16 2014 +0100 +++ b/mx/mx_graal.py Wed Dec 03 16:02:36 2014 +0100 @@ -2113,7 +2113,7 @@ candidates = mx.findclass(args, logToConsole=False, matcher=lambda s, classname: s == classname or classname.endswith('.' + s) or classname.endswith('$' + s)) if len(candidates) > 0: - candidates = mx.select_items(list(mx.OrderedDict.fromkeys(candidates))) + candidates = mx.select_items(sorted(candidates)) else: # mx.findclass can be mistaken, don't give up yet candidates = args diff -r f6ca61099649 -r 676f1800077c mxtool/mx.py --- a/mxtool/mx.py Wed Dec 03 14:50:16 2014 +0100 +++ b/mxtool/mx.py Wed Dec 03 16:02:36 2014 +0100 @@ -43,7 +43,7 @@ import shutil, re, xml.dom.minidom import pipes import difflib -from collections import Callable, OrderedDict +from collections import Callable from threading import Thread from argparse import ArgumentParser, REMAINDER from os.path import join, basename, dirname, exists, getmtime, isabs, expandvars, isdir, isfile @@ -788,69 +788,6 @@ else: return None -# TODO: remove this function once all repos have transitioned -# to the new project format -def _read_projects_file(projectsFile): - suite = OrderedDict() - - suite['projects'] = OrderedDict() - suite['libraries'] = OrderedDict() - suite['jrelibraries'] = OrderedDict() - suite['distributions'] = OrderedDict() - - with open(projectsFile) as f: - prefix = '' - lineNum = 0 - - def error(message): - abort(projectsFile + ':' + str(lineNum) + ': ' + message) - - for line in f: - lineNum = lineNum + 1 - line = line.strip() - if line.endswith('\\'): - prefix = prefix + line[:-1] - continue - if len(prefix) != 0: - line = prefix + line - prefix = '' - if len(line) != 0 and line[0] != '#': - if '=' not in line: - error('non-comment line does not contain an "=" character') - key, value = line.split('=', 1) - - parts = key.split('@') - - if len(parts) == 1: - if parts[0] == 'suite': - suite['name'] = value - elif parts[0] == 'mxversion': - suite['mxversion'] = value - else: - error('Single part property must be "suite": ' + key) - - continue - if len(parts) != 3: - error('Property name does not have 3 parts separated by "@": ' + key) - kind, name, attr = parts - if kind == 'project': - m = suite['projects'] - elif kind == 'library': - m = suite['libraries'] - elif kind == 'jrelibrary': - m = suite['jrelibraries'] - elif kind == 'distribution': - m = suite['distributions'] - else: - error('Property name does not start with "project@", "library@" or "distribution@": ' + key) - - attrs = m.get(name) - if attrs is None: - attrs = OrderedDict() - m[name] = attrs - attrs[attr] = value - return suite - def _load_suite_dict(mxDir): suffix = 1