Updated fix for revdep-rebuild to ignore libraries in LD_LIBRARY_MASK, when checking...
authorfuzzyray <fuzzyray@gentoo.org>
Tue, 18 Sep 2007 21:19:06 +0000 (21:19 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Tue, 18 Sep 2007 21:19:06 +0000 (21:19 -0000)
svn path=/; revision=441

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

index aa01e1c05f02e612018b588ffa9339f4af31e708..a62257beb1e17bd7df6a4587bd894cf1d76a93f9 100755 (executable)
@@ -510,6 +510,7 @@ main_checks() {
        else
                [[ $LIST ]] || die 1 "$LIST" 'is undefined! (This is a bug.)'
                set_trap "$LIST.3_rebuild"
+               set_trap "$LIST.3_ldd_errors"
                rm -f "$LIST.3"*
                files=($(<"$LIST.1_files"))
                numFiles="${#files[@]}"
@@ -588,13 +589,13 @@ main_checks() {
                                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 ($0 ~ ldmask) next;
-                                       print $NF
+                               # Regexify LD_LIBRARY_MASK. Exclude it from the search.
+                               LD_LIBRARY_MASK="${LD_LIBRARY_MASK//$'\n'/|}"
+                               awk -v ldmask="(${LD_LIBRARY_MASK//./\\\.})" '
+                                       /no version information available/ && $0 !~ ldmask {
+                                               gsub(/[()]/, "", $NF)
+                                               if (seen[$NF]++)  next
+                                               print $NF
                                        }' "$LIST.3_ldd_errors"
                        )
                fi