diff options
| author | Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> | 2021-01-19 19:56:29 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-20 22:46:18 +0000 |
| commit | 0ad1537642675c7a24ac772828714739713bcfc1 (patch) | |
| tree | eaa5587d35c4d1cd3d443bee38d2726ca92d8486 /scripts/lib/devtool/standard.py | |
| parent | ed410b5dd87c8b512cf9d69c76c1ac79effa6836 (diff) | |
| download | poky-0ad1537642675c7a24ac772828714739713bcfc1.tar.gz | |
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: 9e47319bfe62d289b90f7545a64dbdc1cbde7f1d)
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
| -rw-r--r-- | scripts/lib/devtool/standard.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 261d642d4a..f7d8a82117 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -589,6 +589,16 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works | |||
| 589 | else: | 589 | else: |
| 590 | task = 'do_patch' | 590 | task = 'do_patch' |
| 591 | 591 | ||
| 592 | if 'noexec' in (d.getVarFlags(task, False) or []) or 'task' not in (d.getVarFlags(task, False) or []): | ||
| 593 | logger.info('The %s recipe has %s disabled. Running only ' | ||
| 594 | 'do_configure task dependencies' % (pn, task)) | ||
| 595 | |||
| 596 | if 'depends' in d.getVarFlags('do_configure', False): | ||
| 597 | pn = d.getVarFlags('do_configure', False)['depends'] | ||
| 598 | pn = pn.replace('${PV}', d.getVar('PV')) | ||
| 599 | pn = pn.replace('${COMPILERDEP}', d.getVar('COMPILERDEP')) | ||
| 600 | task = None | ||
| 601 | |||
| 592 | # Run the fetch + unpack tasks | 602 | # Run the fetch + unpack tasks |
| 593 | res = tinfoil.build_targets(pn, | 603 | res = tinfoil.build_targets(pn, |
| 594 | task, | 604 | task, |
| @@ -600,6 +610,17 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works | |||
| 600 | if not res: | 610 | if not res: |
| 601 | raise DevtoolError('Extracting source for %s failed' % pn) | 611 | raise DevtoolError('Extracting source for %s failed' % pn) |
| 602 | 612 | ||
| 613 | if not is_kernel_yocto and ('noexec' in (d.getVarFlags('do_patch', False) or []) or 'task' not in (d.getVarFlags('do_patch', False) or [])): | ||
| 614 | workshareddir = d.getVar('S') | ||
| 615 | if os.path.islink(srctree): | ||
| 616 | os.unlink(srctree) | ||
| 617 | |||
| 618 | os.symlink(workshareddir, srctree) | ||
| 619 | |||
| 620 | # The initial_rev file is created in devtool_post_unpack function that will not be executed if | ||
| 621 | # do_unpack/do_patch tasks are disabled so we have to directly say that source extraction was successful | ||
| 622 | return True, True | ||
| 623 | |||
| 603 | try: | 624 | try: |
| 604 | with open(os.path.join(tempdir, 'initial_rev'), 'r') as f: | 625 | with open(os.path.join(tempdir, 'initial_rev'), 'r') as f: |
| 605 | initial_rev = f.read() | 626 | initial_rev = f.read() |
| @@ -847,10 +868,11 @@ def modify(args, config, basepath, workspace): | |||
| 847 | if not initial_rev: | 868 | if not initial_rev: |
| 848 | return 1 | 869 | return 1 |
| 849 | logger.info('Source tree extracted to %s' % srctree) | 870 | logger.info('Source tree extracted to %s' % srctree) |
| 850 | # Get list of commits since this revision | 871 | if os.path.exists(os.path.join(srctree, '.git')): |
| 851 | (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree) | 872 | # Get list of commits since this revision |
| 852 | commits = stdout.split() | 873 | (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree) |
| 853 | check_commits = True | 874 | commits = stdout.split() |
| 875 | check_commits = True | ||
| 854 | else: | 876 | else: |
| 855 | if os.path.exists(os.path.join(srctree, '.git')): | 877 | if os.path.exists(os.path.join(srctree, '.git')): |
| 856 | # Check if it's a tree previously extracted by us. This is done | 878 | # Check if it's a tree previously extracted by us. This is done |
