mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 00:39:46 +00:00
devtool: update-recipe: fix --initial-rev option
In OE-Core revision 7baf57ad896112cf2258b3e2c2a1f8b756fb39bc I changed the default update-recipe behaviour to only update patches for commits that were changed; unfortunately I failed to handle the --initial-rev option which was broken after that point. Rework how the initial revision is passed in so that it now operates correctly. (From OE-Core rev: b2ca2523cc9e51a4759b4420b07b0b67b3f5ac43) (From OE-Core rev: d62aa298b80af78bc89f6e64736ce7383c3fa2de) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7343438092
commit
c3c25ac53d
@@ -809,22 +809,19 @@ def modify(args, config, basepath, workspace):
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def _get_patchset_revs(args, srctree, recipe_path):
|
def _get_patchset_revs(srctree, recipe_path, initial_rev=None):
|
||||||
"""Get initial and update rev of a recipe. These are the start point of the
|
"""Get initial and update rev of a recipe. These are the start point of the
|
||||||
whole patchset and start point for the patches to be re-generated/updated.
|
whole patchset and start point for the patches to be re-generated/updated.
|
||||||
"""
|
"""
|
||||||
import bb
|
import bb
|
||||||
|
|
||||||
if args.initial_rev:
|
# Parse initial rev from recipe if not specified
|
||||||
return args.initial_rev, args.initial_rev
|
|
||||||
|
|
||||||
# Parse initial rev from recipe
|
|
||||||
commits = []
|
commits = []
|
||||||
initial_rev = None
|
|
||||||
with open(recipe_path, 'r') as f:
|
with open(recipe_path, 'r') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if line.startswith('# initial_rev:'):
|
if line.startswith('# initial_rev:'):
|
||||||
initial_rev = line.split(':')[-1].strip()
|
if not initial_rev:
|
||||||
|
initial_rev = line.split(':')[-1].strip()
|
||||||
elif line.startswith('# commit:'):
|
elif line.startswith('# commit:'):
|
||||||
commits.append(line.split(':')[-1].strip())
|
commits.append(line.split(':')[-1].strip())
|
||||||
|
|
||||||
@@ -1123,7 +1120,7 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data):
|
|||||||
raise DevtoolError('unable to find workspace bbappend for recipe %s' %
|
raise DevtoolError('unable to find workspace bbappend for recipe %s' %
|
||||||
args.recipename)
|
args.recipename)
|
||||||
|
|
||||||
initial_rev, update_rev, changed_revs = _get_patchset_revs(args, srctree, append)
|
initial_rev, update_rev, changed_revs = _get_patchset_revs(srctree, append, args.initial_rev)
|
||||||
if not initial_rev:
|
if not initial_rev:
|
||||||
raise DevtoolError('Unable to find initial revision - please specify '
|
raise DevtoolError('Unable to find initial revision - please specify '
|
||||||
'it with --initial-rev')
|
'it with --initial-rev')
|
||||||
|
|||||||
Reference in New Issue
Block a user