Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] devtool: Avoid failure for recipes with S == WORKDIR and no local files
@ 2019-08-29 20:43 Peter Kjellerstedt
  2019-09-02 10:20 ` Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2019-08-29 20:43 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core

When extracting the sources for a recipe that has S == WORKDIR and no
local files in the SRC_URI (which, e.g., can happen for a recipe with
a URI that has the unpack=false attribute), the extraction fails with
the following backtrace:

  Traceback (most recent call last):
    File ".../scripts/devtool", line 344, in <module>
      ret = main()
    File ".../scripts/devtool", line 331, in main
      ret = args.func(args, config, basepath, workspace)
    File ".../poky/scripts/lib/devtool/standard.py", line 762, in
    modify
      initial_rev, _ = _extract_source(srctree, args.keep_temp,
      args.branch, False, config, basepath, workspace,
      args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides)
    File ".../poky/scripts/lib/devtool/standard.py", line 647, in
    _extract_source
      bb.process.run('git %s commit -a -m "Committing local file
      symlinks\n\n%s"' % (' '.join(useroptions),
      oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
    File ".../poky/bitbake/lib/bb/process.py", line 178, in run
      raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
  bb.process.ExecutionError: Execution of 'git commit -a -m
  "Committing local file symlinks

  %% ignore"' failed with exit code 1:
  On branch devtool
  nothing to commit, working tree clean

This is because no files were found in the oe-local-files directory
and consequently no symbolic links were added using `git add`, but the
`git commit` command was still executed.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 scripts/lib/devtool/standard.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 96af488798..9eeaefb79c 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -482,9 +482,9 @@ def symlink_oelocal_files_srctree(rd,srctree):
                 addfiles.append(os.path.join(relpth, fn))
         if addfiles:
             bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
-        useroptions = []
-        oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd)
-        bb.process.run('git %s commit -a -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
+            useroptions = []
+            oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd)
+            bb.process.run('git %s commit -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
 
 
 def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, workspace, fixed_setup, d, tinfoil, no_overrides=False):
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] devtool: Avoid failure for recipes with S == WORKDIR and no local files
  2019-08-29 20:43 [PATCH] devtool: Avoid failure for recipes with S == WORKDIR and no local files Peter Kjellerstedt
@ 2019-09-02 10:20 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2019-09-02 10:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: Peter Kjellerstedt

On Friday, 30 August 2019 8:43:02 AM NZST Peter Kjellerstedt wrote:
> When extracting the sources for a recipe that has S == WORKDIR and no
> local files in the SRC_URI (which, e.g., can happen for a recipe with
> a URI that has the unpack=false attribute), the extraction fails with
> the following backtrace:
> 
>   Traceback (most recent call last):
>     File ".../scripts/devtool", line 344, in <module>
>       ret = main()
>     File ".../scripts/devtool", line 331, in main
>       ret = args.func(args, config, basepath, workspace)
>     File ".../poky/scripts/lib/devtool/standard.py", line 762, in
>     modify
>       initial_rev, _ = _extract_source(srctree, args.keep_temp,
>       args.branch, False, config, basepath, workspace,
>       args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides)
>     File ".../poky/scripts/lib/devtool/standard.py", line 647, in
>     _extract_source
>       bb.process.run('git %s commit -a -m "Committing local file
>       symlinks\n\n%s"' % (' '.join(useroptions),
>       oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
>     File ".../poky/bitbake/lib/bb/process.py", line 178, in run
>       raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
>   bb.process.ExecutionError: Execution of 'git commit -a -m
>   "Committing local file symlinks
> 
>   %% ignore"' failed with exit code 1:
>   On branch devtool
>   nothing to commit, working tree clean
> 
> This is because no files were found in the oe-local-files directory
> and consequently no symbolic links were added using `git add`, but the
> `git commit` command was still executed.

Looks good to me - all oe-selftest tests pass as well. (Looks like maybe we 
are missing a test though, since this code has been in place for a while.)

Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>


-- 

Paul Eggleton
Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-02 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-29 20:43 [PATCH] devtool: Avoid failure for recipes with S == WORKDIR and no local files Peter Kjellerstedt
2019-09-02 10:20 ` Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox