mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-30 14:46:31 +00:00
support/graph-depends: teach it to only check dependencies
Add an option to graph-depends to only do the dependency checks and not generate the dot program. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
f48c08f0f5
commit
90551bfac0
@ -38,6 +38,8 @@ max_depth = 0
|
|||||||
transitive = True
|
transitive = True
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Graph packages dependencies")
|
parser = argparse.ArgumentParser(description="Graph packages dependencies")
|
||||||
|
parser.add_argument("--check-only", "-C", dest="check_only", action="store_true", default=False,
|
||||||
|
help="Only do the dependency checks (circular deps...)")
|
||||||
parser.add_argument("--outfile", "-o", metavar="OUT_FILE", dest="outfile",
|
parser.add_argument("--outfile", "-o", metavar="OUT_FILE", dest="outfile",
|
||||||
help="File in which to generate the dot representation")
|
help="File in which to generate the dot representation")
|
||||||
parser.add_argument("--package", '-p', metavar="PACKAGE",
|
parser.add_argument("--package", '-p', metavar="PACKAGE",
|
||||||
@ -62,9 +64,14 @@ parser.add_argument("--no-transitive", dest="transitive", action='store_false',
|
|||||||
help="Draw (do not draw) transitive dependencies")
|
help="Draw (do not draw) transitive dependencies")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
check_only = args.check_only
|
||||||
|
|
||||||
if args.outfile is None:
|
if args.outfile is None:
|
||||||
outfile = sys.stdout
|
outfile = sys.stdout
|
||||||
else:
|
else:
|
||||||
|
if check_only:
|
||||||
|
sys.stderr.write("don't specify outfile and check-only at the same time\n")
|
||||||
|
sys.exit(1)
|
||||||
outfile = open(args.outfile, "wb")
|
outfile = open(args.outfile, "wb")
|
||||||
|
|
||||||
if args.package is None:
|
if args.package is None:
|
||||||
@ -351,6 +358,9 @@ def remove_extra_deps(deps):
|
|||||||
return deps
|
return deps
|
||||||
|
|
||||||
check_circular_deps(dict_deps)
|
check_circular_deps(dict_deps)
|
||||||
|
if check_only:
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
dict_deps = remove_extra_deps(dict_deps)
|
dict_deps = remove_extra_deps(dict_deps)
|
||||||
dict_version = get_version([pkg for pkg in allpkgs
|
dict_version = get_version([pkg for pkg in allpkgs
|
||||||
if pkg != "all" and not pkg.startswith("root")])
|
if pkg != "all" and not pkg.startswith("root")])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user