Advertisement
Guest User

Untitled

a guest
Aug 10th, 2015
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.21 KB | None | 0 0
  1. diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
  2. index 9163e9b..79dd6bb 100644
  3. --- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
  4. +++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
  5. @@ -41,19 +41,23 @@ class Command(BaseCommand):
  6.          for i in ['bitbake', 'releases', 'defaultrelease', 'config', 'layersources']:
  7.              assert i in data
  8.  
  9. -        def _read_git_url_from_local_repository(address):
  10. +        def _read_git_url_from_local_repository(address,local_path=None):
  11.              url = None
  12.              # we detect the remote name at runtime
  13.              import subprocess
  14.              (remote, remote_name) = address.split(":", 1)
  15. -            cmd = subprocess.Popen("git remote -v", shell=True, cwd = os.path.dirname(filepath), stdout=subprocess.PIPE, stderr = subprocess.PIPE)
  16. +            if local_path == None:
  17. +               local_path = filepath
  18. +            if not os.path.isdir(local_path):
  19. +               local_path = os.path.dirname(local_path)
  20. +            cmd = subprocess.Popen("git remote -v", shell=True, cwd = local_path, stdout=subprocess.PIPE, stderr = subprocess.PIPE)
  21.              (out,err) = cmd.communicate()
  22.              if cmd.returncode != 0:
  23.                  raise Exception("Error while importing layer vcs_url: git error: %s" % err)
  24.              for line in out.split("\n"):
  25.                  try:
  26.                      (name, path) = line.split("\t", 1)
  27. -                    if name == remote_name:
  28. +                    if name in remote_name.split(','):
  29.                          url = path.split(" ")[0]
  30.                          break
  31.                  except ValueError:
  32. @@ -115,7 +119,7 @@ class Command(BaseCommand):
  33.  
  34.                      lo.vcs_url = layerinfo['vcs_url']
  35.                      if layerinfo['vcs_url'].startswith("remote:"):
  36. -                        lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url'])
  37. +                        lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url'], layerinfo['local_path'])
  38.                      else:
  39.                          lo.vcs_url = layerinfo['vcs_url']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement