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

Diff of /eclass/eutils.eclass

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

Revision 1.228 Revision 1.234
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.228 2006/03/10 23:24:21 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.234 2006/04/25 15:47:30 wolf31o2 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.
10# NB: If you add anything, please comment it! 10# NB: If you add anything, please comment it!
11 11
12inherit multilib portability 12inherit multilib portability
13 13
14DEPEND="!bootstrap? ( sys-devel/patch )" 14DEPEND="!bootstrap? ( sys-devel/patch )"
15RDEPEND=""
15# sys-apps/shadow is needed for useradd, etc, bug #94745. 16# sys-apps/shadow is needed for useradd, etc, bug #94745.
16 17
17DESCRIPTION="Based on the ${ECLASS} eclass" 18DESCRIPTION="Based on the ${ECLASS} eclass"
18 19
19# Wait for the supplied number of seconds. If no argument is supplied, defaults 20# Wait for the supplied number of seconds. If no argument is supplied, defaults
88# Default extension for patches 89# Default extension for patches
89EPATCH_SUFFIX="patch.bz2" 90EPATCH_SUFFIX="patch.bz2"
90# Default options for patch 91# Default options for patch
91# Set -g0 to keep RCS, ClearCase, Perforce and SCCS happy. Bug #24571 92# Set -g0 to keep RCS, ClearCase, Perforce and SCCS happy. Bug #24571
92# Set --no-backup-if-mismatch so we don't leave '.orig' files behind. 93# Set --no-backup-if-mismatch so we don't leave '.orig' files behind.
94# Set -E to automatically remove empty files.
93EPATCH_OPTS="-g0 --no-backup-if-mismatch" 95EPATCH_OPTS="-g0 -E --no-backup-if-mismatch"
94# List of patches not to apply. Not this is only file names, 96# List of patches not to apply. Not this is only file names,
95# and not the full path .. 97# and not the full path ..
96EPATCH_EXCLUDE="" 98EPATCH_EXCLUDE=""
97# Change the printed message for a single patch. 99# Change the printed message for a single patch.
98EPATCH_SINGLE_MSG="" 100EPATCH_SINGLE_MSG=""
137# 139#
138# <azarah@gentoo.org> (10 Nov 2002) 140# <azarah@gentoo.org> (10 Nov 2002)
139# 141#
140epatch() { 142epatch() {
141 _epatch_draw_line() { 143 _epatch_draw_line() {
142 # this func produces a lot of pointless noise when debugging is turned on ... 144 [[ -z $1 ]] && set "$(printf "%65s" '')"
143 local is_debug=0 145 echo "${1//?/=}"
144 [[ $- == *x* ]] && is_debug=1 && set +x
145
146 local i=0 str_length="" str_out=""
147
148 # Handle calls that do not have args, or wc not being installed ...
149 if [[ -z $1 ]] || ! type -p wc >/dev/null ; then
150 str_length=65
151 else
152 str_length=$(echo -n "$*" | wc -m)
153 fi
154
155 while ((i++ < ${str_length})) ; do
156 str_out="${str_out}="
157 done
158 echo ${str_out}
159
160 [[ ${is_debug} -eq 1 ]] && set -x
161 return 0
162 } 146 }
163 _epatch_assert() { local _pipestatus=${PIPESTATUS[*]}; [[ ${_pipestatus// /} -eq 0 ]] ; } 147 _epatch_assert() { local _pipestatus=${PIPESTATUS[*]}; [[ ${_pipestatus// /} -eq 0 ]] ; }
164 local PIPE_CMD="" 148 local PIPE_CMD=""
165 local STDERR_TARGET="${T}/$$.out" 149 local STDERR_TARGET="${T}/$$.out"
166 local PATCH_TARGET="${T}/$$.patch" 150 local PATCH_TARGET="${T}/$$.patch"
453# shell: /bin/false 437# shell: /bin/false
454# homedir: /dev/null 438# homedir: /dev/null
455# groups: none 439# groups: none
456# extra: comment of 'added by portage for ${PN}' 440# extra: comment of 'added by portage for ${PN}'
457enewuser() { 441enewuser() {
442 case ${EBUILD_PHASE} in
443 unpack|compile|test|install)
444 eerror "'enewuser()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
445 eerror "Package fails at QA and at life. Please file a bug."
446 die "Bad package! enewuser is only for use in pkg_* functions!"
447 esac
448
458 # get the username 449 # get the username
459 local euser=$1; shift 450 local euser=$1; shift
460 if [[ -z ${euser} ]] ; then 451 if [[ -z ${euser} ]] ; then
461 eerror "No username specified !" 452 eerror "No username specified !"
462 die "Cannot call enewuser without a username" 453 die "Cannot call enewuser without a username"
648# Default values if you do not specify any: 639# Default values if you do not specify any:
649# groupname: REQUIRED ! 640# groupname: REQUIRED !
650# gid: next available (see groupadd(8)) 641# gid: next available (see groupadd(8))
651# extra: none 642# extra: none
652enewgroup() { 643enewgroup() {
644 case ${EBUILD_PHASE} in
645 unpack|compile|test|install)
646 eerror "'enewgroup()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
647 eerror "Package fails at QA and at life. Please file a bug."
648 die "Bad package! enewgroup is only for use in pkg_* functions!"
649 esac
650
653 # get the group 651 # get the group
654 local egroup="$1"; shift 652 local egroup="$1"; shift
655 if [ -z "${egroup}" ] 653 if [ -z "${egroup}" ]
656 then 654 then
657 eerror "No group specified !" 655 eerror "No group specified !"
901Version=0.9.2 899Version=0.9.2
902Name=${name} 900Name=${name}
903Type=Application 901Type=Application
904Comment=${DESCRIPTION} 902Comment=${DESCRIPTION}
905Exec=${exec} 903Exec=${exec}
904TryExec=${exec}
906Path=${path} 905Path=${path}
907Icon=${icon} 906Icon=${icon}
908Categories=Application;${type};" > "${desktop}" 907Categories=Application;${type};" > "${desktop}"
909 908
910 ( 909 (

Legend:
Removed from v.1.228  
changed lines
  Added in v.1.234

  ViewVC Help
Powered by ViewVC 1.1.20