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

Diff of /eclass/eutils.eclass

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

Revision 1.4 Revision 1.5
1# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2002 Gentoo Technologies, Inc.
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# Author: Martin Schlemmer <azarah@gentoo.org> 3# Author: Martin Schlemmer <azarah@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.4 2002/11/11 21:36:45 azarah Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.5 2002/11/11 22:36:22 azarah Exp $
5# This eclass is for general purpose functions that most ebuilds 5# This eclass is for general purpose functions that most ebuilds
6# have to implement themselfs. 6# have to implement themselfs.
7# 7#
8# NB: If you add anything, please comment it! 8# NB: If you add anything, please comment it!
9 9
47 more info. */ 47 more info. */
48GROUP ( /lib/libxxx ) 48GROUP ( /lib/libxxx )
49END_LDSCRIPT 49END_LDSCRIPT
50 50
51 dosed "s:libxxx:$1:" /usr/lib/$1 51 dosed "s:libxxx:$1:" /usr/lib/$1
52
53 return 0
52} 54}
53 55
56# Simple function to draw a line consisting of '=' the same length as $*
57#
58# <azarah@gentoo.org> (11 Nov 2002)
59#
60draw_line() {
61 local i=0
62 local str_length=""
63
64 # Handle calls that do not have args, or wc not being installed ...
65 if [ -z "$1" -o ! -x "$(which wc 2>/dev/null)" ]
66 then
67 echo "==============================================================="
68 return 0
69 fi
70
71 # Get the length of $*
72 str_length="$(echo -n "$*" | wc -m)"
73
74 while [ "$i" -lt "${str_length}" ]
75 do
76 echo -n "="
77
78 i=$((i + 1))
79 done
80
81 echo
82
83 return 0
84}
54 85
55# Default directory where patches are located 86# Default directory where patches are located
56EPATCH_SOURCE="${WORKDIR}/patch" 87EPATCH_SOURCE="${WORKDIR}/patch"
57# Default extension for patches 88# Default extension for patches
58EPATCH_SUFFIX="patch.bz2" 89EPATCH_SUFFIX="patch.bz2"
154 einfo "Applying ${x##*/}..." 185 einfo "Applying ${x##*/}..."
155 else 186 else
156 einfo " ${x##*/}..." 187 einfo " ${x##*/}..."
157 fi 188 fi
158 189
159 echo "*** Patch ${x##*/} ***" > ${STDERR_TARGET} 190 echo "***** ${x##*/} *****" > ${STDERR_TARGET}
191 echo >> ${STDERR_TARGET}
160 192
161 # Allow for prefix to differ ... im lazy, so shoot me :/ 193 # Allow for prefix to differ ... im lazy, so shoot me :/
162 while [ "${count}" -lt 5 ] 194 while [ "${count}" -lt 5 ]
163 do 195 do
196 # Generate some useful debug info ...
197 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET}
198 echo >> ${STDERR_TARGET}
199
200 echo -n "PATCH COMMAND: " >> ${STDERR_TARGET}
201 echo "${PIPE_CMD} ${x} | patch ${popts} -p${count}" >> ${STDERR_TARGET}
202
203 echo >> ${STDERR_TARGET}
204 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET}
205
164 if eval ${PIPE_CMD} ${x} | patch ${popts} --dry-run -f -p${count} 2>&1 >> ${STDERR_TARGET} 206 if eval ${PIPE_CMD} ${x} | patch ${popts} --dry-run -f -p${count} 2>&1 >> ${STDERR_TARGET}
165 then 207 then
166 eval ${PIPE_CMD} ${x} | patch ${popts} -p${count} 2>&1 >> ${STDERR_TARGET} 208 eval ${PIPE_CMD} ${x} | patch ${popts} -p${count} 2>&1 >> ${STDERR_TARGET}
167 break 209 break
168 fi 210 fi

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20