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

Collapse All | Expand All

(-)/home/mburcher/gentoo/bin/crossdev (-28 / +28 lines)
Lines 2-10 Link Here
2
# Copyright 1999-2012 Gentoo Foundation
2
# Copyright 1999-2012 Gentoo Foundation
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
4
5
CROSSDEV_VER="20120531"
5
CROSSDEV_VER="20120531_prefixmod"
6
6
7
cd /
7
cd $EPREFIX/
8
umask 0022 #159111
8
umask 0022 #159111
9
9
10
if [[ ${ROOT:-/} != "/" ]] ; then
10
if [[ ${ROOT:-/} != "/" ]] ; then
Lines 12-20 Link Here
12
	exit 2
12
	exit 2
13
fi
13
fi
14
14
15
CONFIGROOT="${PORTAGE_CONFIGROOT}/etc/portage"
15
CONFIGROOT="${EPREFIX}/${PORTAGE_CONFIGROOT}/etc/portage"
16
16
17
source /etc/init.d/functions.sh || exit 1
17
source $EPREFIX/etc/init.d/functions.sh || exit 1
18
esyslog() { :; }
18
esyslog() { :; }
19
die_logs() {
19
die_logs() {
20
	echo
20
	echo
Lines 301-307 Link Here
301
301
302
	# make sure we have a valid logdir
302
	# make sure we have a valid logdir
303
	: ${PORT_LOGDIR:=/var/log/portage}
303
	: ${PORT_LOGDIR:=/var/log/portage}
304
	mkdir -p "${PORT_LOGDIR}"
304
	mkdir -p "${EPREFIX}/${PORT_LOGDIR}"
305
}
305
}
306
306
307
uninstall() {
307
uninstall() {
Lines 321-333 Link Here
321
	done
321
	done
322
	rm -rf "${CONFIGROOT}"/env/cross-${CTARGET}
322
	rm -rf "${CONFIGROOT}"/env/cross-${CTARGET}
323
	rmdir "${CONFIGROOT}"/env 2>/dev/null
323
	rmdir "${CONFIGROOT}"/env 2>/dev/null
324
	rm -f /etc/revdep-rebuild/05cross-${CTARGET}
324
	rm -f $EPREFIX/etc/revdep-rebuild/05cross-${CTARGET}
325
	rmdir /etc/revdep-rebuild 2>/dev/null
325
	rmdir $EPREFIX/etc/revdep-rebuild 2>/dev/null
326
326
327
	rmdir /var/db/pkg/cross-${CTARGET} 2>/dev/null
327
	rmdir $EPREFIX/var/db/pkg/cross-${CTARGET} 2>/dev/null
328
	if [[ -d /var/db/pkg/cross-${CTARGET} ]] ; then
328
	if [[ -d $EPREFIX/var/db/pkg/cross-${CTARGET} ]] ; then
329
		export CLEAN_DELAY=0
329
		export CLEAN_DELAY=0
330
		cd /var/db/pkg
330
		cd $EPREFIX/var/db/pkg
331
		local pkgs=( cross-${CTARGET}/* )
331
		local pkgs=( cross-${CTARGET}/* )
332
		emerge -qC ${pkgs[@]/#/=} || exit 1
332
		emerge -qC ${pkgs[@]/#/=} || exit 1
333
	else
333
	else
Lines 340-355 Link Here
340
		gprof ld nm objcopy objdump ranlib readelf \
340
		gprof ld nm objcopy objdump ranlib readelf \
341
		size strings strip windmc windres
341
		size strings strip windmc windres
342
	do
342
	do
343
		rm -f /usr/bin/${CTARGET}-${f} /usr/${CTARGET}/bin/${f}
343
		rm -f $EPREFIX/usr/bin/${CTARGET}-${f} $EPREFIX/usr/${CTARGET}/bin/${f}
344
	done
344
	done
345
	rm -f /usr/${CTARGET}/{sys-include,usr}
345
	rm -f $EPREFIX/usr/${CTARGET}/{sys-include,usr}
346
	rmdir /usr/${CTARGET}/{include/asm,include} 2>/dev/null
346
	rmdir $EPREFIX/usr/${CTARGET}/{include/asm,include} 2>/dev/null
347
	rm -f /usr/bin/${CTARGET}-{gcc,{c,g}++,cpp,gfortran,gcov}
347
	rm -f $EPREFIX/usr/bin/${CTARGET}-{gcc,{c,g}++,cpp,gfortran,gcov}
348
	rm -f /etc/env.d/{binutils,gcc}/config-${CTARGET}
348
	rm -f $EPREFIX/etc/env.d/{binutils,gcc}/config-${CTARGET}
349
349
350
	# clean out files from crossdev itself
350
	# clean out files from crossdev itself
351
	[[ -e /var/db/pkg/cross-${CTARGET} ]] && rmdir /var/db/pkg/cross-${CTARGET}
351
	[[ -e $EPREFIX/var/db/pkg/cross-${CTARGET} ]] && rmdir $EPREFIX/var/db/pkg/cross-${CTARGET}
352
	rm -f /usr/bin/${CTARGET}-{emerge,fix-root,pkg-config} /usr/bin/emerge-${CTARGET}
352
	rm -f $EPREFIX/usr/bin/${CTARGET}-{emerge,fix-root,pkg-config} $EPREFIX/usr/bin/emerge-${CTARGET}
353
353
354
	for f in make.{conf,globals,profile} ; do
354
	for f in make.{conf,globals,profile} ; do
355
		f="/usr/${CTARGET}/etc/${f}"
355
		f="/usr/${CTARGET}/etc/${f}"
Lines 357-363 Link Here
357
		f="/usr/${CTARGET}/etc/portage/${f##*/}"
357
		f="/usr/${CTARGET}/etc/portage/${f##*/}"
358
		[[ -L ${f} ]] && rm -f ${f}
358
		[[ -L ${f} ]] && rm -f ${f}
359
	done
359
	done
360
	find /usr/share/crossdev/etc/ -type f | \
360
	find $EPREFIX/usr/share/crossdev/etc/ -type f | \
361
	while read f ; do
361
	while read f ; do
362
		f1=${f}
362
		f1=${f}
363
		[[ ! -e ${f1} ]] && continue
363
		[[ ! -e ${f1} ]] && continue
Lines 371-377 Link Here
371
	done
371
	done
372
372
373
	# clean out the sysroot, prompting the user if need be
373
	# clean out the sysroot, prompting the user if need be
374
	for d in /usr/lib/gcc{,-lib}/${CTARGET} /usr/${CTARGET} ; do
374
	for d in $EPREFIX/usr/lib/gcc{,-lib}/${CTARGET} $EPREFIX/usr/${CTARGET} ; do
375
		if [[ ! -d ${d} ]] ; then
375
		if [[ ! -d ${d} ]] ; then
376
			rm -f "${d}"
376
			rm -f "${d}"
377
		else
377
		else
Lines 584-590 Link Here
584
setup_portage_vars
584
setup_portage_vars
585
if [[ -z ${CROSSDEV_OVERLAY} ]] ; then
585
if [[ -z ${CROSSDEV_OVERLAY} ]] ; then
586
	eerror "You need to specify an output overlay.  Please use --ov-output or set"
586
	eerror "You need to specify an output overlay.  Please use --ov-output or set"
587
	eerror "PORTDIR_OVERLAY in your make.conf.  A standard setting is: /usr/local/portage"
587
	eerror "PORTDIR_OVERLAY in your make.conf.  A standard setting is: $EPREFIX/usr/local/portage"
588
	exit 1
588
	exit 1
589
fi
589
fi
590
590
Lines 722-728 Link Here
722
	(
722
	(
723
	info
723
	info
724
	emerge -v --info
724
	emerge -v --info
725
	) >& "${PORT_LOGDIR}"/cross-${CTARGET}-info.log || exit 1
725
	) >& "${EPREFIX}/${PORT_LOGDIR}"/cross-${CTARGET}-info.log || exit 1
726
fi
726
fi
727
727
728
####################################
728
####################################
Lines 828-834 Link Here
828
	output="env/cross-${CTARGET}/${pkg}.conf"
828
	output="env/cross-${CTARGET}/${pkg}.conf"
829
	cat <<-EOF > "${output}"
829
	cat <<-EOF > "${output}"
830
	SYMLINK_LIB=no
830
	SYMLINK_LIB=no
831
	COLLISION_IGNORE="\${COLLISION_IGNORE} /usr/lib/debug/.build-id"
831
	COLLISION_IGNORE="\${COLLISION_IGNORE} $EPREFIX/usr/lib/debug/.build-id"
832
	$(printf '%b' "${env}")
832
	$(printf '%b' "${env}")
833
	$(printf '%b' "${AENV}")
833
	$(printf '%b' "${AENV}")
834
	EOF
834
	EOF
Lines 891-897 Link Here
891
	local layout=${meta}/layout.conf
891
	local layout=${meta}/layout.conf
892
	local d name masters thin_manifests="false"
892
	local d name masters thin_manifests="false"
893
893
894
	mkdir -p "${meta}"
894
	mkdir -p "${EPREFIX}/${meta}"
895
	if [[ -e ${layout} ]] ; then
895
	if [[ -e ${layout} ]] ; then
896
		if ! grep -qs "^${autogen_tag}" "${layout}" ; then
896
		if ! grep -qs "^${autogen_tag}" "${layout}" ; then
897
			einfo "leaving metadata/layout.conf alone in ${CROSSDEV_OVERLAY}"
897
			einfo "leaving metadata/layout.conf alone in ${CROSSDEV_OVERLAY}"
Lines 967-987 Link Here
967
set_metadata
967
set_metadata
968
968
969
# filter out revdep rebuild stuff #182601
969
# filter out revdep rebuild stuff #182601
970
mkdir -p /etc/revdep-rebuild
970
mkdir -p $EPREFIX/etc/revdep-rebuild
971
echo "SEARCH_DIRS_MASK=/usr/${CTARGET}" > /etc/revdep-rebuild/05cross-${CTARGET}
971
echo "SEARCH_DIRS_MASK=/usr/${CTARGET}" > $EPREFIX/etc/revdep-rebuild/05cross-${CTARGET}
972
972
973
hr
973
hr
974
974
975
#######################################
975
#######################################
976
### Create links for helper scripts ###
976
### Create links for helper scripts ###
977
977
978
mkdir -p /usr/${CTARGET}
978
mkdir -p $EPREFIX/usr/${CTARGET}
979
emerge-wrapper --target ${CTARGET} --init || exit 1
979
emerge-wrapper --target ${CTARGET} --init || exit 1
980
980
981
#################
981
#################
982
emerged_with_use() {
982
emerged_with_use() {
983
	local pkg=$1 use=$2
983
	local pkg=$1 use=$2
984
	grep -qs ${use} /var/db/pkg/cross-${CTARGET}/${pkg}-*/USE
984
	grep -qs ${use} $EPREFIX/var/db/pkg/cross-${CTARGET}/${pkg}-*/USE
985
}
985
}
986
set_eopts_on_pkg_status() {
986
set_eopts_on_pkg_status() {
987
	emerged_with_use "$@" \
987
	emerged_with_use "$@" \
Lines 999-1005 Link Here
999
999
1000
	[[ ${INIT_TARGET_ONLY} == "yes" ]] && return 0
1000
	[[ ${INIT_TARGET_ONLY} == "yes" ]] && return 0
1001
1001
1002
	local logfile=${PORT_LOGDIR}/${category}
1002
	local logfile="${EPREFIX}/${PORT_LOGDIR}/${category}"
1003
	[[ -z $2 ]] \
1003
	[[ -z $2 ]] \
1004
		&& logfile=${logfile}-${pn}.log \
1004
		&& logfile=${logfile}-${pn}.log \
1005
		|| logfile=${logfile}-$2.log
1005
		|| logfile=${logfile}-$2.log

Return to bug 384167