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

Diff of /eclass/eutils.eclass

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

Revision 1.1.1.1 Revision 1.215
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.1.1.1 2005/11/30 09:59:15 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.215 2005/10/27 07:28:49 vapier 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.
432 [[ ${action} == "user" ]] && opts="-u" || opts="-g" 432 [[ ${action} == "user" ]] && opts="-u" || opts="-g"
433 fi 433 fi
434 434
435 pw show ${action} ${opts} "$2" -q 435 pw show ${action} ${opts} "$2" -q
436 ;; 436 ;;
437 *-netbsd*|*-openbsd*) 437 *-netbsd*)
438 grep "$2:\*:" /etc/$1 438 grep "$2:\*:" /etc/$1
439 ;; 439 ;;
440 *) 440 *)
441 type -p nscd >& /dev/null && nscd -i "$1" 441 type -p nscd >& /dev/null && nscd -i "$1"
442 getent "$1" "$2" 442 getent "$1" "$2"
600 else 600 else
601 einfo " - Extra: $@" 601 einfo " - Extra: $@"
602 useradd ${opts} ${euser} "$@" || die "enewuser failed" 602 useradd ${opts} ${euser} "$@" || die "enewuser failed"
603 fi 603 fi
604 ;; 604 ;;
605
606 *-openbsd*)
607 if [[ -z $@ ]] ; then
608 useradd -u ${euid} -s ${eshell} \
609 -d ${ehome} -c "Added by portage for ${PN}" \
610 -g ${egroups} ${euser} || die "enewuser failed"
611 else
612 einfo " - Extra: $@"
613 useradd -u ${euid} -s ${eshell} \
614 -d ${ehome} -c "Added by portage for ${PN}" \
615 -g ${egroups} ${euser} "$@" || die "enewuser failed"
616 fi
617 ;;
618
619 *) 605 *)
620 if [[ -z $@ ]] ; then 606 if [[ -z $@ ]] ; then
621 useradd ${opts} ${euser} \ 607 useradd ${opts} ${euser} \
622 -c "added by portage for ${PN}" \ 608 -c "added by portage for ${PN}" \
623 || die "enewuser failed" 609 || die "enewuser failed"
862 type="Network;${type}" 848 type="Network;${type}"
863 ;; 849 ;;
864 850
865 sci) 851 sci)
866 case ${catmin} in 852 case ${catmin} in
867 astro*) type=Astronomy;; 853 astro*) type=Astronomoy;;
868 bio*) type=Biology;; 854 bio*) type=Biology;;
869 calc*) type=Calculator;; 855 calc*) type=Calculator;;
870 chem*) type=Chemistry;; 856 chem*) type=Chemistry;;
871 geo*) type=Geology;; 857 geo*) type=Geology;;
872 math*) type=Math;; 858 math*) type=Math;;
1098# Usage: unpack_makeself [file to unpack] [offset] [tail|dd] 1084# Usage: unpack_makeself [file to unpack] [offset] [tail|dd]
1099# - If the file is not specified then unpack will utilize ${A}. 1085# - If the file is not specified then unpack will utilize ${A}.
1100# - If the offset is not specified then we will attempt to extract 1086# - If the offset is not specified then we will attempt to extract
1101# the proper offset from the script itself. 1087# the proper offset from the script itself.
1102unpack_makeself() { 1088unpack_makeself() {
1103 local src_input=${1:-${A}}
1104 local src=$(find_unpackable_file "${src_input}") 1089 local src=$(find_unpackable_file "$1")
1105 local skip=$2 1090 local skip=$2
1106 local exe=$3 1091 local exe=$3
1107 1092
1108 [[ -z ${src} ]] && die "Could not locate source for '${src_input}'" 1093 [[ -z ${src} ]] && die "Could not locate source for '$1'"
1109 1094
1110 local shrtsrc=$(basename "${src}") 1095 local shrtsrc=$(basename "${src}")
1111 echo ">>> Unpacking ${shrtsrc} to ${PWD}" 1096 echo ">>> Unpacking ${shrtsrc} to ${PWD}"
1112 if [[ -z ${skip} ]] ; then 1097 if [[ -z ${skip} ]] ; then
1113 local ver=$(grep -a '#.*Makeself' "${src}" | awk '{print $NF}') 1098 local ver=$(grep -a '#.*Makeself' "${src}" | awk '{print $NF}')

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.215

  ViewVC Help
Powered by ViewVC 1.1.20