<div dir="ltr">On 30 August 2015 at 19:08, Ed Bartosh &lt;<a href="mailto:ed.bartosh@linux.intel.com">ed.bartosh@linux.intel.com</a>&gt; wrote:<br>&gt;<br>&gt; Moved standard.py:_parse_recipe -&gt; __init__.py:parse_recipe and<br>&gt;       standard.py:_get_recipe_file -&gt;  __init__.py:get_recipe_file<br>&gt; to be able to call them from other modules.<br><br>Hi Ed,<br><br>Can you take a look if the failures in <a href="https://autobuilder.yoctoproject.org/main/builders/nightly-oe-selftest/builds/173/steps/Running%20oe-selftest/logs/stdio">https://autobuilder.yoctoproject.org/main/builders/nightly-oe-selftest/builds/173/steps/Running%20oe-selftest/logs/stdio</a> are related to this patch (there&#39;s lots of &quot;NameError: global name &#39;_parse_recipe&#39; is not defined&quot;)<br><br>Jussi<br> <br>&gt;<br>&gt; Signed-off-by: Ed Bartosh &lt;<a href="mailto:ed.bartosh@linux.intel.com">ed.bartosh@linux.intel.com</a>&gt;<br>&gt; ---<br>&gt;  scripts/lib/devtool/__init__.py | 27 +++++++++++++++++++++++++++<br>&gt;  scripts/lib/devtool/standard.py | 36 ++++--------------------------------<br>&gt;  2 files changed, 31 insertions(+), 32 deletions(-)<br>&gt;<br>&gt; diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py<br>&gt; index 1747fff..97ac6ae 100644<br>&gt; --- a/scripts/lib/devtool/__init__.py<br>&gt; +++ b/scripts/lib/devtool/__init__.py<br>&gt; @@ -116,3 +116,30 @@ def add_md5(config, recipename, filename):<br>&gt;      md5 = bb.utils.md5_file(filename)<br>&gt;      with open(os.path.join(config.workspace_path, &#39;.devtool_md5&#39;), &#39;a&#39;) as f:<br>&gt;          f.write(&#39;%s|%s|%s\n&#39; % (recipename, os.path.relpath(filename, config.workspace_path), md5))<br>&gt; +<br>&gt; +def get_recipe_file(cooker, pn):<br>&gt; +    &quot;&quot;&quot;Find recipe file corresponding a package name&quot;&quot;&quot;<br>&gt; +    import oe.recipeutils<br>&gt; +    recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)<br>&gt; +    if not recipefile:<br>&gt; +        skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)<br>&gt; +        if skipreasons:<br>&gt; +            logger.error(&#39;\n&#39;.join(skipreasons))<br>&gt; +        else:<br>&gt; +            logger.error(&quot;Unable to find any recipe file matching %s&quot; % pn)<br>&gt; +    return recipefile<br>&gt; +<br>&gt; +def parse_recipe(config, tinfoil, pn, appends):<br>&gt; +    &quot;&quot;&quot;Parse recipe of a package&quot;&quot;&quot;<br>&gt; +    import oe.recipeutils<br>&gt; +    recipefile = get_recipe_file(tinfoil.cooker, pn)<br>&gt; +    if not recipefile:<br>&gt; +        # Error already logged<br>&gt; +        return None<br>&gt; +    if appends:<br>&gt; +        append_files = tinfoil.cooker.collection.get_file_appends(recipefile)<br>&gt; +        # Filter out appends from the workspace<br>&gt; +        append_files = [path for path in append_files if<br>&gt; +                        not path.startswith(config.workspace_path)]<br>&gt; +    return oe.recipeutils.parse_recipe(recipefile, append_files,<br>&gt; +                                       tinfoil.config_data)<br>&gt; diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py<br>&gt; index 4aa6ebd..97c45d9 100644<br>&gt; --- a/scripts/lib/devtool/standard.py<br>&gt; +++ b/scripts/lib/devtool/standard.py<br>&gt; @@ -26,7 +26,7 @@ import argparse<br>&gt;  import scriptutils<br>&gt;  import errno<br>&gt;  from devtool import exec_build_env_command, setup_tinfoil, DevtoolError<br>&gt; -from devtool import add_md5<br>&gt; +from devtool import add_md5, parse_recipe<br>&gt;<br>&gt;  logger = logging.getLogger(&#39;devtool&#39;)<br>&gt;<br>&gt; @@ -157,34 +157,6 @@ def _check_compatible_recipe(pn, d):<br>&gt;                             &quot;from working. You will need to disable this &quot;<br>&gt;                             &quot;first.&quot; % pn)<br>&gt;<br>&gt; -def _get_recipe_file(cooker, pn):<br>&gt; -    &quot;&quot;&quot;Find recipe file corresponding a package name&quot;&quot;&quot;<br>&gt; -    import oe.recipeutils<br>&gt; -    recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)<br>&gt; -    if not recipefile:<br>&gt; -        skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)<br>&gt; -        if skipreasons:<br>&gt; -            logger.error(&#39;\n&#39;.join(skipreasons))<br>&gt; -        else:<br>&gt; -            logger.error(&quot;Unable to find any recipe file matching %s&quot; % pn)<br>&gt; -    return recipefile<br>&gt; -<br>&gt; -def _parse_recipe(config, tinfoil, pn, appends):<br>&gt; -    &quot;&quot;&quot;Parse recipe of a package&quot;&quot;&quot;<br>&gt; -    import oe.recipeutils<br>&gt; -    recipefile = _get_recipe_file(tinfoil.cooker, pn)<br>&gt; -    if not recipefile:<br>&gt; -        # Error already logged<br>&gt; -        return None<br>&gt; -    if appends:<br>&gt; -        append_files = tinfoil.cooker.collection.get_file_appends(recipefile)<br>&gt; -        # Filter out appends from the workspace<br>&gt; -        append_files = [path for path in append_files if<br>&gt; -                        not path.startswith(config.workspace_path)]<br>&gt; -    return oe.recipeutils.parse_recipe(recipefile, append_files,<br>&gt; -                                       tinfoil.config_data)<br>&gt; -<br>&gt; -<br>&gt;  def _ls_tree(directory):<br>&gt;      &quot;&quot;&quot;Recursive listing of files in a directory&quot;&quot;&quot;<br>&gt;      ret = []<br>&gt; @@ -200,7 +172,7 @@ def extract(args, config, basepath, workspace):<br>&gt;<br>&gt;      tinfoil = setup_tinfoil()<br>&gt;<br>&gt; -    rd = _parse_recipe(config, tinfoil, args.recipename, True)<br>&gt; +    rd = parse_recipe(config, tinfoil, args.recipename, True)<br>&gt;      if not rd:<br>&gt;          return 1<br>&gt;<br>&gt; @@ -420,7 +392,7 @@ def modify(args, config, basepath, workspace):<br>&gt;<br>&gt;      tinfoil = setup_tinfoil()<br>&gt;<br>&gt; -    rd = _parse_recipe(config, tinfoil, args.recipename, True)<br>&gt; +    rd = parse_recipe(config, tinfoil, args.recipename, True)<br>&gt;      if not rd:<br>&gt;          return 1<br>&gt;      recipefile = rd.getVar(&#39;FILE&#39;, True)<br>&gt; @@ -762,7 +734,7 @@ def update_recipe(args, config, basepath, workspace):<br>&gt;<br>&gt;      tinfoil = setup_tinfoil()<br>&gt;<br>&gt; -    rd = _parse_recipe(config, tinfoil, args.recipename, True)<br>&gt; +    rd = parse_recipe(config, tinfoil, args.recipename, True)<br>&gt;      if not rd:<br>&gt;          return 1<br>&gt;<br>&gt; --<br>&gt; 2.1.4<br>&gt;<br>&gt; --<br>&gt; _______________________________________________<br>&gt; Openembedded-core mailing list<br>&gt; <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>&gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a></div>