Skip to content

Instantly share code, notes, and snippets.

@bart0sh
Created August 11, 2015 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bart0sh/592fceb5bd384c857082 to your computer and use it in GitHub Desktop.
Save bart0sh/592fceb5bd384c857082 to your computer and use it in GitHub Desktop.
--- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
@@ -41,12 +41,14 @@ 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, path=None):
url = None
+ if not path:
+ path = os.path.dirname(filepath)
# 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)
+ cmd = subprocess.Popen("git remote -v", shell=True, cwd = 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)
@@ -115,7 +117,8 @@ 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'])
+ print 'debug:', layerinfo["name"], os.getcwd()
+ lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url'], layerinfo['localpath'])
else:
lo.vcs_url = layerinfo['vcs_url']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment