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

(-)/usr/bin/revdep-rebuild (-28 / +7 lines)
Lines 21-26 Link Here
21
21
22
# Mask of specially evaluated libraries (exactly one space separated).
22
# Mask of specially evaluated libraries (exactly one space separated).
23
LD_LIBRARY_MASK="libodbcinst.so libodbc.so libjava.so libjvm.so"
23
LD_LIBRARY_MASK="libodbcinst.so libodbc.so libjava.so libjvm.so"
24
# Mask of specially evaluated directory (exactly one space separated).
25
DIR_FIND_MASK="/opt/Acrobat7/Reader/intellinux /usr/share/fonts /usr/local/fonts /opt/OpenOffice.org"
26
DIR_MASK=$(echo "$DIR_FIND_MASK" | sed 's/ / -e /g')
24
27
25
# List of directories to be searched (feel free to edit it)
28
# List of directories to be searched (feel free to edit it)
26
# Note /usr/libexec and /usr/local/subprefix cotradicts FHS, but are present
29
# Note /usr/libexec and /usr/local/subprefix cotradicts FHS, but are present
Lines 146-172 Link Here
146
	echo " using existing $LIST.1_files."
149
	echo " using existing $LIST.1_files."
147
else
150
else
148
	set_trap "$LIST.1_files"
151
	set_trap "$LIST.1_files"
149
	find $SEARCH_DIRS -type f \( -perm +u+x -o -name '*.so' -o -name '*.so.*' \) 2>/dev/null >$LIST.1_files
152
	find $SEARCH_DIRS -type f \( -perm +u+x -o -name '*.so' -o -name '*.so.*' \) 2>/dev/null | grep -v -e $DIR_MASK >$LIST.1_files
150
	echo -e " done.\n  ($LIST.1_files)"
153
	echo -e " done.\n  ($LIST.1_files)"
151
fi
154
fi
152
155
153
if $SEARCH_BROKEN ; then
154
	echo
155
	echo -n -e "${GR}Collecting complete LD_LIBRARY_PATH...${NO}"
156
	if [ -f $LIST.2_ldpath ] ; then
157
	echo " using existing $LIST.2_ldpath."
158
	else
159
	set_trap "$LIST.2_ldpath"
160
	(
161
		grep '.*\.so\(\|\..*\)$' <$LIST.1_files | sed 's:/[^/]*$::'
162
		sed '/^#/d;s/#.*$//' </etc/ld.so.conf
163
	) | sort -u |
164
	tr '\n' : | tr -d '\r' | sed 's/:$//' >$LIST.2_ldpath
165
	echo -e " done.\n  ($LIST.2_ldpath)"
166
	fi
167
	export COMPLETE_LD_LIBRARY_PATH="$(cat $LIST.2_ldpath)"
168
fi
169
170
echo
156
echo
171
echo -n -e "${GR}Checking dynamic linking$WORKING_TEXT...${NO}"
157
echo -n -e "${GR}Checking dynamic linking$WORKING_TEXT...${NO}"
172
if [ -f $LLIST.3_rebuild ] ; then
158
if [ -f $LLIST.3_rebuild ] ; then
Lines 177-197 Link Here
177
	LD_MASK="\\(	$(echo "$LD_LIBRARY_MASK" | sed 's/\./\\./g;s/ / \\|	/g') \\)"
163
	LD_MASK="\\(	$(echo "$LD_LIBRARY_MASK" | sed 's/\./\\./g;s/ / \\|	/g') \\)"
178
	echo -n >$LLIST.3_rebuild
164
	echo -n >$LLIST.3_rebuild
179
	cat $LIST.1_files | while read FILE ; do
165
	cat $LIST.1_files | while read FILE ; do
180
	# Note: double checking seems to be faster than single
181
	# with complete path (special add ons are rare).
182
	if ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" |
166
	if ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" |
183
		$SONAME_GREP -q "$SONAME_SEARCH" ; then
167
		$SONAME_GREP -q "$SONAME_SEARCH" ; then
184
		if $SEARCH_BROKEN ; then
168
		if $SEARCH_BROKEN ; then
185
		if LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH" \
169
			echo_v "  broken $FILE (requires $(ldd "$FILE" 2>/dev/null | sed -n 's/	\(.*\) => not found$/\1/p' | tr '\n' ' ' | sed 's/ $//' ))"
186
		ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" |
187
			$SONAME_GREP -q "$SONAME_SEARCH" ; then
188
			echo "$FILE" >>$LLIST.3_rebuild
189
			echo_v "  broken $FILE (requires $(ldd "$FILE" | sed -n 's/	\(.*\) => not found$/\1/p' | tr '\n' ' ' | sed 's/ $//' ))"
190
		fi
191
		else
170
		else
192
		echo "$FILE" >>$LLIST.3_rebuild
171
			echo_v "  found $FILE"
193
		echo_v "  found $FILE"
194
		fi
172
		fi
173
		echo "$FILE" >>$LLIST.3_rebuild
195
	fi
174
	fi
196
	done
175
	done
197
	echo -e " done.\n  ($LLIST.3_rebuild)"
176
	echo -e " done.\n  ($LLIST.3_rebuild)"

Return to bug 58346