mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2.1 KiB
Executable File
2.1 KiB
Executable File
#!/usr/bin/env python3
Simple graph query utility
useful for getting answers from .dot files produced by bitbake -g
Written by: Paul Eggleton paul.eggleton@linux.intel.com
Copyright 2013 Intel Corporation
SPDX-License-Identifier: GPL-2.0-only
import sys
def get_path_networkx(dotfile, fromnode, tonode): try: import networkx except ImportError: print('ERROR: Please install the networkx python module') sys.exit(1)
graph = networkx.DiGraph(networkx.nx_pydot.read_dot(dotfile))
def node_missing(node):
import difflib
close_matches = difflib.get_close_matches(node, graph.nodes(), cutoff=0.7)
if close_matches:
print('ERROR: no node "%s" in graph. Close matches:\n %s' % (node, '\n '.join(close_matches)))
sys.exit(1)
if not fromnode in graph:
node_missing(fromnode)
if not tonode in graph:
node_missing(tonode)
return networkx.all_simple_paths(graph, source=fromnode, target=tonode)
def find_paths(args, usage): if len(args) < 3: usage() sys.exit(1)
fromnode = args[1]
tonode = args[2]
path = None
for path in get_path_networkx(args[0], fromnode, tonode):
print(" -> ".join(map(str, path)))
if not path:
print("ERROR: no path from %s to %s in graph" % (fromnode, tonode))
sys.exit(1)
def main(): import optparse parser = optparse.OptionParser( usage = '''%prog [options]
Available commands: find-paths Find all of the paths between two nodes in a dot graph''')
#parser.add_option("-d", "--debug",
# help = "Report all SRCREV values, not just ones where AUTOREV has been used",
# action="store_true", dest="debug", default=False)
options, args = parser.parse_args(sys.argv)
args = args[1:]
if len(args) < 1:
parser.print_help()
sys.exit(1)
if args[0] == "find-paths":
find_paths(args[1:], parser.print_help)
else:
parser.print_help()
sys.exit(1)
if name == "main": main()