From: idl0r Date: Thu, 10 Dec 2009 21:37:38 +0000 (-0000) Subject: Workaround for bug 280341. X-Git-Tag: gentoolkit-0.3.0_rc10~34 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=16da0963b0ebd16638cb39209435d9b894553a29;p=gentoolkit.git Workaround for bug 280341. Use maxcount option for grep when looking for file owner. svn path=/trunk/gentoolkit/; revision=717 --- diff --git a/bin/revdep-rebuild b/bin/revdep-rebuild index aa96667..d32e4e1 100755 --- a/bin/revdep-rebuild +++ b/bin/revdep-rebuild @@ -263,16 +263,20 @@ clean_exit() { # NOTE: depends on app-misc/realpath! get_file_owner() { local IFS=$'\n' - # 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 -e "${*} " -e "${rpath} " | + # Workaround for bug 280341 + mlib=$(echo ${*}|sed 's:/lib/:/lib64/:') + [[ "${*}" == "${mlib}" ]] && mlib=$(echo ${*}|sed 's:/lib64/:/lib/:') + + # 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} ". + find /var/db/pkg -type f -name CONTENTS -print0 | + xargs -0 grep -m 1 -Fl -e "${*} " -e "${rpath} " -e "${mlib} " | sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:' } ##