From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XYa1Q-0001io-Ux for ptxdist@pengutronix.de; Mon, 29 Sep 2014 14:25:45 +0200 Received: by mail-lb0-f177.google.com with SMTP id w7so1010908lbi.22 for ; Mon, 29 Sep 2014 05:25:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140929094228.GC15758@pengutronix.de> References: <1411768011-9200-1-git-send-email-jon@ringle.org> <20140929094228.GC15758@pengutronix.de> Date: Mon, 29 Sep 2014 08:25:38 -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="===============1828912837==" Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: "ptxdist@pengutronix.de" --===============1828912837== Content-Type: multipart/alternative; boundary=047d7b3441fe4e3d010504335dc5 --047d7b3441fe4e3d010504335dc5 Content-Type: text/plain; charset=UTF-8 On Mon, Sep 29, 2014 at 5:42 AM, Michael Olbrich wrote: > On Fri, Sep 26, 2014 at 05:46:51PM -0400, jon@ringle.org wrote: > > From: Jon Ringle > > > > This is useful if you install a package to /opt and libs are in /opt/lib: > > $(call install_lib, foo, 0, 0, 0644, libfoo, opt/) > > Is '/opt' your actual use-case or just an example? I wouldn't mind adding > /opt to the default list. > It is just an example. My actual use-case looks like this: @$(foreach lib, $(GPEC_LIBS), \ $(call install_lib, gpec, 0, 0, 0644, $(lib), opt/gpec/live/);) where the list of libs in $(GPEC_LIBS) is installed to /opt/gpec/live/lib/ > If not: > > > Signed-off-by: Jon Ringle > > --- > > rules/post/install.make | 4 +++- > > scripts/lib/ptxd_make_xpkg_pkg.sh | 4 +++- > > 2 files changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/rules/post/install.make b/rules/post/install.make > > index d57e5dd..2ff9f40 100644 > [...] > > diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh > b/scripts/lib/ptxd_make_xpkg_pkg.sh > > index 86196a2..501d1fd 100644 > > --- a/scripts/lib/ptxd_make_xpkg_pkg.sh > > +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh > > @@ -744,9 +744,11 @@ export -f ptxd_install_shared > > ptxd_install_lib() { > > local lib_dir=$(ptxd_get_lib_dir) > > local lib="$1" > > + local root_dir="$2" > > + shift > > shift > > local root_dir="${2%/}/" > shift 2 > > > > > - local file="$(for dir in "${pkg_pkg_dir}/"{,usr/}${lib_dir}; do > > + local file="$(for dir in > "${pkg_pkg_dir}/"${root_dir}{,usr/}${lib_dir}; do > > local file="$(for dir in > "${pkg_pkg_dir}/"${root_dir#/}{,usr/}${lib_dir}; do > With this, is seems that the trailing / after ${pkg_pkg_dir} could be removed... > > So the argument for install_lib can be absolute, and the trailing / is > optional. Maybe even enforce an absolute path for root_dir. > And use root_dir instead of '{,usr/}' and not before it. > If the '{,/usr}' is removed, then won't that break searching for libs that might be in /usr/lib/ ? --047d7b3441fe4e3d010504335dc5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On M= on, Sep 29, 2014 at 5:42 AM, Michael Olbrich <m.olbrich@pengutroni= x.de> wrote:
On Fri, Sep= 26, 2014 at 05:46:51PM -0400, jon@ringle= .org wrote:
> From: Jon Ringle <jringle@= gridpoint.com>
>
> This is useful if you install a package to /opt and libs are in /opt/l= ib:
>=C2=A0 =C2=A0 =C2=A0$(call install_lib, foo, 0, 0, 0644, libfoo, opt/)<= br>
Is '/opt' your actual use-case or just an example? I wouldn&= #39;t mind adding
/opt to the default list.

It is just an= example. My actual use-case looks like this:

@$(foreach lib, $(GPEC_= LIBS), \
$(ca= ll install_lib, gpec, 0, 0, 0644, $(lib), opt/gpec/live/);)

where the list of libs in $(GPEC_LIBS) is installed to /opt= /gpec/live/lib/


If not:

> Signed-off-by: Jon Ringle <jringle@gridpoint.com>
> ---
>=C2=A0 rules/post/install.make=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= | 4 +++-
>=C2=A0 scripts/lib/ptxd_make_xpkg_pkg.sh | 4 +++-
>=C2=A0 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/rules/post/install.make b/rules/post/install.make
> index d57e5dd..2ff9f40 100644
[...]
> diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scri= pts/lib/ptxd_make_xpkg_pkg.sh
> index 86196a2..501d1fd 100644
> --- a/scripts/lib/ptxd_make_xpkg_pkg.sh
> +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
> @@ -744,9 +744,11 @@ export -f ptxd_install_shared
>=C2=A0 ptxd_install_lib() {
>=C2=A0 =C2=A0 =C2=A0 local lib_dir=3D$(ptxd_get_lib_dir)
>=C2=A0 =C2=A0 =C2=A0 local lib=3D"$1"
> +=C2=A0 =C2=A0 local root_dir=3D"$2"
> +=C2=A0 =C2=A0 shift
>=C2=A0 =C2=A0 =C2=A0 shift

=C2=A0 =C2=A0 local root_dir=3D"${2%/}/"
=C2=A0 =C2=A0 shift 2

>
> -=C2=A0 =C2=A0 local file=3D"$(for dir in "${pkg_pkg_dir}/&q= uot;{,usr/}${lib_dir}; do
> +=C2=A0 =C2=A0 local file=3D"$(for dir in "${pkg_pkg_dir}/&q= uot;${root_dir}{,usr/}${lib_dir}; do

=C2=A0 =C2=A0 local file=3D"$(for dir in "${pkg_pkg_dir}/&= quot;${root_dir#/}{,usr/}${lib_dir}; do

With this, is seems that the trailing / after ${pkg_pkg_dir} could be remo= ved...
=C2=A0

So the argument for install_lib can be absolute, and the trailing / is
optional. Maybe even enforce an absolute path for root_dir.
And use root_dir instead of '{,usr/}' and not before it.

If the '{,/usr}' is removed, then won'= ;t that break searching for libs that might be in /usr/lib/ ?
=C2= =A0
--047d7b3441fe4e3d010504335dc5-- --===============1828912837== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ptxdist mailing list ptxdist@pengutronix.de --===============1828912837==--