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

Diff of /eclass/eutils.eclass

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

Revision 1.202 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.202 2005/09/26 21:54:56 vapier 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}

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

  ViewVC Help
Powered by ViewVC 1.1.20