<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9972</bug_id>
          
          <creation_ts>2016-07-19 09:22:06 +0000</creation_ts>
          <short_desc>recipetool: setvar fails on empty bbappend file</short_desc>
          <delta_ts>2016-07-26 10:11:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>2.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>64148</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-07-19 09:22:06 +0000</bug_when>
    <thetext>If you use recipetool setvar on an empty bbappend file you get a traceback:

--------- snip ---------
$ recipetool newappend ../meta-poky kbd
../meta-poky/recipes-core/kbd/kbd_2.0.3.bbappend
$ recipetool setvar -r ../meta-poky/recipes-core/kbd/kbd_2.0.3.bbappend SOMEVAR &quot;value&quot;

Traceback (most recent call last):
  File &quot;/home/paul/poky/poky/scripts/recipetool&quot;, line 117, in &lt;module&gt;
    ret = main()
  File &quot;/home/paul/poky/poky/scripts/recipetool&quot;, line 108, in main
    ret = args.func(args)
  File &quot;/home/paul/poky/poky/scripts/lib/recipetool/setvar.py&quot;, line 52, in setvar
    patches = [oe.recipeutils.patch_recipe_file(args.recipefile, varvalues, patch=args.patch)]
  File &quot;/home/paul/poky/poky/meta/lib/oe/recipeutils.py&quot;, line 279, in patch_recipe_file
    _, tolines = patch_recipe_lines(fromlines, values)
  File &quot;/home/paul/poky/poky/meta/lib/oe/recipeutils.py&quot;, line 261, in patch_recipe_lines
    if tolines[-1].strip() != &apos;&apos;:
IndexError: list index out of range
--------- snip ---------

If the file has one or more lines no error is produced.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64472</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-07-26 10:11:51 +0000</bug_when>
    <thetext>Fix merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=25507bfa82fc3bc46624952f15278b491a85ad7d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>