Fix revdep-rebuild to ignore libraries in LD_LIBRARY_MASK, when checking for "no...
authorfuzzyray <fuzzyray@gentoo.org>
Fri, 14 Sep 2007 17:52:12 +0000 (17:52 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Fri, 14 Sep 2007 17:52:12 +0000 (17:52 -0000)
svn path=/; revision=439

trunk/src/revdep-rebuild/revdep-rebuild-rewrite

index 6d622e2d5ff555da0c26746f55ee78fd3e100630..947234c2a7332aa850034285409c551d03cbd4d9 100755 (executable)
@@ -208,6 +208,7 @@ get_args() {
                        ;;
                -P|--no-progress)
                        progress() { :; }
+                       ;;
                -q|--quiet)
                        echo_v() { :; }
                        progress() { :; }
@@ -583,15 +584,19 @@ main_checks() {
                done
                if [[ $SEARCH_BROKEN ]]; then
                        # Look for missing version
-                       for target_file in $(
-                               awk '/no version information available/{
+                       while read target_file; do
+                               echo "obj $target_file" >> "$LIST.3_rebuild"
+                               echo_v "  broken $target_file (no version information available)"
+                       done < <(
+                               awk -v ldmask="($LD_LIBRARY_MASK)" '
+                                       BEGIN{ gsub(/\n/, "|", ldmask) }
+                                       /no version information available/{
                                        gsub("[()]", "", $NF);
+                                               if (seen[$NF]++)  next;
+                                               if ($NF ~ ldmask) next;
                                        print $NF
-                               }' "$LIST.3_ldd_errors" | sort -u
+                                       }' "$LIST.3_ldd_errors"
                        ); do
-                               echo "obj $target_file" >> "$LIST.3_rebuild"
-                               echo_v "  broken $target_file (no version information available)"
-                       done
                fi
                [[ -r $LIST.3_rebuild && -s $LIST.3_rebuild ]] || clean_exit
                einfo "Generated new $LIST.3_rebuild"