don't check packages repeatedly when running in recursive mode
This commit is contained in:
parent
66e598a492
commit
c79e998090
@ -105,7 +105,7 @@ def parse_actual_manifest(pkg, ver):
|
|||||||
|
|
||||||
return Manifest(name, version, dependencies, scripts)
|
return Manifest(name, version, dependencies, scripts)
|
||||||
|
|
||||||
def compare_manifests(pkg, brief=False, color=False, recursive=False):
|
def compare_manifests(pkg, brief=False, color=False, recursive=False, __checked_packages=[]):
|
||||||
mismatch = False
|
mismatch = False
|
||||||
if pkg.reported_manifest.version != pkg.actual_manifest.version:
|
if pkg.reported_manifest.version != pkg.actual_manifest.version:
|
||||||
mismatch = True
|
mismatch = True
|
||||||
@ -178,9 +178,11 @@ def compare_manifests(pkg, brief=False, color=False, recursive=False):
|
|||||||
print(colors.END, end='')
|
print(colors.END, end='')
|
||||||
|
|
||||||
if recursive:
|
if recursive:
|
||||||
|
__checked_packages.append(pkg.name)
|
||||||
for package in pkg.actual_manifest.dependencies:
|
for package in pkg.actual_manifest.dependencies:
|
||||||
print('Recursive: {}'.format(package))
|
if package in __checked_packages:
|
||||||
mismatch = compare_manifests(Package(package), brief=brief, color=color, recursive=True) or mismatch
|
continue
|
||||||
|
mismatch = compare_manifests(Package(package), brief=brief, color=color, recursive=True, __checked_packages=__checked_packages) or mismatch
|
||||||
|
|
||||||
return mismatch
|
return mismatch
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user