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

Collapse All | Expand All

(-)/usr/bin/revdep-rebuild (-5 / +22 lines)
Lines 96-102 Link Here
96
then
96
then
97
	PRELIMINARY_SEARCH_DIRS="$PRELIMINARY_SEARCH_DIRS $((. /etc/profile.env; echo ${ROOTPATH}:${PATH}) | tr ':' ' ')"
97
	PRELIMINARY_SEARCH_DIRS="$PRELIMINARY_SEARCH_DIRS $((. /etc/profile.env; echo ${ROOTPATH}:${PATH}) | tr ':' ' ')"
98
fi
98
fi
99
100
# Get the directories from /etc/ld.so.conf
99
# Get the directories from /etc/ld.so.conf
101
if [ -e /etc/ld.so.conf ]
100
if [ -e /etc/ld.so.conf ]
102
then
101
then
Lines 386-395 Link Here
386
			echo /lib* /usr/lib* | sed 's/ /:/g'
385
			echo /lib* /usr/lib* | sed 's/ /:/g'
387
			sed '/^#/d;s/#.*$//' </etc/ld.so.conf
386
			sed '/^#/d;s/#.*$//' </etc/ld.so.conf
388
			sed 's:/[^/]*$::' <$LIST.1_files | sort -ru
387
			sed 's:/[^/]*$::' <$LIST.1_files | sort -ru
389
		) | tr '\n' : | tr -d '\r' | sed 's/:$//' >$LIST.2_ldpath
388
		) | split -d --suffix-length=1 --line-bytes=120000 - $LIST.2_split
390
		echo -e " done.\n  ($LIST.2_ldpath)"
389
		# we split the list up, for the unlikely event that it gets bigger than 
390
		# what the OS can handle for the argument size (typically 128kB on Linux)
391
		# Fixes Bug 137313
392
		i=0
393
		while [[ -f $LIST.2_split$i ]]
394
		do
395
			cat $LIST.2_split$i | tr '\n' : | tr -d '\r' | sed 's/:$//' >$LIST.2_ldpath$i
396
			COMPLETE_LD_LIBRARY_PATH$i="$(< $LIST.2_ldpath$i)" 2>/dev/null
397
			i=$((i+1))
398
		done
399
		
400
		echo -e " done.\n  ($LIST.2_ldpath*)"
391
	fi
401
	fi
392
	export COMPLETE_LD_LIBRARY_PATH="$(cat $LIST.2_ldpath)"
402
	#export COMPLETE_LD_LIBRARY_PATH="$(cat $LIST.2_ldpath)"
393
fi
403
fi
394
404
395
echo
405
echo
Lines 406-412 Link Here
406
	# with complete path (special add ons are rare).
416
	# with complete path (special add ons are rare).
407
	if ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" | $SONAME_GREP -q "$SONAME_SEARCH" ; then
417
	if ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" | $SONAME_GREP -q "$SONAME_SEARCH" ; then
408
		if $SEARCH_BROKEN ; then
418
		if $SEARCH_BROKEN ; then
409
			if LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH" ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" | $SONAME_GREP -q "$SONAME_SEARCH" ; then
419
			i=0
420
			# perform the checking until we either run out of COMPLETE_LD_LIBRARY_PATH's, or the file has everything
421
			while [[ -n COMPLETE_LD_LIBRARY_PATH$i && $(LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH$i" ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" | $SONAME_GREP -q "$SONAME_SEARCH") ]]
422
			do
423
				i=$((i+1))
424
			done
425
			# if we ran out of COMPLETE_LD_LIBRARY_PATH's, then the file truly misses something
426
			if [[ -z COMPLETE_LD_LIBRARY_PATH$i ]] ; then
410
				# FIX: I hate duplicating code
427
				# FIX: I hate duplicating code
411
				# Only build missing direct dependencies
428
				# Only build missing direct dependencies
412
				ALL_MISSING_LIBS=$(ldd "$FILE" 2>/dev/null | sort -u | sed -n 's/	\(.*\) => not found/\1/p' | tr '\n' ' ' | sed 's/ $//' )
429
				ALL_MISSING_LIBS=$(ldd "$FILE" 2>/dev/null | sort -u | sed -n 's/	\(.*\) => not found/\1/p' | tr '\n' ' ' | sed 's/ $//' )

Return to bug 137313