Merge branch 'master' of github.com:xobs/foboot

This commit is contained in:
Sean Cross 2019-03-08 20:49:13 +08:00
commit 13360015db
2 changed files with 10 additions and 4 deletions

@ -1 +1 @@
Subproject commit f47066124207b43d38cb0e6bffacedd8fb0f523e Subproject commit 8151e2b34e74ebd20c435c637340293dadcc52c1

View File

@ -229,9 +229,9 @@ def check_dependencies(args, dependency_list):
sys.exit(0) sys.exit(0)
# Return True if the given tree needs to be initialized # Return True if the given tree needs to be initialized
def check_module_recursive(root_path, depth, verbose=False): def check_module_recursive(root_path, depth, verbose=False, breadcrumbs=[]):
if verbose: if verbose:
print('git-dep: checking if "{}" requires updating...'.format(root_path)) print('git-dep: checking if "{}" requires updating (depth: {})...'.format(root_path, depth))
# If the directory isn't a valid git repo, initialization is required # If the directory isn't a valid git repo, initialization is required
git_dir_cmd = subprocess.Popen(["git", "rev-parse", "--show-toplevel"], git_dir_cmd = subprocess.Popen(["git", "rev-parse", "--show-toplevel"],
@ -245,6 +245,12 @@ def check_module_recursive(root_path, depth, verbose=False):
return True return True
git_dir = git_stdout.decode().strip() git_dir = git_stdout.decode().strip()
if git_dir in breadcrumbs:
if verbose:
print('git-dep: root path {} is not in git path'.format(root_path))
return True
breadcrumbs.append(git_dir)
if not os.path.exists(git_dir + os.path.sep + '.git'): if not os.path.exists(git_dir + os.path.sep + '.git'):
if verbose: if verbose:
print('git-dep: .git not found in "{}"'.format(git_dir)) print('git-dep: .git not found in "{}"'.format(git_dir))
@ -262,7 +268,7 @@ def check_module_recursive(root_path, depth, verbose=False):
parts = line.split("=", 2) parts = line.split("=", 2)
if parts[0].strip() == "path": if parts[0].strip() == "path":
path = parts[1].strip() path = parts[1].strip()
if check_module_recursive(git_dir + os.path.sep + path, depth + 1, verbose=verbose): if check_module_recursive(git_dir + os.path.sep + path, depth + 1, verbose=verbose, breadcrumbs=breadcrumbs):
return True return True
return False return False