Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
- index 9163e9b..79dd6bb 100644
- --- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
- +++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
- @@ -41,19 +41,23 @@ class Command(BaseCommand):
- for i in ['bitbake', 'releases', 'defaultrelease', 'config', 'layersources']:
- assert i in data
- - def _read_git_url_from_local_repository(address):
- + def _read_git_url_from_local_repository(address,local_path=None):
- url = None
- # we detect the remote name at runtime
- import subprocess
- (remote, remote_name) = address.split(":", 1)
- - cmd = subprocess.Popen("git remote -v", shell=True, cwd = os.path.dirname(filepath), stdout=subprocess.PIPE, stderr = subprocess.PIPE)
- + if local_path == None:
- + local_path = filepath
- + if not os.path.isdir(local_path):
- + local_path = os.path.dirname(local_path)
- + cmd = subprocess.Popen("git remote -v", shell=True, cwd = local_path, stdout=subprocess.PIPE, stderr = subprocess.PIPE)
- (out,err) = cmd.communicate()
- if cmd.returncode != 0:
- raise Exception("Error while importing layer vcs_url: git error: %s" % err)
- for line in out.split("\n"):
- try:
- (name, path) = line.split("\t", 1)
- - if name == remote_name:
- + if name in remote_name.split(','):
- url = path.split(" ")[0]
- break
- except ValueError:
- @@ -115,7 +119,7 @@ class Command(BaseCommand):
- lo.vcs_url = layerinfo['vcs_url']
- if layerinfo['vcs_url'].startswith("remote:"):
- - lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url'])
- + lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url'], layerinfo['local_path'])
- else:
- lo.vcs_url = layerinfo['vcs_url']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement