<?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>11289</bug_id>
          
          <creation_ts>2017-04-04 06:37:18 +0000</creation_ts>
          <short_desc>search order for patches and files (FILESPATH)</short_desc>
          <delta_ts>2017-04-14 09:33:23 +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>core</component>
          <version>2.2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72056</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2017-04-04 06:37:18 +0000</bug_when>
    <thetext>According to this [1] the FILESPATH variable contains the default set of directories the OpenEmbedded build system uses when searching for patches and files.

I was wondering what&apos;s the search order e.g. if the same .patch is present in 2 different directories.

bitbake -e busybox | grep ^FILESPATH=

To my surprise I saw (after some cleanup this):

FILESPATH=&quot;
busybox/busybox/poky:
busybox/busybox-1.24.1/poky:
busybox/busybox/poky:
busybox/files/poky:
busybox/busybox/multi-v7-ml:
busybox/busybox-1.24.1/multi-v7-ml:
busybox/busybox/multi-v7-ml:
busybox/files/multi-v7-ml:
busybox/busybox/armv7a:
busybox/busybox-1.24.1/armv7a:
busybox/busybox/armv7a:
busybox/files/armv7a:
busybox/busybox/arm:
busybox/busybox-1.24.1/arm:
busybox/busybox/arm:
busybox/files/arm:
busybox/busybox/:
busybox/busybox-1.24.1/:
busybox/busybox/:
busybox/files/
&quot;

I assumed that the order in which the directories appear has to do with the preference, but various directories appear multiple times like busybox/busybox/poky:

busybox/busybox/poky: &lt;--
busybox/busybox-1.24.1/poky:
busybox/busybox/poky: &lt;--

What&apos;s the order of preference supposed to be if someone throws a patch with the same name in 2 different directories? 

[1] http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-FILESPATHS</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72516</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-04-14 09:33:23 +0000</bug_when>
    <thetext>I think the issue was with your cleanup. I tried this locally and got:

poky/meta-poky/recipes-core/busybox/busybox/poky
poky/meta/recipes-core/busybox/busybox-1.24.1/poky
poky/meta/recipes-core/busybox/busybox/poky
poky/meta/recipes-core/busybox/files/poky
poky/meta-poky/recipes-core/busybox/busybox/qemux86-64
poky/meta/recipes-core/busybox/busybox-1.24.1/qemux86-64
poky/meta/recipes-core/busybox/busybox/qemux86-64
poky/meta/recipes-core/busybox/files/qemux86-64
poky/meta-poky/recipes-core/busybox/busybox/qemuall
poky/meta/recipes-core/busybox/busybox-1.24.1/qemuall
poky/meta/recipes-core/busybox/busybox/qemuall
poky/meta/recipes-core/busybox/files/qemuall
poky/meta-poky/recipes-core/busybox/busybox/x86-64
poky/meta/recipes-core/busybox/busybox-1.24.1/x86-64
poky/meta/recipes-core/busybox/busybox/x86-64
poky/meta/recipes-core/busybox/files/x86-64
poky/meta-poky/recipes-core/busybox/busybox/
poky/meta/recipes-core/busybox/busybox-1.24.1/
poky/meta/recipes-core/busybox/busybox/
poky/meta/recipes-core/busybox/files/

where you can see one is in &quot;meta-poky&quot; whilst the other is in &quot;meta&quot;. Also, this variable works like PATH, the first found wins. You can therefore put the same patch in each of these directories and it will use the first one found. Even if there were duplicates, the system would still then work.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>