[yocto] [AB PATCH 09/22] yoctogit.py: Stop passing in srcdir.

Elizabeth Flanagan elizabeth.flanagan at intel.com
Wed Mar 19 13:51:07 PDT 2014


Don't pass in srcdir. Set it depending on mirrordir/method as a
class level property.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan at intel.com>
---
 .../buildbot/steps/source/yoctogit.py                | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/steps/source/yoctogit.py b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/steps/source/yoctogit.py
index 4c89ceb..62e3a02 100644
--- a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/steps/source/yoctogit.py
+++ b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/steps/source/yoctogit.py
@@ -63,7 +63,7 @@ class YoctoGit(Source):
     def __init__(self, repourl=None, branch='HEAD', mode='incremental',
                  method=None, submodules=False, shallow=False, progress=False,
                  retryFetch=False, clobberOnFailure=False, getDescription=False, 
-                 workdir='build', layername=None, srcdir='sources', storedir="/tmp/junk", mirrordir=None,
+                 workdir='build', layername=None, storedir="/tmp/junk", mirrordir=None,
                  config=None, **kwargs):
         """
         @type  repourl: string
@@ -98,9 +98,6 @@ class YoctoGit(Source):
         @type  getDescription: boolean or dict
         @param getDescription: Use 'git describe' to describe the fetched revision
 
-        @type srcdir: string
-        @param srcdir: Used to pass in where git clones should occur
-
         @type workdir: string
         @param workdir: Used to indicate the destination of the copy of srcdir
 
@@ -125,7 +122,6 @@ class YoctoGit(Source):
         self.retryFetch = retryFetch
         self.submodules = submodules
         self.shallow   = shallow
-        self.srcdir  = srcdir
         self.workdir = workdir
         self.storedir = storedir
         self.mirrordir = mirrordir
@@ -135,6 +131,20 @@ class YoctoGit(Source):
         self.mode = mode
         self.getDescription = getDescription
         self.config = config
+        # We no longer pass srcdir in. There are way too many ways to hang
+        # yourself by doing that.
+        if self.mirrordir:
+            if self.method in ['barecopy', 'movecopy']:
+                self.srcdir='source/'+self.repourl
+            else:
+                if "poky" in self.layername or \
+                   "oecore" in self.layername or \
+                   "eclipse" in self.layername:
+                    self.srcdir = "build"
+                else:
+                    self.srcdir = 'build/'+self.layername
+        else:
+            self.srcdir = 'source'
         Source.__init__(self, **kwargs)
 
         if self.mode not in ['incremental', 'full']:
-- 
1.8.1.2




More information about the yocto mailing list