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

Collapse All | Expand All

(-)revdep-rebuild.sh_ (-9 / +19 lines)
Lines 235-243 Link Here
235
# Replace whitespace with linebreaks, normalize repeated '/' chars, and sort -u
235
# Replace whitespace with linebreaks, normalize repeated '/' chars, and sort -u
236
# (If any libs have whitespace in their filenames, someone needs punishment.)
236
# (If any libs have whitespace in their filenames, someone needs punishment.)
237
clean_var() {
237
clean_var() {
238
	gawk 'BEGIN         {RS="[[:space:]]"}
238
	awk '
239
	     /-\*/         {exit}
239
		BEGIN {FS = "[[:space:]]"}
240
	     /[^[:space:]]/ {gsub(/\/\/+/, "/"); print}' | sort -u
240
241
		{
242
			for(i = 1; i <= NF; ++i) {
243
				if($i ~ /-\*/)
244
					exit
245
				else if($i){
246
					gsub(/\/\/+/, "/", $i)
247
					print $i
248
				}
249
			}
250
		}' | sort -u
241
}
251
}
242
##
252
##
243
# Exit and optionally output to sterr
253
# Exit and optionally output to sterr
Lines 805-812 Link Here
805
					# Look for symbol not defined errors
815
					# Look for symbol not defined errors
806
					if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
816
					if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
807
						grep -q -E 'symbol .* not defined'; then
817
						grep -q -E 'symbol .* not defined'; then
808
						message=$(gawk '/symbol .* not defined/ {NF--; print $0}' <<< "$ldd_output")
818
						message=$(awk '/symbol .* not defined/ {ORS = FS; for(i = 1; i < NF; ++i} print $i; printf "\n"}' <<< "$ldd_output")
809
						broken_lib=$(gawk '/symbol .* not defined/ {print $NF}' <<< "$ldd_output" | \
819
						broken_lib=$(awk '/symbol .* not defined/ {print $NF}' <<< "$ldd_output" | \
810
							sed 's/[()]//g')
820
							sed 's/[()]//g')
811
						echo "obj $broken_lib" >> "$BROKEN_FILE"
821
						echo "obj $broken_lib" >> "$BROKEN_FILE"
812
						echo_v "  broken $broken_lib ($message)"
822
						echo_v "  broken $broken_lib ($message)"
Lines 820-826 Link Here
820
					*)
830
					*)
821
						if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
831
						if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" |
822
							grep -q -F 'undefined symbol:'; then
832
							grep -q -F 'undefined symbol:'; then
823
							message=$(gawk '/undefined symbol:/ {print $3}' <<< "$ldd_output")
833
							message=$(awk '/undefined symbol:/ {print $3}' <<< "$ldd_output")
824
							message="${message//$'\n'/ }"
834
							message="${message//$'\n'/ }"
825
							echo "obj $target_file" >> "$BROKEN_FILE"
835
							echo "obj $target_file" >> "$BROKEN_FILE"
826
							echo_v "  broken $target_file (undefined symbols(s): $message)"
836
							echo_v "  broken $target_file (undefined symbols(s): $message)"
Lines 835-841 Link Here
835
				la_broken=""
845
				la_broken=""
836
				la_lib=""
846
				la_lib=""
837
				for depend in $(
847
				for depend in $(
838
					gawk -F"[=']" '/^dependency_libs/{
848
					awk -F"[=']" '/^dependency_libs/{
839
						print $3
849
						print $3
840
					}' "$target_file"
850
					}' "$target_file"
841
				); do
851
				); do
Lines 876-882 Link Here
876
			done < <(
886
			done < <(
877
				# Regexify LD_LIBRARY_MASK. Exclude it from the search.
887
				# Regexify LD_LIBRARY_MASK. Exclude it from the search.
878
				LD_LIBRARY_MASK="${LD_LIBRARY_MASK//$'\n'/|}"
888
				LD_LIBRARY_MASK="${LD_LIBRARY_MASK//$'\n'/|}"
879
				gawk -v ldmask="(${LD_LIBRARY_MASK//./\\\\.})" '
889
				awk -v ldmask="(${LD_LIBRARY_MASK//./\\\\.})" '
880
					/no version information available/ && $0 !~ ldmask {
890
					/no version information available/ && $0 !~ ldmask {
881
						gsub(/[()]/, "", $NF)
891
						gsub(/[()]/, "", $NF)
882
						if (seen[$NF]++)  next
892
						if (seen[$NF]++)  next
Lines 1068-1074 Link Here
1068
		ewarn "The broken files are:"
1078
		ewarn "The broken files are:"
1069
		while read filename junk; do
1079
		while read filename junk; do
1070
			[[ $junk = *none* ]] && ewarn "  $filename"
1080
			[[ $junk = *none* ]] && ewarn "  $filename"
1071
		done < "$OWNERS_FILE" | gawk '!s[$0]++' # (omit dupes)
1081
		done < "$OWNERS_FILE" | awk '!s[$0]++' # (omit dupes)
1072
	fi
1082
	fi
1073
}
1083
}
1074
1084

Return to bug 652078