mirror of
https://git.planet-casio.com/Lephenixnoir/GiteaPC.git
synced 2024-12-28 20:43:41 +01:00
install: re-resolve cloned repositories as local ones
This commit is contained in:
parent
cd43a431a9
commit
559af6b190
1 changed files with 7 additions and 4 deletions
|
@ -219,7 +219,7 @@ def fetch(*args, use_ssh=False, use_https=False, force=False, update=False):
|
||||||
if not has_tag and force:
|
if not has_tag and force:
|
||||||
warn(f"{r.fullname} doesn't have the [giteapc] tag")
|
warn(f"{r.fullname} doesn't have the [giteapc] tag")
|
||||||
if not has_tag and not force:
|
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")
|
"use -f to force")
|
||||||
|
|
||||||
# Checkout requested version, if any
|
# Checkout requested version, if any
|
||||||
|
@ -315,6 +315,9 @@ def search_dependencies(names, fetched, plan, **kwargs):
|
||||||
if r.fullname not in fetched:
|
if r.fullname not in fetched:
|
||||||
fetch(r.fullname, **kwargs)
|
fetch(r.fullname, **kwargs)
|
||||||
fetched.add(r.fullname)
|
fetched.add(r.fullname)
|
||||||
|
# Re-resolve, as a local repository this time
|
||||||
|
if r.remote:
|
||||||
|
r = s.resolve(local_only=True)
|
||||||
# Schedule dependencies before r
|
# Schedule dependencies before r
|
||||||
search_dependencies(r.dependencies(), fetched, plan, **kwargs)
|
search_dependencies(r.dependencies(), fetched, plan, **kwargs)
|
||||||
plan.append(s)
|
plan.append(s)
|
||||||
|
@ -386,10 +389,10 @@ def uninstall(*args, keep=False):
|
||||||
if not keep:
|
if not keep:
|
||||||
msg("{}: {R}Removing files{_}".format(pretty_repo(r), **colors()))
|
msg("{}: {R}Removing files{_}".format(pretty_repo(r), **colors()))
|
||||||
|
|
||||||
if os.path.isdir(r.folder):
|
if os.path.islink(r.folder):
|
||||||
shutil.rmtree(r.folder)
|
|
||||||
elif os.path.islink(r.folder):
|
|
||||||
os.remove(r.folder)
|
os.remove(r.folder)
|
||||||
|
elif os.path.isdir(r.folder):
|
||||||
|
shutil.rmtree(r.folder)
|
||||||
else:
|
else:
|
||||||
raise Error(f"cannot handle {r.folder} (not a folder/symlink)")
|
raise Error(f"cannot handle {r.folder} (not a folder/symlink)")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue