install: re-resolve cloned repositories as local ones

This commit is contained in:
Lephenixnoir 2021-01-14 11:15:59 +01:00
parent cd43a431a9
commit 559af6b190
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 7 additions and 4 deletions

View File

@ -219,7 +219,7 @@ def fetch(*args, use_ssh=False, use_https=False, force=False, update=False):
if not has_tag and force:
warn(f"{r.fullname} doesn't have the [giteapc] tag")
if not has_tag and not force:
return fatal(f"{r.fullname} doesn't have the [giteapc] tag, "+\
raise Error(f"{r.fullname} doesn't have the [giteapc] tag, "+\
"use -f to force")
# Checkout requested version, if any
@ -315,6 +315,9 @@ def search_dependencies(names, fetched, plan, **kwargs):
if r.fullname not in fetched:
fetch(r.fullname, **kwargs)
# Re-resolve, as a local repository this time
if r.remote:
r = s.resolve(local_only=True)
# Schedule dependencies before r
search_dependencies(r.dependencies(), fetched, plan, **kwargs)
@ -386,10 +389,10 @@ def uninstall(*args, keep=False):
if not keep:
msg("{}: {R}Removing files{_}".format(pretty_repo(r), **colors()))
if os.path.isdir(r.folder):
elif os.path.islink(r.folder):
if os.path.islink(r.folder):
elif os.path.isdir(r.folder):
raise Error(f"cannot handle {r.folder} (not a folder/symlink)")