+2009-10-27: Christian Ruppert <idl0r@gentoo.org>
+ * revdep-rebuild: Use realpath in get_file_owner to be able to get the
+ package containing e.g. /lib/libreadline.so.6 on amd64, fixes bug 280341.
+
2009-10-27: Christian Ruppert <idl0r@gentoo.org>
* revdep-rebuild.1: Fix bug 281050, thanks to Jesús Guerrero
- <i92guboj@gentoo.org>.
+ <i92guboj@gentoo.org>.
2009-10-26: Christian Ruppert <idl0r@gentoo.org>
* euse: Don't add an additional new line at the end of file.
}
##
# Get the name of the package that owns a file or list of files given as args.
+# NOTE: depends on app-misc/realpath!
get_file_owner() {
local IFS=$'\n'
- # ${*/%/ } adds a space to the end of each object name to prevent false
+ # Add a space to the end of each object name to prevent false
# matches, for example /usr/bin/dia matching /usr/bin/dialog (bug #196460).
+ # The same for "${rpath} ".
+
+ rpath=$(realpath "${*}" 2>/dev/null)
+ # To ensure we always have something in rpath...
+ [[ -z $rpath ]] && rpath=${*}
+
find -L /var/db/pkg -name CONTENTS -print0 |
- xargs -0 grep -Fl "${*/%/ }" |
+ xargs -0 grep -Fl -e "${*} " -e "${rpath} " |
sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:'
}
##