From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-oi0-f50.google.com ([209.85.218.50]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XZCBK-0003Zg-VZ for ptxdist@pengutronix.de; Wed, 01 Oct 2014 07:10:31 +0200 Received: by mail-oi0-f50.google.com with SMTP id i138so54389oig.23 for ; Tue, 30 Sep 2014 22:09:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140930075325.GC24288@pengutronix.de> References: <1411768011-9200-1-git-send-email-jon@ringle.org> <20140929094228.GC15758@pengutronix.de> <20140930075325.GC24288@pengutronix.de> Date: Wed, 1 Oct 2014 01:09:39 -0400 Message-ID: From: Jon Ringle Subject: Re: [ptxdist] [PATCH] install_dir: Allow one to specify an alternate root dir Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0402867564==" Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: "ptxdist@pengutronix.de" --===============0402867564== Content-Type: multipart/alternative; boundary=089e013a0dd4cd819505045581e8 --089e013a0dd4cd819505045581e8 Content-Type: text/plain; charset=UTF-8 On Tue, Sep 30, 2014 at 3:53 AM, Michael Olbrich 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 --089e013a0dd4cd819505045581e8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= ue, Sep 30, 2014 at 3:53 AM, Michael Olbrich <m.olbrich@pengutroni= x.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=3D"${root_dir#/}/"

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

I was unable to get b= race expansion to work properly inside of a variable substitution.
=C2=A0
...

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

--089e013a0dd4cd819505045581e8-- --===============0402867564== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ptxdist mailing list ptxdist@pengutronix.de --===============0402867564==--