[oe-commits] [bitbake] 20/22: toaster: localhostbecontroller Remove git assumption
git at git.openembedded.org
git at git.openembedded.org
Fri Sep 2 17:11:20 UTC 2016
rpurdie pushed a commit to branch master
in repository bitbake.
commit 8b7180332691a41a013e07a52b26018402141b6a
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Mon Aug 22 16:42:36 2016 +0100
toaster: localhostbecontroller Remove git assumption
We don't need to force everyone to use git for the method in which
openembedded-core is downloaded. For instance it could have been
downloaded and extracted as a tarball.
Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: Elliot Smith <elliot.smith at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/toaster/bldcontrol/localhostbecontroller.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index fbc5ee9..39de6dd 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -151,11 +151,17 @@ class LocalhostBEController(BuildEnvironmentController):
localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit))
logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname))
- # make sure our directory is a git repository
+ # see if our directory is a git repository
if os.path.exists(localdirname):
- localremotes = self._shellcmd("git remote -v", localdirname)
- if not giturl in localremotes:
- 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))
+ try:
+ localremotes = self._shellcmd("git remote -v",
+ localdirname)
+ if not giturl in localremotes:
+ 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))
+ except ShellCmdException:
+ # our localdirname might not be a git repository
+ #- that's fine
+ pass
else:
if giturl in cached_layers:
logger.debug("localhostbecontroller git-copying %s to %s" % (cached_layers[giturl], localdirname))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list