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

Collapse All | Expand All

(-)/opt/gentoo/home/../var/tmp/portage/app-portage/gentoolkit-0.3.0_rc8-r1/work/gentoolkit-0.3.0_rc8/bin/revdep-rebuild (-42 / +124 lines)
Lines 84-90 declare RC_NOCOLOR # Hack to Link Here
84
declare REBUILD_LIST           # Array of atoms to emerge
84
declare REBUILD_LIST           # Array of atoms to emerge
85
declare SKIP_LIST              # Array of atoms that cannot be emerged (masked?)
85
declare SKIP_LIST              # Array of atoms that cannot be emerged (masked?)
86
declare SONAME                 # Soname/soname path pattern given on commandline
86
declare SONAME                 # Soname/soname path pattern given on commandline
87
declare SONAME_SEARCH          # Value of SONAME modified to match ldd's output
87
declare SONAME_SEARCH          # Value of SONAME modified to match ldd's output #'# vim-syntax
88
declare WORKING_TEXT           # Feedback about the search
88
declare WORKING_TEXT           # Feedback about the search
89
declare WORKING_DIR            # Working directory where cache files are kept
89
declare WORKING_DIR            # Working directory where cache files are kept
90
90
Lines 249-255 die() { Link Here
249
clean_exit() {
249
clean_exit() {
250
	if [[ ! $KEEP_TEMP ]]; then
250
	if [[ ! $KEEP_TEMP ]]; then
251
		rm -f "${FILES[@]}"
251
		rm -f "${FILES[@]}"
252
		if [[ "$WORKING_DIR" != "/var/cache/${APP_NAME}" ]]; then
252
		if [[ "$WORKING_DIR" != "$EPREFIX/var/cache/${APP_NAME}" ]]; then
253
			# Remove the working directory
253
			# Remove the working directory
254
			builtin cd; rmdir "$WORKING_DIR"
254
			builtin cd; rmdir "$WORKING_DIR"
255
		fi
255
		fi
Lines 270-283 get_file_owner() { Link Here
270
270
271
	# Workaround for bug 280341
271
	# Workaround for bug 280341
272
	mlib=$(echo ${*}|sed 's:/lib/:/lib64/:')
272
	mlib=$(echo ${*}|sed 's:/lib/:/lib64/:')
273
	[[ "${*}" == "${mlib}" ]] && mlib=$(echo ${*}|sed 's:/lib64/:/lib/:')
273
	# So long as /usr/lib64 is a symlink...
274
	if [[ -L $(echo ${mlib}|sed 's:/lib64.*$:/lib64:' ) ]]; then
275
		[[ "${*}" == "${mlib}" ]] && mlib=$(echo ${*}|sed 's:/lib64/:/lib/:')
276
	fi
274
277
275
	# Add a space to the end of each object name to prevent false
278
	# Add a space to the end of each object name to prevent false
276
	# matches, for example /usr/bin/dia matching /usr/bin/dialog (bug #196460).
279
	# matches, for example /usr/bin/dia matching /usr/bin/dialog (bug #196460).
277
	# The same for "${rpath} ".
280
	# The same for "${rpath} ".
278
	find /var/db/pkg -type f -name CONTENTS -print0 |
281
	find $EPREFIX/var/db/pkg -type f -name CONTENTS -print0 |
279
		xargs -0 grep -m 1 -Fl -e "${*} " -e "${rpath} " -e "${mlib} " |
282
		xargs -0 grep -m 1 -Fl -e "${*} " -e "${rpath} " -e "${mlib} " |
280
		sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:'
283
		sed 's:^.*/var/db/pkg/\(.*\)/CONTENTS:\1:'
281
}
284
}
282
##
285
##
283
# Normalize some EMERGE_OPTIONS
286
# Normalize some EMERGE_OPTIONS
Lines 293-299 setup_color() { Link Here
293
	# This should still work if NOCOLOR is set by the -C flag or in the user's
296
	# This should still work if NOCOLOR is set by the -C flag or in the user's
294
	# environment.
297
	# environment.
295
	[[ $NOCOLOR = yes || $NOCOLOR = true ]] && export RC_NOCOLOR=yes # HACK! (grr)
298
	[[ $NOCOLOR = yes || $NOCOLOR = true ]] && export RC_NOCOLOR=yes # HACK! (grr)
296
	. /etc/init.d/functions.sh
299
	. $EPREFIX/etc/init.d/functions.sh
297
}
300
}
298
##
301
##
299
# Die if an argument is missing.
302
# Die if an argument is missing.
Lines 419-429 get_shortopts() { Link Here
419
get_opts() {
422
get_opts() {
420
	local avoid_utils
423
	local avoid_utils
421
	local -a args
424
	local -a args
425
426
	local running_on_irix
427
	running_on_irix="$(uname -s)"
428
	if [[ $running_on_irix == IRIX || $running_on_irix == IRIX64 ]]; then
429
		running_on_irix=1
430
	else
431
		running_on_irix=0
432
	fi
433
422
	echo_v() { ewarn "$@"; }
434
	echo_v() { ewarn "$@"; }
423
	unset VERBOSE KEEP_TEMP EMERGE_OPTIONS RM_OLD_TEMPFILES
435
	unset VERBOSE KEEP_TEMP EMERGE_OPTIONS RM_OLD_TEMPFILES
424
	ORDER_PKGS=1
436
	ORDER_PKGS=1
425
	PACKAGE_NAMES=1
437
	PACKAGE_NAMES=1
426
	SONAME="not found"
438
	if (( $running_on_irix )); then
439
		SONAME="Fatal Error"
440
	else
441
		SONAME="not found"
442
	fi
427
	SEARCH_BROKEN=1
443
	SEARCH_BROKEN=1
428
	FULL_LD_PATH=1
444
	FULL_LD_PATH=1
429
	while [[ $1 ]]; do
445
	while [[ $1 ]]; do
Lines 450-456 get_opts() { Link Here
450
	normalize_emerge_opts
466
	normalize_emerge_opts
451
467
452
	# If the user is not super, add --pretend to EMERGE_OPTIONS
468
	# If the user is not super, add --pretend to EMERGE_OPTIONS
453
	if [[ ${EMERGE_OPTIONS[@]} != *--pretend* && $UID -ne 0 ]]; then
469
	if [[ ${EMERGE_OPTIONS[@]} != *--pretend* && $UID -ne 0 && -z "$EPREFIX" ]]; then
454
		ewarn "You are not superuser. Adding --pretend to emerge options."
470
		ewarn "You are not superuser. Adding --pretend to emerge options."
455
		EMERGE_OPTIONS+=(--pretend)
471
		EMERGE_OPTIONS+=(--pretend)
456
	fi
472
	fi
Lines 488-494 cd() { Link Here
488
	if builtin cd -P "$@"; then
504
	if builtin cd -P "$@"; then
489
		if [[ $1 != $PWD ]]; then
505
		if [[ $1 != $PWD ]]; then
490
			# Some symlink malfeasance is going on
506
			# Some symlink malfeasance is going on
491
			die 1 "Working directory expected to be $1, but it is $PWD"
507
			ewarn "Working directory expected to be $1, but it is $PWD"
492
		fi
508
		fi
493
	else
509
	else
494
		die 1 "Unable to change working directory to '$@'"
510
		die 1 "Unable to change working directory to '$@'"
Lines 540-547 get_search_env() { Link Here
540
	local old_env
556
	local old_env
541
	local uid=$(python -c 'import os; import pwd; print pwd.getpwuid(os.getuid())[0]')
557
	local uid=$(python -c 'import os; import pwd; print pwd.getpwuid(os.getuid())[0]')
542
	# Find a place to put temporary files
558
	# Find a place to put temporary files
543
	if [[ "$uid" == "root" ]]; then
559
	if [[ "$uid" == "root" || -n "$EPREFIX" ]]; then
544
		local tmp_target="/var/cache/${APP_NAME}"
560
		local tmp_target="$EPREFIX/var/cache/${APP_NAME}"
545
	else
561
	else
546
		local tmp_target="$(mktemp -d -t revdep-rebuild.XXXXXXXXXX)"
562
		local tmp_target="$(mktemp -d -t revdep-rebuild.XXXXXXXXXX)"
547
	fi
563
	fi
Lines 664-672 get_ldpath() { Link Here
664
		clean_trap "$LDPATH_FILE"
680
		clean_trap "$LDPATH_FILE"
665
		# Ensure that the "trusted" lib directories are at the start of the path
681
		# Ensure that the "trusted" lib directories are at the start of the path
666
		COMPLETE_LD_LIBRARY_PATH=(
682
		COMPLETE_LD_LIBRARY_PATH=(
667
			/lib*
683
			$EPREFIX/lib*
668
			/usr/lib*
684
			$EPREFIX/usr/lib*
669
			$(sed '/^#/d;s/#.*$//' < /etc/ld.so.conf)
685
			$(sed '/^#/d;s/#.*$//' < $EPREFIX/etc/ld.so.conf)
670
			$(sed 's:/[^/]*$::' < "$FILES_FILE" | sort -ru)
686
			$(sed 's:/[^/]*$::' < "$FILES_FILE" | sort -ru)
671
		)
687
		)
672
		IFS=':'
688
		IFS=':'
Lines 684-689 main_checks() { Link Here
684
	local ldd_status
700
	local ldd_status
685
	local numFiles
701
	local numFiles
686
	local COMPLETE_LD_LIBRARY_PATH
702
	local COMPLETE_LD_LIBRARY_PATH
703
	local running_on_irix old_RLD_ARGS old_LD_LIBRARY_PATH old_LD_LIBRARYN32_PATH old_LD_LIBRARY64_PATH
704
	running_on_irix="$(uname -s)"
705
	if [[ $running_on_irix == IRIX || $running_on_irix == IRIX64 ]]; then
706
		running_on_irix=1
707
	else
708
		running_on_irix=0
709
	fi
687
	if [[ $SEARCH_BROKEN && $FULL_LD_PATH ]]; then
710
	if [[ $SEARCH_BROKEN && $FULL_LD_PATH ]]; then
688
		[[ -r "$LDPATH_FILE" && -s "$LDPATH_FILE" ]] ||
711
		[[ -r "$LDPATH_FILE" && -s "$LDPATH_FILE" ]] ||
689
			die 1 "Unable to find $LDPATH_FILE"
712
			die 1 "Unable to find $LDPATH_FILE"
Lines 700-745 main_checks() { Link Here
700
			if [[ $target_file != *.la ]]; then
723
			if [[ $target_file != *.la ]]; then
701
				# Note: double checking seems to be faster than single with complete path
724
				# Note: double checking seems to be faster than single with complete path
702
				# (special add ons are rare).
725
				# (special add ons are rare).
726
				if (( $running_on_irix )); then
727
					# By default, IRIX' rld writes errors to /dev/tty :(
728
					old_RLD_ARGS="$_RLD_ARGS"
729
					export _RLD_ARGS="-log /dev/stdout"
730
				fi
703
				ldd_output=$(ldd "$target_file" 2>> "$ERRORS_FILE" | sort -u)
731
				ldd_output=$(ldd "$target_file" 2>> "$ERRORS_FILE" | sort -u)
704
				ldd_status=$? # TODO: Check this for problems with sort
732
				ldd_status=$? # TODO: Check this for problems with sort
733
				if (( $running_on_irix )); then
734
					export _RLD_ARGS="$old_RLD_ARGS"
735
				fi
705
				# HACK: if LD_LIBRARY_MASK is null or undefined grep -vF doesn't work
736
				# HACK: if LD_LIBRARY_MASK is null or undefined grep -vF doesn't work
706
				if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
737
				if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
707
					grep -q "$SONAME_SEARCH"; then
738
					grep -q "$SONAME_SEARCH"; then
708
					if [[ $SEARCH_BROKEN && $FULL_LD_PATH ]]; then
739
					if [[ $SEARCH_BROKEN && $FULL_LD_PATH ]]; then
740
						if (( $running_on_irix )); then
741
							old_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
742
							old_LD_LIBRARYN32_PATH="$LD_LIBRARYN32_PATH"
743
							old_LD_LIBRARY64_PATH="$LD_LIBRARY64_PATH"
744
							# If either of these is set, LD_LIBRARY_PATH is ignored
745
							unset LD_LIBRARYN32_PATH
746
							unset LD_LIBRARY64_PATH
747
							# LD_LIBRARY_PATH *must* be exported to take effect on IRIX!
748
							export LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH"
749
750
							old_RLD_ARGS="$_RLD_ARGS"
751
							export _RLD_ARGS="-log /dev/stdout"
752
						fi
709
						if LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH" ldd "$target_file" 2>/dev/null |
753
						if LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH" ldd "$target_file" 2>/dev/null |
710
							grep -vF "$LD_LIBRARY_MASK" | grep -q "$SONAME_SEARCH"; then
754
							grep -vF "$LD_LIBRARY_MASK" | grep -q "$SONAME_SEARCH"; then
755
							if (( $running_on_irix )); then
756
								export _RLD_ARGS="$old_RLD_ARGS"
757
								export LD_LIBRARY_PATH="$old_LD_LIBRARY_PATH"
758
								export LD_LIBRARYN32_PATH="$old_LD_LIBRARYN32_PATH"
759
								export LD_LIBRARY64_PATH="$old_LD_LIBRARY64_PATH"
760
							fi
711
							# FIXME: I hate duplicating code
761
							# FIXME: I hate duplicating code
712
							# Only build missing direct dependencies
762
							# Only build missing direct dependencies
713
							MISSING_LIBS=$(
763
							if (( $running_on_irix )); then
714
								expr='s/[[:space:]]*\([^[:space:]]*\) => not found/\1/p'
764
								MISSING_LIBS=$(
715
								sed -n "$expr" <<< "$ldd_output"
765
									expr="s/^.*Cannot Successfully map soname '\([^[:space:]]*\)' .*$/\1/p";
716
							)
766
									sed -n "$expr" <<< "$ldd_output"
767
								)
768
							else
769
								MISSING_LIBS=$(
770
									expr='s/[[:space:]]*\([^[:space:]]*\) => not found/\1/p'
771
									sed -n "$expr" <<< "$ldd_output"
772
								)
773
							fi
717
							REQUIRED_LIBS=$(
774
							REQUIRED_LIBS=$(
718
								expr='s/^[[:space:]]*NEEDED[[:space:]]*\([^[:space:]]*\).*/\1/p';
775
								expr='s/^[[:space:]]*NEEDED[[:space:]]*\([^[:space:]]*\).*/\1/p';
719
								objdump -x "$target_file" | grep NEEDED | sed "$expr" | sort -u
776
								objdump -x "$target_file" 2>/dev/null | grep NEEDED | sed "$expr" | sort -u
720
							)
777
							)
721
							MISSING_LIBS=$(grep -F "$REQUIRED_LIBS" <<< "$MISSING_LIBS")
778
							MISSING_LIBS=$(grep -F "$REQUIRED_LIBS" <<< "$MISSING_LIBS")
722
							if [[ $MISSING_LIBS ]]; then
779
							if [[ $MISSING_LIBS ]]; then
723
								echo "obj $target_file" >> "$BROKEN_FILE"
780
								echo "obj $target_file" >> "$BROKEN_FILE"
724
								echo_v "  broken $target_file (requires $MISSING_LIBS)"
781
								echo_v "  broken $target_file ( requires $( for LIB in $( sort <<< "$MISSING_LIBS" | uniq ); do echo -n "$LIB "; done )(1) )"
782
							fi
783
						else
784
							if (( $running_on_irix )); then
785
								export _RLD_ARGS="$old_RLD_ARGS"
786
								export LD_LIBRARY_PATH="$old_LD_LIBRARY_PATH"
787
								export LD_LIBRARYN32_PATH="$old_LD_LIBRARYN32_PATH"
788
								export LD_LIBRARY64_PATH="$old_LD_LIBRARY64_PATH"
725
							fi
789
							fi
726
						fi
790
						fi
727
					else
791
					else
728
						# FIXME: I hate duplicating code
792
						# FIXME: I hate duplicating code
729
						# Only rebuild for direct dependencies
793
						# Only rebuild for direct dependencies
730
						MISSING_LIBS=$(
794
						if (( $running_on_irix )); then
731
							expr="/$SONAME_SEARCH/s/^[[:space:]]*\([^[:space:]]*\).*$/\1/p"
795
							MISSING_LIBS=$(
732
							sort -u <<< "$ldd_output" | sed -n "$expr"
796
								expr="s/^.*Cannot Successfully map soname '\([^[:space:]]*\)' .*$/\1/p";
733
						)
797
								sed -n "$expr" <<< "$ldd_output"
798
							)
799
						else
800
							MISSING_LIBS=$(
801
								expr="/$SONAME_SEARCH/s/^[[:space:]]*\([^[:space:]]*\).*$/\1/p"
802
								sort -u <<< "$ldd_output" | sed -n "$expr"
803
							)
804
						fi
734
						REQUIRED_LIBS=$(
805
						REQUIRED_LIBS=$(
735
							expr='s/^[[:space:]]*NEEDED[[:space:]]*\([^[:space:]]*\).*/\1/p';
806
							expr='s/^[[:space:]]*NEEDED[[:space:]]*\([^[:space:]]*\).*/\1/p';
736
							objdump -x "$target_file" | grep NEEDED | sed "$expr" | sort -u
807
							objdump -x "$target_file" 2>/dev/null | grep NEEDED | sed "$expr" | sort -u
737
						)
808
						)
738
						MISSING_LIBS=$(grep -F "$REQUIRED_LIBS" <<< "$MISSING_LIBS")
809
						MISSING_LIBS=$(grep -F "$REQUIRED_LIBS" <<< "$MISSING_LIBS")
739
						if [[ $MISSING_LIBS ]]; then
810
						if [[ $MISSING_LIBS ]]; then
740
							echo "obj $target_file" >> "$BROKEN_FILE"
811
							echo "obj $target_file" >> "$BROKEN_FILE"
741
							if [[ $SEARCH_BROKEN ]]; then
812
							if [[ $SEARCH_BROKEN ]]; then
742
								echo_v "  broken $target_file (requires $MISSING_LIBS)"
813
								echo_v "  broken $target_file ( requires $( for LIB in $( sort <<< "$MISSING_LIBS" | uniq ); do echo -n "$LIB "; done )(2) )"
743
							else
814
							else
744
								echo_v "  found $target_file"
815
								echo_v "  found $target_file"
745
							fi
816
							fi
Lines 759-765 main_checks() { Link Here
759
				); do
830
				); do
760
					if [[ $depend = /* && ! -e $depend ]]; then
831
					if [[ $depend = /* && ! -e $depend ]]; then
761
						echo "obj $target_file" >> "$BROKEN_FILE"
832
						echo "obj $target_file" >> "$BROKEN_FILE"
762
						echo_v "  broken $target_file (requires $depend)"
833
						echo_v "  broken $target_file ( requires $depend (3) )"
763
					elif [[ $depend = -[LR]/* ]]; then
834
					elif [[ $depend = -[LR]/* ]]; then
764
						if ! [[ $'\n'${la_SEARCH_DIRS}$'\n' == *$'\n'${depend#-?}$'\n'* ]]; then
835
						if ! [[ $'\n'${la_SEARCH_DIRS}$'\n' == *$'\n'${depend#-?}$'\n'* ]]; then
765
							la_SEARCH_DIRS+=$'\n'"${depend#-?}"
836
							la_SEARCH_DIRS+=$'\n'"${depend#-?}"
Lines 773-782 main_checks() { Link Here
773
								la_broken="no"
844
								la_broken="no"
774
							fi
845
							fi
775
						done
846
						done
847
						if (( $running_on_irix )); then
848
							for la_search_dir in /lib /lib32 /lib32/internal /lib32/mips4 /lib64 /lib64/mips4 \
849
								/usr/lib /usr/lib/abi /usr/lib/internal \
850
								/usr/lib32 /usr/lib32/internal /usr/lib32/mips3 /usr/lib32/mips4 \
851
								/usr/lib64 /usr/lib64/internal /usr/lib64/mips3 /usr/lib64/mips4
852
							do
853
								if [[ -e ${la_search_dir}/${la_lib}.so || -e ${la_search_dir}/${la_lib}.a ]]; then
854
									la_broken="no"
855
								fi
856
							done
857
						fi
776
						IFS="$OIFS"
858
						IFS="$OIFS"
777
						if [[ $la_broken = yes ]]; then
859
						if [[ $la_broken = yes ]]; then
778
							echo "obj $target_file" >> "$BROKEN_FILE"
860
							echo "obj $target_file" >> "$BROKEN_FILE"
779
							echo_v "  broken $target_file (requires $depend)"
861
							echo_v "  broken $target_file ( requires $depend (4) )"
780
						fi
862
						fi
781
					fi
863
					fi
782
				done
864
				done
Lines 790-796 main_checks() { Link Here
790
			# Look for missing version
872
			# Look for missing version
791
			while read target_file; do
873
			while read target_file; do
792
				echo "obj $target_file" >> "$BROKEN_FILE"
874
				echo "obj $target_file" >> "$BROKEN_FILE"
793
				echo_v "  broken $target_file (no version information available)"
875
				echo_v "  broken $target_file ( no version information available )"
794
			done < <(
876
			done < <(
795
				# Regexify LD_LIBRARY_MASK. Exclude it from the search.
877
				# Regexify LD_LIBRARY_MASK. Exclude it from the search.
796
				LD_LIBRARY_MASK="${LD_LIBRARY_MASK//$'\n'/|}"
878
				LD_LIBRARY_MASK="${LD_LIBRARY_MASK//$'\n'/|}"
Lines 870-876 assign_packages_to_ebuilds() { Link Here
870
				# Get the slot
952
				# Get the slot
871
				PKG="${EXACT_PKG%%-r[[:digit:]]*}"
953
				PKG="${EXACT_PKG%%-r[[:digit:]]*}"
872
				PKG="${PKG%-*}"
954
				PKG="${PKG%-*}"
873
				SLOT=$(</var/db/pkg/$EXACT_PKG/SLOT)
955
				SLOT=$(<$EPREFIX/var/db/pkg/$EXACT_PKG/SLOT)
874
				echo "$PKG:$SLOT"
956
				echo "$PKG:$SLOT"
875
			done < "$PKGS_FILE" > "$EBUILDS_FILE"
957
			done < "$PKGS_FILE" > "$EBUILDS_FILE"
876
			einfo "Generated new $EBUILDS_FILE"
958
			einfo "Generated new $EBUILDS_FILE"
Lines 1034-1070 setup_search_paths_and_masks() { Link Here
1034
1116
1035
	einfo "Configuring search environment for $APP_NAME"
1117
	einfo "Configuring search environment for $APP_NAME"
1036
1118
1037
	# Update the incremental variables using /etc/profile.env, /etc/ld.so.conf,
1119
	# Update the incremental variables using $EPREFIX/etc/profile.env,
1038
	# portage, and the environment
1120
	# $EPREFIX/etc/ld.so.conf, portage, and the environment
1039
1121
1040
	# Read the incremental variables from environment and portage
1122
	# Read the incremental variables from environment and portage
1041
	# Until such time as portage supports these variables as incrementals
1123
	# Until such time as portage supports these variables as incrementals
1042
	# The value will be what is in /etc/make.conf
1124
	# The value will be what is in $EPREFIX/etc/make.conf
1043
#	SEARCH_DIRS+=" "$(unset SEARCH_DIRS; portageq envvar SEARCH_DIRS)
1125
#	SEARCH_DIRS+=" "$(unset SEARCH_DIRS; portageq envvar SEARCH_DIRS)
1044
#	SEARCH_DIRS_MASK+=" "$(unset SEARCH_DIRS_MASK; portageq envvar SEARCH_DIRS_MASK)
1126
#	SEARCH_DIRS_MASK+=" "$(unset SEARCH_DIRS_MASK; portageq envvar SEARCH_DIRS_MASK)
1045
#	LD_LIBRARY_MASK+=" "$(unset LD_LIBRARY_MASK; portageq envvar LD_LIBRARY_MASK)
1127
#	LD_LIBRARY_MASK+=" "$(unset LD_LIBRARY_MASK; portageq envvar LD_LIBRARY_MASK)
1046
1128
1047
	# Add the defaults
1129
	# Add the defaults
1048
	if [[ -d /etc/revdep-rebuild ]]; then
1130
	if [[ -d $EPREFIX/etc/revdep-rebuild ]]; then
1049
		for configfile in /etc/revdep-rebuild/*; do
1131
		for configfile in $EPREFIX/etc/revdep-rebuild/*; do
1050
			SEARCH_DIRS+=" "$(. $configfile; echo $SEARCH_DIRS)
1132
			SEARCH_DIRS+=" "$(. $configfile; echo $SEARCH_DIRS)
1051
			SEARCH_DIRS_MASK+=" "$(. $configfile; echo $SEARCH_DIRS_MASK)
1133
			SEARCH_DIRS_MASK+=" "$(. $configfile; echo $SEARCH_DIRS_MASK)
1052
			LD_LIBRARY_MASK+=" "$(. $configfile; echo $LD_LIBRARY_MASK)
1134
			LD_LIBRARY_MASK+=" "$(. $configfile; echo $LD_LIBRARY_MASK)
1053
		done
1135
		done
1054
	else
1136
	else
1055
		SEARCH_DIRS+=" /bin /sbin /usr/bin /usr/sbin /lib* /usr/lib*"
1137
		SEARCH_DIRS+=" $EPREFIX/bin $EPREFIX/sbin $EPREFIX/usr/bin $EPREFIX/usr/sbin $EPREFIX/lib* $EPREFIX/usr/lib*"
1056
		SEARCH_DIRS_MASK+=" /opt/OpenOffice /usr/lib/openoffice"
1138
		SEARCH_DIRS_MASK+=" $EPREFIX/opt/OpenOffice $EPREFIX/usr/lib/openoffice"
1057
		LD_LIBRARY_MASK+=" libodbcinst.so libodbc.so libjava.so libjvm.so"
1139
		LD_LIBRARY_MASK+=" libodbcinst.so libodbc.so libjava.so libjvm.so"
1058
	fi
1140
	fi
1059
1141
1060
	# Get the ROOTPATH and PATH from /etc/profile.env
1142
	# Get the ROOTPATH and PATH from $EPREFIX/etc/profile.env
1061
	if [[ -r "/etc/profile.env" && -s "/etc/profile.env" ]]; then
1143
	if [[ -r "$EPREFIX/etc/profile.env" && -s "$EPREFIX/etc/profile.env" ]]; then
1062
		SEARCH_DIRS+=" "$(. /etc/profile.env; /usr/bin/tr ':' ' ' <<< "$ROOTPATH $PATH")
1144
		SEARCH_DIRS+=" "$(. $EPREFIX/etc/profile.env; $EPREFIX/usr/bin/tr ':' ' ' <<< "$ROOTPATH $PATH")
1063
	fi
1145
	fi
1064
1146
1065
	# Get the directories from /etc/ld.so.conf
1147
	# Get the directories from /etc/ld.so.conf
1066
	if [[ -r /etc/ld.so.conf && -s /etc/ld.so.conf ]]; then
1148
	if [[ -r $EPREFIX/etc/ld.so.conf && -s $EPREFIX/etc/ld.so.conf ]]; then
1067
		SEARCH_DIRS+=" "$(sed '/^#/d;s/#.*$//' /etc/ld.so.conf)
1149
		SEARCH_DIRS+=" "$(sed '/^#/d;s/#.*$//' $EPREFIX/etc/ld.so.conf)
1068
	fi
1150
	fi
1069
1151
1070
	# Set the final variables
1152
	# Set the final variables

Return to bug 278081