mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +00:00
support/graph-depends: add option to completely exclude a package
Similar to --stop-on, but also omits the package from the graph. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Francois Perrad <fperrad@gmail.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
979267e8f7
commit
64b70f55cb
@ -46,6 +46,8 @@ parser.add_argument("--stop-on", "-s", metavar="PACKAGE", dest="stop_list", acti
|
|||||||
help="Do not graph past this package (can be given multiple times)." \
|
help="Do not graph past this package (can be given multiple times)." \
|
||||||
+ " Can be a package name or a glob, or" \
|
+ " Can be a package name or a glob, or" \
|
||||||
+ " 'virtual' to stop on virtual packages.")
|
+ " 'virtual' to stop on virtual packages.")
|
||||||
|
parser.add_argument("--exclude", "-x", metavar="PACKAGE", dest="exclude_list", action="append",
|
||||||
|
help="Like --stop-on, but do not add PACKAGE to the graph.")
|
||||||
parser.add_argument("--colours", "-c", metavar="COLOR_LIST", dest="colours",
|
parser.add_argument("--colours", "-c", metavar="COLOR_LIST", dest="colours",
|
||||||
default="lightblue,grey,gainsboro",
|
default="lightblue,grey,gainsboro",
|
||||||
help="Comma-separated list of the three colours to use" \
|
help="Comma-separated list of the three colours to use" \
|
||||||
@ -71,6 +73,11 @@ if args.stop_list is None:
|
|||||||
else:
|
else:
|
||||||
stop_list = args.stop_list
|
stop_list = args.stop_list
|
||||||
|
|
||||||
|
if args.exclude_list is None:
|
||||||
|
exclude_list = []
|
||||||
|
else:
|
||||||
|
exclude_list = args.exclude_list
|
||||||
|
|
||||||
transitive = args.transitive
|
transitive = args.transitive
|
||||||
|
|
||||||
# Get the colours: we need exactly three colours,
|
# Get the colours: we need exactly three colours,
|
||||||
@ -321,8 +328,14 @@ def print_pkg_deps(depth, pkg):
|
|||||||
return
|
return
|
||||||
if max_depth == 0 or depth < max_depth:
|
if max_depth == 0 or depth < max_depth:
|
||||||
for d in dict_deps[pkg]:
|
for d in dict_deps[pkg]:
|
||||||
print("%s -> %s" % (pkg_node_name(pkg), pkg_node_name(d)))
|
add = True
|
||||||
print_pkg_deps(depth+1, d)
|
for p in exclude_list:
|
||||||
|
if fnmatch(d,p):
|
||||||
|
add = False
|
||||||
|
break
|
||||||
|
if add:
|
||||||
|
print("%s -> %s" % (pkg_node_name(pkg), pkg_node_name(d)))
|
||||||
|
print_pkg_deps(depth+1, d)
|
||||||
|
|
||||||
# Start printing the graph data
|
# Start printing the graph data
|
||||||
print("digraph G {")
|
print("digraph G {")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user