From afd74c21a75ef7350a66235910032ed5ce570bc9 Mon Sep 17 00:00:00 2001 From: idl0r Date: Wed, 28 Oct 2009 20:48:11 +0000 Subject: [PATCH] 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. svn path=/trunk/gentoolkit/; revision=696 --- ChangeLog | 6 +++++- bin/revdep-rebuild | 11 +++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5afdd6..955a1ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ +2009-10-27: Christian Ruppert + * 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 * revdep-rebuild.1: Fix bug 281050, thanks to Jesús Guerrero - . + . 2009-10-26: Christian Ruppert * euse: Don't add an additional new line at the end of file. diff --git a/bin/revdep-rebuild b/bin/revdep-rebuild index b44dadc..b6d4eed 100755 --- a/bin/revdep-rebuild +++ b/bin/revdep-rebuild @@ -252,12 +252,19 @@ clean_exit() { } ## # 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:' } ## -- 2.26.2