/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.200 Revision 1.203
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.200 2005/09/23 20:44:26 wolf31o2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.203 2005/09/27 12:38:56 ka0ttic Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
418 *) # Numeric 418 *) # Numeric
419 nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }" 419 nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }"
420 ;; 420 ;;
421 esac 421 esac
422 elif [[ "${USERLAND}" == "BSD" ]] ; then 422 elif [[ "${USERLAND}" == "BSD" ]] ; then
423 local action 423 local opts action="user"
424 if [ "$1" == "passwd" ] 424 [[ $1 == "passwd" ]] || action="group"
425 then 425
426 action="user" 426 # lookup by uid/gid
427 else 427 if [[ $2 == [[:digit:]]* ]] ; then
428 action="group" 428 [[ ${action} == "user" ]] && opts="-u" || opts="-g"
429 fi 429 fi
430
430 pw show "${action}" "$2" -q 431 pw show ${action} ${opts} "$2" -q
431 else 432 else
432 which nscd >& /dev/null && nscd -i "$1" 433 which nscd >& /dev/null && nscd -i "$1"
433 getent "$1" "$2" 434 getent "$1" "$2"
434 fi 435 fi
435} 436}
1582# $4 == extra LD_LIBRARY_PATH's (make it : delimited) 1583# $4 == extra LD_LIBRARY_PATH's (make it : delimited)
1583# $5 == path for wrapper 1584# $5 == path for wrapper
1584make_wrapper() { 1585make_wrapper() {
1585 local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 1586 local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
1586 local tmpwrapper=$(emktemp) 1587 local tmpwrapper=$(emktemp)
1588 # We don't want to quote ${bin} so that people can pass complex
1589 # things as $bin ... "./someprog --args"
1587 cat << EOF > "${tmpwrapper}" 1590 cat << EOF > "${tmpwrapper}"
1588#!/bin/sh 1591#!/bin/sh
1589cd "${chdir}" 1592cd "${chdir:-.}"
1593if [ "\${LD_LIBRARY_PATH+set}" = "set" ] && [ -n "${libdir}" ] ; then
1590export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}" 1594 export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}"
1595fi
1591exec ${bin} "\$@" 1596exec ${bin} "\$@"
1592EOF 1597EOF
1593 chmod go+rx "${tmpwrapper}" 1598 chmod go+rx "${tmpwrapper}"
1594 if [ -n "${5}" ] 1599 if [[ -n ${path} ]] ; then
1595 then
1596 exeinto ${5} 1600 exeinto "${path}"
1597 newexe "${tmpwrapper}" "${wrapper}" 1601 newexe "${tmpwrapper}" "${wrapper}"
1598 else 1602 else
1599 newbin "${tmpwrapper}" "${wrapper}" 1603 newbin "${tmpwrapper}" "${wrapper}"
1600 fi 1604 fi
1601} 1605}

Legend:
Removed from v.1.200  
changed lines
  Added in v.1.203

  ViewVC Help
Powered by ViewVC 1.1.20