Skip to content

Commit 3fce9ab

Browse files
committed
Merge pull request #288 from orocos-toolchain/fix/component-path into 2.9.1
Change component loader behaviour to consider a component found on first valid path
2 parents ba63228 + 1e53d76 commit 3fce9ab

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

rtt/deployment/ComponentLoader.cpp

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -338,39 +338,6 @@ bool ComponentLoader::import( std::string const& path_list )
338338
// If the path is not complete (not absolute), look it up in the search directories:
339339
log(Debug) << "No such directory: " << p<< endlog();
340340
}
341-
#if 0
342-
// Repeat for path/OROCOS_TARGET: (already done in other import function)
343-
p = path(*it) / OROCOS_TARGET_NAME;
344-
if (is_directory(p))
345-
{
346-
log(Info) << "Importing component libraries from directory " << p.string() << " ..."<<endlog();
347-
for (directory_iterator itr(p); itr != directory_iterator(); ++itr)
348-
{
349-
log(Debug) << "Scanning file " << itr->path().string() << " ...";
350-
if (is_regular_file(itr->status()) && isLoadableLibrary(itr->path()) ) {
351-
found = true;
352-
#if BOOST_VERSION >= 104600
353-
all_good = loadInProcess( itr->path().string(), makeShortFilename(itr->path().filename().string() ), true) && all_good;
354-
#else
355-
all_good = loadInProcess( itr->path().string(), makeShortFilename(itr->path().filename() ), true) && all_good;
356-
#endif
357-
}else {
358-
if (!is_regular_file(itr->status()))
359-
log(Debug) << "not a regular file: ignored."<<endlog();
360-
else
361-
log(Debug) << "not a " + SO_EXT + " library: ignored."<<endlog();
362-
}
363-
}
364-
log(Info) << "Importing plugins and typekits from directory " << p.string() << " ..."<<endlog();
365-
try {
366-
found = PluginLoader::Instance()->loadTypekits( p.string() ) || found;
367-
found = PluginLoader::Instance()->loadPlugins( p.string() ) || found;
368-
} catch (std::exception& e) {
369-
all_good = false;
370-
log(Error) << e.what() <<endlog();
371-
}
372-
}
373-
#endif
374341
}
375342
if (!all_good)
376343
throw std::runtime_error("Some found plugins could not be loaded !");
@@ -450,7 +417,7 @@ bool ComponentLoader::importInstalledPackage(std::string const& package, std::st
450417
} // else: we allow to import a subdirectory of '.'.
451418
}
452419
// append '/package' or 'target/package' to each plugin path in order to search all of them:
453-
for(vector<string>::iterator it = vpaths.begin(); it != vpaths.end(); ++it) {
420+
for(vector<string>::iterator it = vpaths.begin(); !path_found && it != vpaths.end(); ++it) {
454421
p = *it;
455422
p = p / package;
456423
// we only search in existing directories:

0 commit comments

Comments
 (0)