Skip to contentSkip to conversation

toaster: buildinfohelper stop constructiong local layer paths assuming git

PATCH New bavery 1 participant 2 messages Sep 20, 2016

lore
Share & tools
lore

bavery

author
#0 lore raw

cover toaster: buildinfohelper stop constructiong local layer paths assuming git

Local layers may have come from tar.gz files or have been created locally as part of the development process.

When the layer is local source don't try and work out the location of the layer by using the git information (getGitCloneDirectory)

-bavery

The following changes since commit 0e5cc654ac1d0db68c4e00ddbea8ab5026311cb4:

toaster: Add tests to detect if we have missing db migrations (2016-09-19 18:38:52 -0700)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib bavery/submit/toaster/suj/sep-19-git
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/submit/toaster/suj/sep-19-git

Michael Wood (1):
toaster: buildinfohelper local layer don't construct path using git
info

 lib/bb/ui/buildinfohelper.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--
1.9.1

author
#1 lore raw

PATCH 1/1 toaster: buildinfohelper local layer don't construct path using git info

From: Michael Wood <[email protected]>

When the layer is local source don't try and work out the location of the layer by using the git information (getGitCloneDirectory)

[YOCTO #10199]

---
 lib/bb/ui/buildinfohelper.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
lib/bb/ui/buildinfohelper.py +5 -3
index 2246960..b2c74dd 100644
@@ -451,7 +451,11 @@ class ORMWrapper(object):
             # note that this is different
             buildrequest = BuildRequest.objects.get(pk = br_id)
             for brl in buildrequest.brlayer_set.all():
-                localdirname = os.path.join(bc.getGitCloneDirectory(brl.giturl, brl.commit), brl.dirpath)
+                if brl.local_source_dir:
+                    localdirname = os.path.join(brl.local_source_dir,
+                                                brl.dirpath)
+                else:
+                    localdirname = os.path.join(bc.getGitCloneDirectory(brl.giturl, brl.commit), brl.dirpath)
                 # we get a relative path, unless running in HEAD mode where the path is absolute
                 if not localdirname.startswith("/"):
                     localdirname = os.path.join(bc.be.sourcedir, localdirname)
@@ -981,8 +985,6 @@ class BuildInfoHelper(object):
     def _get_layer_version_for_path(self, path):
         self._ensure_build()
 
-        assert path.startswith("/")
-
         def _slkey_interactive(layer_version):
             assert isinstance(layer_version, Layer_Version)
             return len(layer_version.local_path)
Signature · 1 line
1.9.1