New RPATH logic (ready for review)



<!---
@huboard:{"order":669.5,"custom_state":""}
-->

Should this function be removed?