mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
devtool: Fix source extraction for gcc shared source
If do_patch task is disabled then prepare do_configure dependencies to
fetch external sources and create symlink to ${S} in devtool workspace.
[YOCTO #13036]
(From OE-Core rev: 9a1bcf47f0242215610ddf917e8bd87e86fdf419)
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9e47319bfe62d289b90f7545a64dbdc1cbde7f1d)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d61b32f627
commit
1a0b7ca08e
@@ -589,6 +589,16 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
|
|||||||
else:
|
else:
|
||||||
task = 'do_patch'
|
task = 'do_patch'
|
||||||
|
|
||||||
|
if 'noexec' in (d.getVarFlags(task, False) or []) or 'task' not in (d.getVarFlags(task, False) or []):
|
||||||
|
logger.info('The %s recipe has %s disabled. Running only '
|
||||||
|
'do_configure task dependencies' % (pn, task))
|
||||||
|
|
||||||
|
if 'depends' in d.getVarFlags('do_configure', False):
|
||||||
|
pn = d.getVarFlags('do_configure', False)['depends']
|
||||||
|
pn = pn.replace('${PV}', d.getVar('PV'))
|
||||||
|
pn = pn.replace('${COMPILERDEP}', d.getVar('COMPILERDEP'))
|
||||||
|
task = None
|
||||||
|
|
||||||
# Run the fetch + unpack tasks
|
# Run the fetch + unpack tasks
|
||||||
res = tinfoil.build_targets(pn,
|
res = tinfoil.build_targets(pn,
|
||||||
task,
|
task,
|
||||||
@@ -600,6 +610,17 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
|
|||||||
if not res:
|
if not res:
|
||||||
raise DevtoolError('Extracting source for %s failed' % pn)
|
raise DevtoolError('Extracting source for %s failed' % pn)
|
||||||
|
|
||||||
|
if not is_kernel_yocto and ('noexec' in (d.getVarFlags('do_patch', False) or []) or 'task' not in (d.getVarFlags('do_patch', False) or [])):
|
||||||
|
workshareddir = d.getVar('S')
|
||||||
|
if os.path.islink(srctree):
|
||||||
|
os.unlink(srctree)
|
||||||
|
|
||||||
|
os.symlink(workshareddir, srctree)
|
||||||
|
|
||||||
|
# The initial_rev file is created in devtool_post_unpack function that will not be executed if
|
||||||
|
# do_unpack/do_patch tasks are disabled so we have to directly say that source extraction was successful
|
||||||
|
return True, True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(tempdir, 'initial_rev'), 'r') as f:
|
with open(os.path.join(tempdir, 'initial_rev'), 'r') as f:
|
||||||
initial_rev = f.read()
|
initial_rev = f.read()
|
||||||
@@ -847,10 +868,11 @@ def modify(args, config, basepath, workspace):
|
|||||||
if not initial_rev:
|
if not initial_rev:
|
||||||
return 1
|
return 1
|
||||||
logger.info('Source tree extracted to %s' % srctree)
|
logger.info('Source tree extracted to %s' % srctree)
|
||||||
# Get list of commits since this revision
|
if os.path.exists(os.path.join(srctree, '.git')):
|
||||||
(stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree)
|
# Get list of commits since this revision
|
||||||
commits = stdout.split()
|
(stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree)
|
||||||
check_commits = True
|
commits = stdout.split()
|
||||||
|
check_commits = True
|
||||||
else:
|
else:
|
||||||
if os.path.exists(os.path.join(srctree, '.git')):
|
if os.path.exists(os.path.join(srctree, '.git')):
|
||||||
# Check if it's a tree previously extracted by us. This is done
|
# Check if it's a tree previously extracted by us. This is done
|
||||||
|
|||||||
Reference in New Issue
Block a user