* [PATCH 1/6] toaster: don't use --single-branch when cloning
2015-09-23 22:34 [PATCH 0/6] fixes and improvements for layers cloning brian avery
@ 2015-09-23 22:34 ` brian avery
2015-09-23 22:34 ` [PATCH 2/6] toaster: use git reset --hard instead of rebase brian avery
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: brian avery @ 2015-09-23 22:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
git clone --single-branch works only with ref names. It fails if
commit sha1 is set in layer configuration with this error:
fatal: Remote branch <commit sha1> not found in upstream origin
Cloning repository without using --single-branch should work for
refs and commit sha1.
[YOCTO #7505]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
---
lib/toaster/bldcontrol/localhostbecontroller.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index a9909b8..3d2f8b0 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -260,8 +260,8 @@ class LocalhostBEController(BuildEnvironmentController):
self._shellcmd("git remote remove origin", localdirname)
self._shellcmd("git remote add origin \"%s\"" % giturl, localdirname)
else:
- logger.debug("localhostbecontroller: cloning %s:%s in %s" % (giturl, commit, localdirname))
- self._shellcmd("git clone \"%s\" --single-branch --branch \"%s\" \"%s\"" % (giturl, commit, localdirname))
+ logger.debug("localhostbecontroller: cloning %s in %s" % (giturl, localdirname))
+ self._shellcmd('git clone "%s" "%s"' % (giturl, localdirname))
# branch magic name "HEAD" will inhibit checkout
if commit != "HEAD":
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/6] toaster: use git reset --hard instead of rebase
2015-09-23 22:34 [PATCH 0/6] fixes and improvements for layers cloning brian avery
2015-09-23 22:34 ` [PATCH 1/6] toaster: don't use --single-branch when cloning brian avery
@ 2015-09-23 22:34 ` brian avery
2015-09-23 22:34 ` [PATCH 3/6] toaster: fix bug in resetting git repository brian avery
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: brian avery @ 2015-09-23 22:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
Replaced 'git checkout <ref> && git rebase' with 'git reset --hard' as
with git checkout repository ends up with detached HEAD. Rebase makes
things even worse as it can cause conflicts. git reset --hard resets
repository to the required state in a most straightforward and
reliable way.
[YOCTO #7505]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
---
lib/toaster/bldcontrol/localhostbecontroller.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index 3d2f8b0..42be4af 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -266,7 +266,7 @@ class LocalhostBEController(BuildEnvironmentController):
# branch magic name "HEAD" will inhibit checkout
if commit != "HEAD":
logger.debug("localhostbecontroller: checking out commit %s to %s " % (commit, localdirname))
- self._shellcmd("git fetch --all && git checkout \"%s\" && git rebase \"origin/%s\"" % (commit, commit) , localdirname)
+ self._shellcmd('git fetch --all && git reset --hard "origin/%s"' % commit, localdirname)
# take the localdirname as poky dir if we can find the oe-init-build-env
if self.pokydirname is None and os.path.exists(os.path.join(localdirname, "oe-init-build-env")):
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/6] toaster: fix bug in resetting git repository
2015-09-23 22:34 [PATCH 0/6] fixes and improvements for layers cloning brian avery
2015-09-23 22:34 ` [PATCH 1/6] toaster: don't use --single-branch when cloning brian avery
2015-09-23 22:34 ` [PATCH 2/6] toaster: use git reset --hard instead of rebase brian avery
@ 2015-09-23 22:34 ` brian avery
2015-09-23 22:34 ` [PATCH 4/6] toaster: fix reimporting module brian avery
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: brian avery @ 2015-09-23 22:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
git reset --hard should be given either commit id or
origin/<ref name> to work properly. Without this fix git will
complain that origin/<commit id> does not exist.
[YOCTO #7505]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
---
lib/toaster/bldcontrol/localhostbecontroller.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index 42be4af..0c34957 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -266,7 +266,8 @@ class LocalhostBEController(BuildEnvironmentController):
# branch magic name "HEAD" will inhibit checkout
if commit != "HEAD":
logger.debug("localhostbecontroller: checking out commit %s to %s " % (commit, localdirname))
- self._shellcmd('git fetch --all && git reset --hard "origin/%s"' % commit, localdirname)
+ ref = commit if re.match('^[a-fA-F0-9]+$', commit) else 'origin/%s' % commit
+ self._shellcmd('git fetch --all && git reset --hard "%s"' % ref, localdirname)
# take the localdirname as poky dir if we can find the oe-init-build-env
if self.pokydirname is None and os.path.exists(os.path.join(localdirname, "oe-init-build-env")):
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/6] toaster: fix reimporting module
2015-09-23 22:34 [PATCH 0/6] fixes and improvements for layers cloning brian avery
` (2 preceding siblings ...)
2015-09-23 22:34 ` [PATCH 3/6] toaster: fix bug in resetting git repository brian avery
@ 2015-09-23 22:34 ` brian avery
2015-09-23 22:34 ` [PATCH 5/6] toaster: make clone directory name unique brian avery
2015-09-23 22:34 ` [PATCH 6/6] toaster: move clones into subdirectory brian avery
5 siblings, 0 replies; 9+ messages in thread
From: brian avery @ 2015-09-23 22:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
removed second 'import re' from localhostbecontroller.py
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
---
lib/toaster/bldcontrol/localhostbecontroller.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index 0c34957..c22d41b 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -181,7 +181,6 @@ class LocalhostBEController(BuildEnvironmentController):
def getGitCloneDirectory(self, url, branch):
""" Utility that returns the last component of a git path as directory
"""
- import re
components = re.split(r'[:\.\/]', url)
base = components[-2] if components[-1] == "git" else components[-1]
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 5/6] toaster: make clone directory name unique
2015-09-23 22:34 [PATCH 0/6] fixes and improvements for layers cloning brian avery
` (3 preceding siblings ...)
2015-09-23 22:34 ` [PATCH 4/6] toaster: fix reimporting module brian avery
@ 2015-09-23 22:34 ` brian avery
2015-09-23 22:34 ` [PATCH 6/6] toaster: move clones into subdirectory brian avery
5 siblings, 0 replies; 9+ messages in thread
From: brian avery @ 2015-09-23 22:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
Changed naming scheme for clone directory. Used full git url and branch to
make it unique. This should fix the issue with using the same git
repository, but different protocols, e.g. git://some.git.repo and
http://some.git.repo.
[YOCTO #8101]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
---
lib/toaster/bldcontrol/localhostbecontroller.py | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index c22d41b..f826ad6 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -179,14 +179,9 @@ class LocalhostBEController(BuildEnvironmentController):
logger.debug("localhostbecontroller: Stopped bitbake server")
def getGitCloneDirectory(self, url, branch):
- """ Utility that returns the last component of a git path as directory
- """
- components = re.split(r'[:\.\/]', url)
- base = components[-2] if components[-1] == "git" else components[-1]
-
+ """Construct unique clone directory name out of url and branch."""
if branch != "HEAD":
- return "_%s_%s.toaster_cloned" % (base, branch)
-
+ return "_%s_%s.toaster_cloned" % (re.sub('[:/]', '_', url), branch)
# word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases
# which _ALWAYS_ means the current poky checkout
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 6/6] toaster: move clones into subdirectory
2015-09-23 22:34 [PATCH 0/6] fixes and improvements for layers cloning brian avery
` (4 preceding siblings ...)
2015-09-23 22:34 ` [PATCH 5/6] toaster: make clone directory name unique brian avery
@ 2015-09-23 22:34 ` brian avery
5 siblings, 0 replies; 9+ messages in thread
From: brian avery @ 2015-09-23 22:34 UTC (permalink / raw)
To: bitbake-devel
From: Ed Bartosh <ed.bartosh@linux.intel.com>
By default Toaster clones layers to the same level where
poky clone is. This can look messy if a lot of layers are
used for Toaster builds.
Moving them into _toaster_clones/ subdirectory should make
directory structure looking cleaner. It also safer to isolate
toaster clones from what user might create.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
---
lib/toaster/bldcontrol/localhostbecontroller.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index f826ad6..d3528e8 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -181,7 +181,7 @@ class LocalhostBEController(BuildEnvironmentController):
def getGitCloneDirectory(self, url, branch):
"""Construct unique clone directory name out of url and branch."""
if branch != "HEAD":
- return "_%s_%s.toaster_cloned" % (re.sub('[:/]', '_', url), branch)
+ return "_toaster_clones/_%s_%s" % (re.sub('[:/]', '_', url), branch)
# word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases
# which _ALWAYS_ means the current poky checkout
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread