* [PATCH 0/2] Couple of fixes for combo-layer
@ 2012-09-13 16:23 Paul Eggleton
2012-09-13 16:23 ` [PATCH 1/2] scripts/combo-layer: use last_revision if specified in init Paul Eggleton
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2012-09-13 16:23 UTC (permalink / raw)
To: openembedded-core
The following changes since commit 835654994574c158d6324218ebe000bd2ef9a792:
rt: Add hwlatdetect to rt images (2012-09-12 15:11:12 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/combo-layer-fixes8
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/combo-layer-fixes8
Paul Eggleton (2):
scripts/combo-layer: use last_revision if specified in init
scripts/combo-layer: ensure we validate branch/revision on init
scripts/combo-layer | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] scripts/combo-layer: use last_revision if specified in init
2012-09-13 16:23 [PATCH 0/2] Couple of fixes for combo-layer Paul Eggleton
@ 2012-09-13 16:23 ` Paul Eggleton
2012-09-13 16:23 ` [PATCH 2/2] scripts/combo-layer: ensure we validate branch/revision on init Paul Eggleton
2012-09-14 15:54 ` [PATCH 0/2] Couple of fixes for combo-layer Saul Wold
2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2012-09-13 16:23 UTC (permalink / raw)
To: openembedded-core
If last_revision is specified for a component when running combo-layer
init, then use that revision instead of the latest revision on the
branch. Also, remove unnecessary git checkout during init since we
specify the revision to all calls to git when dealing with the component
repositories.
Fixes [YOCTO #3040].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/combo-layer | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 330faca..65435db 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -174,25 +174,31 @@ def action_init(conf, args):
if not os.path.exists(ldir):
logger.info("cloning %s to %s" %(conf.repos[name]['src_uri'], ldir))
subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True)
- branch = conf.repos[name].get('branch', "master")
- runcmd("git checkout %s" % branch, ldir)
if not os.path.exists(".git"):
runcmd("git init")
for name in conf.repos:
repo = conf.repos[name]
ldir = repo['local_repo_dir']
- logger.info("copying data from %s..." % name)
+ branch = repo.get('branch', "master")
+ lastrev = repo.get('last_revision', None)
+ if lastrev and lastrev != "HEAD":
+ initialrev = lastrev
+ logger.info("Copying data from %s at specified revision %s..." % (name, lastrev))
+ else:
+ lastrev = None
+ initialrev = branch
+ logger.info("Copying data from %s..." % name)
dest_dir = repo['dest_dir']
if dest_dir and dest_dir != ".":
extract_dir = os.path.join(os.getcwd(), dest_dir)
os.makedirs(extract_dir)
else:
extract_dir = os.getcwd()
- branch = repo.get('branch', "master")
file_filter = repo.get('file_filter', "")
- runcmd("git archive %s | tar -x -C %s %s" % (branch, extract_dir, file_filter), ldir)
- lastrev = runcmd("git rev-parse %s" % branch, ldir).strip()
- conf.update(name, "last_revision", lastrev, initmode=True)
+ runcmd("git archive %s | tar -x -C %s %s" % (initialrev, extract_dir, file_filter), ldir)
+ if not lastrev:
+ lastrev = runcmd("git rev-parse %s" % initialrev, ldir).strip()
+ conf.update(name, "last_revision", lastrev, initmode=True)
runcmd("git add .")
if conf.localconffile:
localadded = True
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] scripts/combo-layer: ensure we validate branch/revision on init
2012-09-13 16:23 [PATCH 0/2] Couple of fixes for combo-layer Paul Eggleton
2012-09-13 16:23 ` [PATCH 1/2] scripts/combo-layer: use last_revision if specified in init Paul Eggleton
@ 2012-09-13 16:23 ` Paul Eggleton
2012-09-14 15:54 ` [PATCH 0/2] Couple of fixes for combo-layer Saul Wold
2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2012-09-13 16:23 UTC (permalink / raw)
To: openembedded-core
If both branch and last_revision are specified for a component when
combo-layer init is run, ensure that the specified revision is actually
on the specified branch and error out if not. Also ensure that the error
message mentions the component.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/combo-layer | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 65435db..3baea24 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -183,6 +183,9 @@ def action_init(conf, args):
lastrev = repo.get('last_revision', None)
if lastrev and lastrev != "HEAD":
initialrev = lastrev
+ if branch:
+ if not check_rev_branch(name, ldir, lastrev, branch):
+ sys.exit(1)
logger.info("Copying data from %s at specified revision %s..." % (name, lastrev))
else:
lastrev = None
@@ -278,7 +281,7 @@ def drop_to_shell(workdir=None):
else:
return True
-def check_rev_branch(repodir, rev, branch):
+def check_rev_branch(component, repodir, rev, branch):
try:
actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False).rstrip()
except subprocess.CalledProcessError as e:
@@ -290,10 +293,10 @@ def check_rev_branch(repodir, rev, branch):
if ' ' in actualbranch:
actualbranch = actualbranch.split(' ')[-1]
if not actualbranch:
- logger.error("Specified revision %s is invalid!" % rev)
+ logger.error("%s: specified revision %s is invalid!" % (component, rev))
return False
elif actualbranch != branch:
- logger.error("Specified revision %s is not on specified branch %s!" % (rev, branch))
+ logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch))
return False
return True
@@ -373,7 +376,7 @@ def action_update(conf, args):
patch_cmd_range = "--root %s" % branch
rev_cmd_range = branch
else:
- if not check_rev_branch(ldir, repo['last_revision'], branch):
+ if not check_rev_branch(name, ldir, repo['last_revision'], branch):
sys.exit(1)
patch_cmd_range = "%s..%s" % (repo['last_revision'], branch)
rev_cmd_range = patch_cmd_range
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Couple of fixes for combo-layer
2012-09-13 16:23 [PATCH 0/2] Couple of fixes for combo-layer Paul Eggleton
2012-09-13 16:23 ` [PATCH 1/2] scripts/combo-layer: use last_revision if specified in init Paul Eggleton
2012-09-13 16:23 ` [PATCH 2/2] scripts/combo-layer: ensure we validate branch/revision on init Paul Eggleton
@ 2012-09-14 15:54 ` Saul Wold
2 siblings, 0 replies; 4+ messages in thread
From: Saul Wold @ 2012-09-14 15:54 UTC (permalink / raw)
To: Paul Eggleton; +Cc: openembedded-core
On 09/13/2012 09:23 AM, Paul Eggleton wrote:
> The following changes since commit 835654994574c158d6324218ebe000bd2ef9a792:
>
> rt: Add hwlatdetect to rt images (2012-09-12 15:11:12 +0100)
>
> are available in the git repository at:
>
> git://git.openembedded.org/openembedded-core-contrib paule/combo-layer-fixes8
> http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/combo-layer-fixes8
>
> Paul Eggleton (2):
> scripts/combo-layer: use last_revision if specified in init
> scripts/combo-layer: ensure we validate branch/revision on init
>
> scripts/combo-layer | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
Merged into OE-Core
Thanks
Sau!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-14 16:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13 16:23 [PATCH 0/2] Couple of fixes for combo-layer Paul Eggleton
2012-09-13 16:23 ` [PATCH 1/2] scripts/combo-layer: use last_revision if specified in init Paul Eggleton
2012-09-13 16:23 ` [PATCH 2/2] scripts/combo-layer: ensure we validate branch/revision on init Paul Eggleton
2012-09-14 15:54 ` [PATCH 0/2] Couple of fixes for combo-layer Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox