]> git.tdb.fi Git - builder.git/commitdiff
Only use files from the first overlay that has them
authorMikko Rasa <tdb@tdb.fi>
Fri, 10 Oct 2014 19:08:45 +0000 (22:08 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 10 Oct 2014 19:08:45 +0000 (22:08 +0300)
This allows special-casing pieces of code for some platforms without
fragmenting the directory structure too badly.

source/component.cpp

index 833a0ed20d507b665d59d9022dac7521bdce81d0..a42b81cded44229d877882c535b11c2982ecfb77 100644 (file)
@@ -99,12 +99,21 @@ Component::SourceList Component::collect_source_files() const
                                if(FS::is_dir(opath))
                                        dirs.push_back(opath);
                        }
                                if(FS::is_dir(opath))
                                        dirs.push_back(opath);
                        }
+                       set<string> overlay_files;
                        for(SourceList::const_iterator j=dirs.begin(); j!=dirs.end(); ++j)
                        {
                                package.get_builder().get_logger().log("files", format("Traversing %s", *j));
                                list<string> sfiles = list_files(*j);
                                for(list<string>::iterator k=sfiles.begin(); k!=sfiles.end(); ++k)
                        for(SourceList::const_iterator j=dirs.begin(); j!=dirs.end(); ++j)
                        {
                                package.get_builder().get_logger().log("files", format("Traversing %s", *j));
                                list<string> sfiles = list_files(*j);
                                for(list<string>::iterator k=sfiles.begin(); k!=sfiles.end(); ++k)
+                               {
+                                       if(j!=dirs.begin())
+                                       {
+                                               if(overlay_files.count(*k))
+                                                       continue;
+                                               overlay_files.insert(*k);
+                                       }
                                        files.push_back(*j / *k);
                                        files.push_back(*j / *k);
+                               }
                        }
                }
                else
                        }
                }
                else