]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: localhostbecontroller Remove git assumption
authorMichael Wood <michael.g.wood@intel.com>
Mon, 22 Aug 2016 15:42:36 +0000 (16:42 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 2 Sep 2016 15:29:36 +0000 (16:29 +0100)
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@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/bldcontrol/localhostbecontroller.py

index fbc5ee9d1d37e27615ab631b834fd6073fee1c60..39de6dd94e0ada0831fb4a93c82c77f5482d15ba 100644 (file)
@@ -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))