On Tue, Sep 30, 2014 at 3:53 AM, Michael Olbrich <m.olbrich@pengutronix.de> wrote:
On Mon, Sep 29, 2014 at 08:25:38AM -0400, Jon Ringle wrote:
> On Mon, Sep 29, 2014 at 5:42 AM, Michael Olbrich <m.olbrich@pengutronix.de>
> wrote:

how about this (untested, but I thin you get the idea):

rootdir="${root_dir#/}/"

if [ "${root_dir}" != "${root_dir%/}" ]; then
        bailout: must be absolute
fi
...
local file="$(for dir in "${pkg_pkg_dir}"${root_dir:-/,/usr/}${lib_dir}; do

I was unable to get brace expansion to work properly inside of a variable substitution.
 
...

So either use ${root_dir}/lib or /lib,/usr/lib

The v3 patch I'm sending will search ${root_dir}/lib and ${root_dir}/usr/lib (where ${root_dir} could be an empty string)

Jon