summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index fbc5ee9d1d..39de6dd94e 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -151,11 +151,17 @@ class LocalhostBEController(BuildEnvironmentController):
151 localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit)) 151 localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit))
152 logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname)) 152 logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname))
153 153
154 # make sure our directory is a git repository 154 # see if our directory is a git repository
155 if os.path.exists(localdirname): 155 if os.path.exists(localdirname):
156 localremotes = self._shellcmd("git remote -v", localdirname) 156 try:
157 if not giturl in localremotes: 157 localremotes = self._shellcmd("git remote -v",
158 raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl)) 158 localdirname)
159 if not giturl in localremotes:
160 raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl))
161 except ShellCmdException:
162 # our localdirname might not be a git repository
163 #- that's fine
164 pass
159 else: 165 else:
160 if giturl in cached_layers: 166 if giturl in cached_layers:
161 logger.debug("localhostbecontroller git-copying %s to %s" % (cached_layers[giturl], localdirname)) 167 logger.debug("localhostbecontroller git-copying %s to %s" % (cached_layers[giturl], localdirname))