Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 210425
Collapse All | Expand All

(-)fixheadtails.eclass.orig (-11 / +22 lines)
Lines 1-19 Link Here
1
# Copyright 1999-2004 Gentoo Foundation
1
# Copyright 1999-2008 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/fixheadtails.eclass,v 1.10 2005/12/20 01:31:53 vapier Exp $
3
# $Header:  $
4
5
# @ECLASS: fixheadtails.eclass
6
# @MAINTAINER:
7
# ???
4
#
8
#
5
# Author John Mylchreest <johnm@gentoo.org>
9
# Original author John Mylchreest <johnm@gentoo.org>
10
# @BLURB: Replaces obsolete head/tail with POSIX compliant ones
11
# @DESCRIPTION:
12
# Replaces obsolete head/tail with POSIX compliant ones
6
13
7
DEPEND=">=sys-apps/sed-4"
14
DEPEND=">=sys-apps/sed-4"
8
15
9
# ht_fix_all
10
# This fixes all files within the current directory.
11
# Do be used in src_unpack ; cd ${S}; ht_fix_all
12
13
# ht_fix_file <param> [<param>] [<param>]..
14
# This fixes the files passed by PARAM
15
# to be used for specific files. ie: ht_fix_file "${FILESDIR}/mypatch.patch"
16
17
do_sed_fix() {
16
do_sed_fix() {
18
	einfo " - fixed $1"
17
	einfo " - fixed $1"
19
	sed -i \
18
	sed -i \
Lines 23-28 Link Here
23
			die "sed ${1} failed"
22
			die "sed ${1} failed"
24
}
23
}
25
24
25
# @FUNCTION: ht_fix_file
26
# @USAGE: < param > [ param ] [ param ] [ ... ]
27
# @DESCRIPTION: 
28
# This fixes the files passed by PARAM
29
# to be used for specific files.
30
#
31
# ie: ht_fix_file "${FILESDIR}/mypatch.patch"
26
ht_fix_file() {
32
ht_fix_file() {
27
	local i
33
	local i
28
34
Lines 33-38 Link Here
33
	done
39
	done
34
}
40
}
35
41
42
# @FUNCTION: ht_fix_all
43
# @DESCRIPTION:
44
# This fixes all files within the current directory.
45
#
46
# To be used in src_unpack ; cd ${S}; ht_fix_all
36
ht_fix_all() {
47
ht_fix_all() {
37
	local MATCHES
48
	local MATCHES
38
	MATCHES=$(grep -l -s -i -R -e "head -[ 0-9]" -e "tail [+-][ 0-9]" * | sort -u)
49
	MATCHES=$(grep -l -s -i -R -e "head -[ 0-9]" -e "tail [+-][ 0-9]" * | sort -u)

Return to bug 210425