diff options
author | 2005-03-22 17:33:13 +0000 | |
---|---|---|
committer | 2005-03-22 17:33:13 +0000 | |
commit | d44800e0835cff98ffc78aa909cba2b473d9445a (patch) | |
tree | c8f7e741cd902c2450018c70ca55819adcf49eff /eclass | |
parent | Mark stable on ia64 to match version of fsck included in FC3. This is (diff) | |
download | gentoo-2-d44800e0835cff98ffc78aa909cba2b473d9445a.tar.gz gentoo-2-d44800e0835cff98ffc78aa909cba2b473d9445a.tar.bz2 gentoo-2-d44800e0835cff98ffc78aa909cba2b473d9445a.zip |
Added make_wrapper function.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 10efc8ce7c48..b959187d2d30 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.159 2005/03/18 22:50:26 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.160 2005/03/22 17:33:13 wolf31o2 Exp $ # # Author: Martin Schlemmer <azarah@gentoo.org> # @@ -1757,3 +1757,24 @@ newpamd() { insopts -m 0644 -o root -g root newins "$1" "$2" || die "failed to install $1 as $2" } + +# make a wrapper script ... +# NOTE: this was originally games_make_wrapper, but I noticed other places where +# this could be used, so I have moved it here and made it not games-specific +# -- wolf31o2 +# $1 == wrapper name +# $2 == binary to run +# $3 == directory to chdir before running binary +# $4 == extra LD_LIBRARY_PATH's (make it : delimited) +make_wrapper() { + local wrapper=$1 bin=$2 chdir=$3 libdir=$4 + local tmpwrapper=$(emktemp) + cat << EOF > "${tmpwrapper}" +#!/bin/sh +cd "${chdir}" +export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}" +exec ${bin} "\$@" +EOF + chmod go+rx "${tmpwrapper}" + newbin "${tmpwrapper}" "${wrapper}" +} |