mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 14:16:31 +00:00
support/graph-depends: accepts globs to stop on package
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
5558a34e9a
commit
979267e8f7
@ -24,6 +24,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import argparse
|
import argparse
|
||||||
|
from fnmatch import fnmatch
|
||||||
|
|
||||||
# Modes of operation:
|
# Modes of operation:
|
||||||
MODE_FULL = 1 # draw full dependency graph for all selected packages
|
MODE_FULL = 1 # draw full dependency graph for all selected packages
|
||||||
@ -43,6 +44,7 @@ parser.add_argument("--depth", '-d', metavar="DEPTH", dest="depth", type=int, de
|
|||||||
help="Limit the dependency graph to DEPTH levels; 0 means no limit.")
|
help="Limit the dependency graph to DEPTH levels; 0 means no limit.")
|
||||||
parser.add_argument("--stop-on", "-s", metavar="PACKAGE", dest="stop_list", action="append",
|
parser.add_argument("--stop-on", "-s", metavar="PACKAGE", dest="stop_list", action="append",
|
||||||
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" \
|
||||||
+ " 'virtual' to stop on virtual packages.")
|
+ " 'virtual' to stop on virtual packages.")
|
||||||
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",
|
||||||
@ -312,8 +314,9 @@ def print_pkg_deps(depth, pkg):
|
|||||||
print_attrs(pkg)
|
print_attrs(pkg)
|
||||||
if pkg not in dict_deps:
|
if pkg not in dict_deps:
|
||||||
return
|
return
|
||||||
if pkg in stop_list:
|
for p in stop_list:
|
||||||
return
|
if fnmatch(pkg, p):
|
||||||
|
return
|
||||||
if dict_version.get(pkg) == "virtual" and "virtual" in stop_list:
|
if dict_version.get(pkg) == "virtual" and "virtual" in stop_list:
|
||||||
return
|
return
|
||||||
if max_depth == 0 or depth < max_depth:
|
if max_depth == 0 or depth < max_depth:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user