install: allow full specification during fetch

This commit is contained in:
Lephenixnoir 2021-01-14 12:27:13 +01:00
parent 559af6b190
commit 370e01bff1
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -202,7 +202,7 @@ def fetch(*args, use_ssh=False, use_https=False, force=False, update=False):
return 0
for arg in args:
s = Spec(arg)
s = arg if isinstance(arg, Spec) else Spec(arg)
r = s.resolve()
# If this is a local repository, just git fetch
@ -313,11 +313,12 @@ def search_dependencies(names, fetched, plan, **kwargs):
r = s.resolve()
if r.fullname not in fetched:
fetch(r.fullname, **kwargs)
fetch(s, **kwargs)
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
search_dependencies(r.dependencies(), fetched, plan, **kwargs)
plan.append(s)