[Bug 1019] New: Precedence of ROS packages over regular files when using the import function

http://bugs.orocos.org/show_bug.cgi?id=1019

Summary: Precedence of ROS packages over regular files when
using the import function
Product: Toolchain
Version: master
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P3
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: meyer [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Created attachment 851
--> http://bugs.orocos.org/attachment.cgi?id=851
swapping the different checks in RTT::ComponentLoader::import()

I would like to propose the attached patch for the RTT::ComponentLoader class
which solves the following problem when using the import(package) operation in
the deployer: If there is a file in the current working directory with the same
name as the package I would like to import, the old behaviour was to load that
file directly and abort with an error without trying the other variants (ROS
package or installed package).

A simple example: I have a ROS package named "foo" with some dependencies
defined in its manifest.xml file and a script bin/foo which launches the
executable bin/foo-gnulinux with a proper environment and a couple of command
line options. In the deployer script I call import("foo") to load component
libraries in package foo and all dependent packages. Without the patch, the
method call fails with an error message saying that "foo" is not a valid
component library.

In theory, the is_regular_file check in ComponentLoader.cpp should be moved
after the importInstalledPackage() call to also be able to import installed
packages named "foo" in the example case, but importInstalledPackage() does not
fail silently, causing ugly error message if you really want to import regular
files.

By the way, which is the correct git branch to work on for 2.6? master or
toolchain-2.6?

[Bug 1019] Precedence of ROS packages over regular files when us

http://bugs.orocos.org/show_bug.cgi?id=1019

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED

[Bug 1019] Precedence of ROS packages over regular files when us

[Bug 1019] Precedence of ROS packages over regular files when us

[Bug 1019] Precedence of ROS packages over regular files when us

http://bugs.orocos.org/show_bug.cgi?id=1019

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |peter [..] ...