<?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>5397</bug_id>
          
          <creation_ts>2013-10-28 15:36:14 +0000</creation_ts>
          <short_desc>Issue with package_rpm : can&apos;t install files named &quot;%name...&quot;</short_desc>
          <delta_ts>2015-09-03 15:30:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>Package Management Issues</product>
          <component>RPM</component>
          <version>unspecified</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>minor</bug_severity>
          <target_milestone>1.9 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sébastien MENNETRIER">s.mennetrier</reporter>
          <assigned_to name="Ross Burton - Disabled">ross</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>mburtin</cc>
    
    <cc>n3npq</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>38224</commentid>
    <comment_count>0</comment_count>
    <who name="Sébastien MENNETRIER">s.mennetrier</who>
    <bug_when>2013-10-28 15:36:14 +0000</bug_when>
    <thetext>The rpm process replace all the &quot;%name&quot; in the spec file by the name of the package. So, if the package is composed of some files or directories named &quot;%name...&quot;, the rpm package process failed.

More details :
http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085602.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38328</commentid>
    <comment_count>1</comment_count>
    <who name="Sébastien MENNETRIER">s.mennetrier</who>
    <bug_when>2013-10-31 08:34:33 +0000</bug_when>
    <thetext>I tried to create a patch to fix this issue : http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085689.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38339</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-10-31 13:42:49 +0000</bug_when>
    <thetext>The correct fix should be to replace &quot;%&quot; with &quot;%%&quot; in a name.  The later is a literal, the former indicates part of a variable will be coming next.

[%] might work, but it invokes the globbing mechanism which is not necessary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38340</commentid>
    <comment_count>3</comment_count>
    <who name="Sébastien MENNETRIER">s.mennetrier</who>
    <bug_when>2013-10-31 13:57:41 +0000</bug_when>
    <thetext>I tried to replace &quot;%&quot; with &quot;%%&quot; and with &quot;\%&quot; but it doesn&apos;t work. I also tried to replace &quot;%name&quot; by &quot;%%name&quot; and it doesn&apos;t work.

&quot;[%]&quot; is the only solution that I found that fix the issue...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39200</commentid>
    <comment_count>4</comment_count>
    <who name="Sébastien MENNETRIER">s.mennetrier</who>
    <bug_when>2013-12-03 13:53:06 +0000</bug_when>
    <thetext>Have you an other suggestion Mark to fix this issues ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39210</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-12-03 16:29:38 +0000</bug_when>
    <thetext>any filename that includes a &apos;%&apos;, should be automatically turned into &apos;%%&apos;

%%name is valid RPM syntax and should result in finding the file name literal &apos;%name&apos;.

If that isn&apos;t working, then the globbing mechanism may be the only other approach that can be used.  It should be fairly easy to add a routine that does a search/replace of &apos;%&apos; in the contents of:

            file_list = []
            walk_files(root, file_list, conffiles)
            if not file_list and localdata.getVar(&apos;ALLOW_EMPTY&apos;) != &quot;1&quot;:
                bb.note(&quot;Not creating empty RPM package for %s&quot; % splitname)
            else:
                bb.note(&quot;Creating RPM package for %s&quot; % splitname)
                spec_files_top.append(&apos;%files&apos;)
                spec_files_top.append(&apos;%defattr(-,-,-,-)&apos;)
                if file_list:
                    bb.note(&quot;Creating RPM package for %s&quot; % splitname)
                    spec_files_top.extend(file_list)
                else:
                    bb.note(&quot;Creating EMPTY RPM Package for %s&quot; % splitname)
                spec_files_top.append(&apos;&apos;)

iterate file_list, and replace with either the &apos;%%&apos; or &apos;[%]&apos; as necessary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39220</commentid>
    <comment_count>6</comment_count>
    <who name="Sébastien MENNETRIER">s.mennetrier</who>
    <bug_when>2013-12-04 09:43:04 +0000</bug_when>
    <thetext>I think that you cannot modify &apos;file_list&apos;. This list contains items that begin by &quot;%dir&quot; or by &quot;%config&quot; and these &quot;%&quot; must not be replaced.

I created a patch that escapes &quot;%&quot; in &quot;walk_files&quot; function (http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085689.html)

I use the globbing mechanism because I tried with &apos;%%&apos; and this didn&apos;t work. Maybe is an issue with rpm5 (used by yocto)... (http://rpm5.org/)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47174</commentid>
    <comment_count>7</comment_count>
    <who name="Jeff Johnson">n3npq</who>
    <bug_when>2014-11-24 22:46:20 +0000</bug_when>
    <thetext>rpm5 expands file paths twice, once while building,
another time while installing.

So %%%%name (i.e. four % characters) is needed for a literal &quot;%name&quot;

Meanwhile you almost certainly going to be happier patching
to remove the need for escaping &apos;%&apos; ... dunno if this is possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51168</commentid>
    <comment_count>8</comment_count>
    <who name="Michaël Burtin">mburtin</who>
    <bug_when>2015-05-20 14:50:13 +0000</bug_when>
    <thetext>New patch submitted, replacing &quot;%&quot; in file/dir with &quot;%%%%%%%%&quot;: http://lists.openembedded.org/pipermail/openembedded-core/2015-May/105143.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53700</commentid>
    <comment_count>9</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-09-03 15:30:37 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=311c428636ce218b8fbdb67afc166dd7e61fba82</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>