diff options
Diffstat (limited to 'scripts/lib/devtool')
| -rw-r--r-- | scripts/lib/devtool/standard.py | 43 | ||||
| -rw-r--r-- | scripts/lib/devtool/upgrade.py | 4 |
2 files changed, 39 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 261d642d4a..f364a45283 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -474,7 +474,11 @@ def symlink_oelocal_files_srctree(rd,srctree): | |||
| 474 | destpth = os.path.join(srctree, relpth, fn) | 474 | destpth = os.path.join(srctree, relpth, fn) |
| 475 | if os.path.exists(destpth): | 475 | if os.path.exists(destpth): |
| 476 | os.unlink(destpth) | 476 | os.unlink(destpth) |
| 477 | os.symlink('oe-local-files/%s' % fn, destpth) | 477 | if relpth != '.': |
| 478 | back_relpth = os.path.relpath(local_files_dir, root) | ||
| 479 | os.symlink('%s/oe-local-files/%s/%s' % (back_relpth, relpth, fn), destpth) | ||
| 480 | else: | ||
| 481 | os.symlink('oe-local-files/%s' % fn, destpth) | ||
| 478 | addfiles.append(os.path.join(relpth, fn)) | 482 | addfiles.append(os.path.join(relpth, fn)) |
| 479 | if addfiles: | 483 | if addfiles: |
| 480 | bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree) | 484 | bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree) |
| @@ -589,6 +593,16 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works | |||
| 589 | else: | 593 | else: |
| 590 | task = 'do_patch' | 594 | task = 'do_patch' |
| 591 | 595 | ||
| 596 | if 'noexec' in (d.getVarFlags(task, False) or []) or 'task' not in (d.getVarFlags(task, False) or []): | ||
| 597 | logger.info('The %s recipe has %s disabled. Running only ' | ||
| 598 | 'do_configure task dependencies' % (pn, task)) | ||
| 599 | |||
| 600 | if 'depends' in d.getVarFlags('do_configure', False): | ||
| 601 | pn = d.getVarFlags('do_configure', False)['depends'] | ||
| 602 | pn = pn.replace('${PV}', d.getVar('PV')) | ||
| 603 | pn = pn.replace('${COMPILERDEP}', d.getVar('COMPILERDEP')) | ||
| 604 | task = None | ||
| 605 | |||
| 592 | # Run the fetch + unpack tasks | 606 | # Run the fetch + unpack tasks |
| 593 | res = tinfoil.build_targets(pn, | 607 | res = tinfoil.build_targets(pn, |
| 594 | task, | 608 | task, |
| @@ -600,6 +614,17 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works | |||
| 600 | if not res: | 614 | if not res: |
| 601 | raise DevtoolError('Extracting source for %s failed' % pn) | 615 | raise DevtoolError('Extracting source for %s failed' % pn) |
| 602 | 616 | ||
| 617 | if not is_kernel_yocto and ('noexec' in (d.getVarFlags('do_patch', False) or []) or 'task' not in (d.getVarFlags('do_patch', False) or [])): | ||
| 618 | workshareddir = d.getVar('S') | ||
| 619 | if os.path.islink(srctree): | ||
| 620 | os.unlink(srctree) | ||
| 621 | |||
| 622 | os.symlink(workshareddir, srctree) | ||
| 623 | |||
| 624 | # The initial_rev file is created in devtool_post_unpack function that will not be executed if | ||
| 625 | # do_unpack/do_patch tasks are disabled so we have to directly say that source extraction was successful | ||
| 626 | return True, True | ||
| 627 | |||
| 603 | try: | 628 | try: |
| 604 | with open(os.path.join(tempdir, 'initial_rev'), 'r') as f: | 629 | with open(os.path.join(tempdir, 'initial_rev'), 'r') as f: |
| 605 | initial_rev = f.read() | 630 | initial_rev = f.read() |
| @@ -847,10 +872,11 @@ def modify(args, config, basepath, workspace): | |||
| 847 | if not initial_rev: | 872 | if not initial_rev: |
| 848 | return 1 | 873 | return 1 |
| 849 | logger.info('Source tree extracted to %s' % srctree) | 874 | logger.info('Source tree extracted to %s' % srctree) |
| 850 | # Get list of commits since this revision | 875 | if os.path.exists(os.path.join(srctree, '.git')): |
| 851 | (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree) | 876 | # Get list of commits since this revision |
| 852 | commits = stdout.split() | 877 | (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree) |
| 853 | check_commits = True | 878 | commits = stdout.split() |
| 879 | check_commits = True | ||
| 854 | else: | 880 | else: |
| 855 | if os.path.exists(os.path.join(srctree, '.git')): | 881 | if os.path.exists(os.path.join(srctree, '.git')): |
| 856 | # Check if it's a tree previously extracted by us. This is done | 882 | # Check if it's a tree previously extracted by us. This is done |
| @@ -927,12 +953,17 @@ def modify(args, config, basepath, workspace): | |||
| 927 | 953 | ||
| 928 | if bb.data.inherits_class('kernel', rd): | 954 | if bb.data.inherits_class('kernel', rd): |
| 929 | f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout ' | 955 | f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout ' |
| 930 | 'do_fetch do_unpack do_kernel_configme do_kernel_configcheck"\n') | 956 | 'do_fetch do_unpack do_kernel_configcheck"\n') |
| 931 | f.write('\ndo_patch[noexec] = "1"\n') | 957 | f.write('\ndo_patch[noexec] = "1"\n') |
| 932 | f.write('\ndo_configure_append() {\n' | 958 | f.write('\ndo_configure_append() {\n' |
| 933 | ' cp ${B}/.config ${S}/.config.baseline\n' | 959 | ' cp ${B}/.config ${S}/.config.baseline\n' |
| 934 | ' ln -sfT ${B}/.config ${S}/.config.new\n' | 960 | ' ln -sfT ${B}/.config ${S}/.config.new\n' |
| 935 | '}\n') | 961 | '}\n') |
| 962 | f.write('\ndo_kernel_configme_prepend() {\n' | ||
| 963 | ' if [ -e ${S}/.config ]; then\n' | ||
| 964 | ' mv ${S}/.config ${S}/.config.old\n' | ||
| 965 | ' fi\n' | ||
| 966 | '}\n') | ||
| 936 | if rd.getVarFlag('do_menuconfig','task'): | 967 | if rd.getVarFlag('do_menuconfig','task'): |
| 937 | f.write('\ndo_configure_append() {\n' | 968 | f.write('\ndo_configure_append() {\n' |
| 938 | ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' | 969 | ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' |
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 0c1de8cdc7..5a057e95f5 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py | |||
| @@ -178,7 +178,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee | |||
| 178 | uri, rev = _get_uri(crd) | 178 | uri, rev = _get_uri(crd) |
| 179 | if srcrev: | 179 | if srcrev: |
| 180 | rev = srcrev | 180 | rev = srcrev |
| 181 | if uri.startswith('git://'): | 181 | if uri.startswith('git://') or uri.startswith('gitsm://'): |
| 182 | __run('git fetch') | 182 | __run('git fetch') |
| 183 | __run('git checkout %s' % rev) | 183 | __run('git checkout %s' % rev) |
| 184 | __run('git tag -f devtool-base-new') | 184 | __run('git tag -f devtool-base-new') |
| @@ -270,7 +270,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee | |||
| 270 | else: | 270 | else: |
| 271 | logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout)) | 271 | logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout)) |
| 272 | if not skiptag: | 272 | if not skiptag: |
| 273 | if uri.startswith('git://'): | 273 | if uri.startswith('git://') or uri.startswith('gitsm://'): |
| 274 | suffix = 'new' | 274 | suffix = 'new' |
| 275 | else: | 275 | else: |
| 276 | suffix = newpv | 276 | suffix = newpv |
