Apply patch to prevent false matches of object names. (Bug 196460)
authorfuzzyray <fuzzyray@gentoo.org>
Sat, 16 Feb 2008 21:04:19 +0000 (21:04 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Sat, 16 Feb 2008 21:04:19 +0000 (21:04 -0000)
svn path=/; revision=463

trunk/src/revdep-rebuild/revdep-rebuild

index 79699f3274223db4c6791edfe6fc1e5422af8515..7b0033df27c01860a39fbf83fad3b03f6e2f9ccd 100755 (executable)
@@ -274,8 +274,10 @@ get_args() {
        else
                get_file_owner() {
                        local IFS=$'\n'
+                       # ${*/%/ } adds a space to the end of each object name to prevent false
+                       # matches, for example /usr/bin/dia matching /usr/bin/dialog (bug #196460).
                        find -L /var/db/pkg -name CONTENTS -print0 |
-                               xargs -0 grep -Fl "$*" |
+                               xargs -0 grep -Fl "${*/%/ }" |
                                sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:'
                }
        fi