Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 9988 | Differences between
and this patch

Collapse All | Expand All

(-)ebuild.sh_old (-22 / +116 lines)
Lines 1-7 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
# Copyright 1999-2003 Gentoo Technologies, Inc.
2
# Copyright 1999-2003 Gentoo Technologies, Inc.
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /home/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.133 2003/07/02 03:23:36 carpaski Exp $
4
# $Header: /CVS/ebuild_lang_patch/ebuild.sh,v 1.3 2003/07/28 18:05:34 jmob Exp $
5
5
6
if [ "$*" != "depend" ] && [ "$*" != "clean" ]; then
6
if [ "$*" != "depend" ] && [ "$*" != "clean" ]; then
7
	if [ -f ${T}/successful ]; then
7
	if [ -f ${T}/successful ]; then
Lines 92-97 Link Here
92
	return 1
92
	return 1
93
}
93
}
94
94
95
lang() {
96
	local x
97
	for x in ${USE_LANG}; do
98
		if [ "${x}" == "${1}" ]; then
99
			tty --quiet < /dev/stdout || echo "${x}"
100
			return 0
101
		fi
102
	done
103
	return 1
104
}
105
106
primary_lang() {
107
	# only first of USE_LANG
108
	if [ "${USE_LANG%% *}" == "${1}" ]; then
109
		tty --quiet < /dev/stdout || echo "${USE_LANG%% *}"
110
		return 0
111
	fi
112
	return 1
113
}
114
115
remove_man_files() {
116
117
	local language
118
	local directory 
119
	
120
	for MANDIR in ${MANPATH//:/ }; do
121
		if [ -d "${D}/$MANDIR" ]; then
122
			for directory in ${D}/${MANDIR}/*; do
123
				language=${directory##*/} # basename
124
				if [ "${language:0:3}" != "man" ]; then
125
					# check if language is in passed args and if so leave it alone
126
					has ${language:0:2} $@ || rm -rf $directory
127
				fi
128
			done
129
		fi
130
	done
131
}
132
133
remove_locale_files() {
134
	
135
	local directory
136
	local language
137
138
	LOCALEDIR=${D}/usr/share/locale
139
	if [ -d ${LOCALEDIR} ]; then
140
		for directory in ${LOCALEDIR}/*; do
141
			language=${x##*/} #basename
142
			if [ "${language}" != "C" ] ; then
143
				# check if language is in passed args and if so leave it alone
144
				has ${language:0:2} || rm -rf $directory
145
			fi
146
		done
147
	fi
148
}
149
150
remove_unnecessary_language_files() {
151
152
	# Blanket language file removing -- attempts to remove all language files not specified
153
	# in USE_LANG. The USE_LANG variable must be set or USE must contain '-nls'. With USE containing  
154
	# '-nls' everything except english will be removed. USE_LANG can be *equal* to "+*" in order for
155
	# _no language files to be remove_. In addition to the USE_LANG variable being set USE must
156
	# contain '+nls'.  
157
158
	# If the user has nls disabled attempt to remove everything but english
159
160
	echo ">>> Removing unnecessary language files"
161
162
	if has '-nls' $USE; then
163
		USE_LANG="en"
164
	fi
165
166
	if ! has '+nls' $USE && ! has 'nls' $USE; then
167
		return
168
	fi
169
170
	# If USE_LANG doesn't exist there's nothing for us to do
171
	if [ -z "${USE_LANG}" ]; then
172
		return
173
	fi
174
175
	if [ "$USE_LANG" = "+*" ]; then
176
		continue
177
	else
178
		echo ">>> Removing man files"
179
		remove_man_files $USE_LANG
180
		echo ">>> Removing locale files"
181
		remove_locale_files $USE_LANG
182
	fi
183
}
184
95
has() {
185
has() {
96
	local x
186
	local x
97
187
Lines 309-323 Link Here
309
			EXTRA_ECONF="--build=${CBUILD} ${EXTRA_ECONF}"
399
			EXTRA_ECONF="--build=${CBUILD} ${EXTRA_ECONF}"
310
		fi
400
		fi
311
		./configure \
401
		./configure \
312
		    --prefix=/usr \
402
			--prefix=/usr \
313
		    --host=${CHOST} \
403
			--host=${CHOST} \
314
		    --mandir=/usr/share/man \
404
			--mandir=/usr/share/man \
315
		    --infodir=/usr/share/info \
405
			--infodir=/usr/share/info \
316
		    --datadir=/usr/share \
406
			--datadir=/usr/share \
317
		    --sysconfdir=/etc \
407
			--sysconfdir=/etc \
318
		    --localstatedir=/var/lib \
408
			--localstatedir=/var/lib \
319
				${EXTRA_ECONF} \
409
				${EXTRA_ECONF} \
320
		    "$@" || die "econf failed" 
410
			"$@" || die "econf failed" 
321
	else
411
	else
322
		die "no configure script found"
412
		die "no configure script found"
323
	fi
413
	fi
Lines 327-346 Link Here
327
	if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
417
	if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
328
		if [ ! -z "${PORTAGE_DEBUG}" ]; then
418
		if [ ! -z "${PORTAGE_DEBUG}" ]; then
329
			make -n prefix=${D}/usr \
419
			make -n prefix=${D}/usr \
330
			    datadir=${D}/usr/share \
420
				datadir=${D}/usr/share \
331
			    infodir=${D}/usr/share/info \
421
				infodir=${D}/usr/share/info \
332
		  	  localstatedir=${D}/var/lib \
422
			  localstatedir=${D}/var/lib \
333
			    mandir=${D}/usr/share/man \
423
				mandir=${D}/usr/share/man \
334
			    sysconfdir=${D}/etc \
424
				sysconfdir=${D}/etc \
335
			    "$@" install
425
				"$@" install
336
		fi
426
		fi
337
		make prefix=${D}/usr \
427
		make prefix=${D}/usr \
338
		    datadir=${D}/usr/share \
428
			datadir=${D}/usr/share \
339
		    infodir=${D}/usr/share/info \
429
			infodir=${D}/usr/share/info \
340
		    localstatedir=${D}/var/lib \
430
			localstatedir=${D}/var/lib \
341
		    mandir=${D}/usr/share/man \
431
			mandir=${D}/usr/share/man \
342
		    sysconfdir=${D}/etc \
432
			sysconfdir=${D}/etc \
343
		    "$@" install || die "einstall failed" 
433
			"$@" install || die "einstall failed" 
344
	else
434
	else
345
		die "no Makefile found"
435
		die "no Makefile found"
346
	fi
436
	fi
Lines 561-567 Link Here
561
		#if we have a debug build, let's not strip anything
651
		#if we have a debug build, let's not strip anything
562
		if has nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
652
		if has nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
563
			continue
653
			continue
564
 		else
654
		else
565
			INSOPTIONS="$INSOPTIONS $x"
655
			INSOPTIONS="$INSOPTIONS $x"
566
		fi
656
		fi
567
	done
657
	done
Lines 758-763 Link Here
758
	export PWORKDIR="$WORKDIR"
848
	export PWORKDIR="$WORKDIR"
759
	src_install 
849
	src_install 
760
	#|| abort_install "fail"
850
	#|| abort_install "fail"
851
852
	#remove unnesseary man/locale files
853
	remove_unnecessary_language_files
854
761
	prepall
855
	prepall
762
	cd ${D}
856
	cd ${D}
763
857

Return to bug 9988