From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XYXTQ-0007m7-MG for ptxdist@pengutronix.de; Mon, 29 Sep 2014 11:42:28 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1XYXTQ-0001Gb-KH for ptxdist@pengutronix.de; Mon, 29 Sep 2014 11:42:28 +0200 Date: Mon, 29 Sep 2014 11:42:28 +0200 From: Michael Olbrich Message-ID: <20140929094228.GC15758@pengutronix.de> References: <1411768011-9200-1-git-send-email-jon@ringle.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1411768011-9200-1-git-send-email-jon@ringle.org> 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de 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. 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 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. Michael > find "${dir}" -type f -path "${dir}/${lib}.so*"; done 2>/dev/null)" > > if [ ! -f "${file}" ]; then > -- > 1.8.5.4 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de