[DEV] add the capability to load with ssh git interface

This commit is contained in:
Edouard DUPIN 2019-04-01 22:41:41 +02:00
parent 7f88a7cc34
commit bc556ee89b
2 changed files with 18 additions and 3 deletions

View File

@ -60,7 +60,12 @@ def execute(arguments):
#clone the manifest repository
address_manifest = ""
cmd = "git clone " + elem.select_remote["fetch"] + "/" + elem.name + " --branch " + elem.branch + " --origin " + elem.select_remote["name"] + " " + git_repo_path
cmd = "git clone " + elem.select_remote["fetch"]
if elem.select_remote["fetch"][0:4] == "git@":
cmd += ":"
else:
cmd += "/"
cmd += elem.name + " --branch " + elem.branch + " --origin " + elem.select_remote["name"] + " " + git_repo_path
debug.info("clone the repo")
ret = multiprocess.run_command_direct(cmd)
if ret != "" \
@ -72,7 +77,12 @@ def execute(arguments):
# add global mirror list
for mirror in elem.select_remote["mirror"]:
debug.verbose("Add global mirror: " + str(mirror))
cmd = "git remote add " + mirror["name"] + " " + mirror["fetch"] + "/" + elem.name
cmd = "git remote add " + mirror["name"] + " " + mirror["fetch"]
if mirror["fetch"][0:4] == "git@":
cmd += ":"
else:
cmd += "/"
cmd += elem.name
ret = multiprocess.run_command_direct(cmd, cwd=git_repo_path)
if ret != "" \
and ret != False:

View File

@ -78,7 +78,12 @@ class Manifest():
and ( fetch[0] == "/" \
or fetch[0] == "\\"):
fetch = fetch[1:]
base_origin = base_origin[:base_origin.rfind('/')]
offset_1 = base_origin.rfind('/')
offset_2 = base_origin.rfind(':')
if offset_1 > offset_2:
base_origin = base_origin[:offset_1]
else:
base_origin = base_origin[:offset_2]
debug.verbose("new base_origin=" + base_origin)
debug.verbose("tmp fetch=" + fetch)
if fetch != "":