diff options
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r-- | scripts/lib/devtool/standard.py | 43 |
1 files changed, 37 insertions, 6 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' |