From: Michael Wood Date: Mon, 22 Aug 2016 15:42:36 +0000 (+0100) Subject: toaster: localhostbecontroller Remove git assumption X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b7180332691a41a013e07a52b26018402141b6a;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 Signed-off-by: Elliot Smith Signed-off-by: Richard Purdie --- diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py index fbc5ee9d1d3..39de6dd94e0 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))