Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoolkit r696 - in trunk/gentoolkit: . bin
Date: Wed, 28 Oct 2009 20:48:18
Message-Id: E1N3FRE-00069q-0s@stork.gentoo.org
1 Author: idl0r
2 Date: 2009-10-28 20:48:11 +0000 (Wed, 28 Oct 2009)
3 New Revision: 696
4
5 Modified:
6 trunk/gentoolkit/ChangeLog
7 trunk/gentoolkit/bin/revdep-rebuild
8 Log:
9 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.
10
11
12 Modified: trunk/gentoolkit/ChangeLog
13 ===================================================================
14 --- trunk/gentoolkit/ChangeLog 2009-10-27 18:44:33 UTC (rev 695)
15 +++ trunk/gentoolkit/ChangeLog 2009-10-28 20:48:11 UTC (rev 696)
16 @@ -1,6 +1,10 @@
17 2009-10-27: Christian Ruppert <idl0r@g.o>
18 + * revdep-rebuild: Use realpath in get_file_owner to be able to get the
19 + package containing e.g. /lib/libreadline.so.6 on amd64, fixes bug 280341.
20 +
21 +2009-10-27: Christian Ruppert <idl0r@g.o>
22 * revdep-rebuild.1: Fix bug 281050, thanks to Jesús Guerrero
23 - <i92guboj@g.o>.
24 + <i92guboj@g.o>.
25
26 2009-10-26: Christian Ruppert <idl0r@g.o>
27 * euse: Don't add an additional new line at the end of file.
28
29 Modified: trunk/gentoolkit/bin/revdep-rebuild
30 ===================================================================
31 --- trunk/gentoolkit/bin/revdep-rebuild 2009-10-27 18:44:33 UTC (rev 695)
32 +++ trunk/gentoolkit/bin/revdep-rebuild 2009-10-28 20:48:11 UTC (rev 696)
33 @@ -252,12 +252,19 @@
34 }
35 ##
36 # Get the name of the package that owns a file or list of files given as args.
37 +# NOTE: depends on app-misc/realpath!
38 get_file_owner() {
39 local IFS=$'\n'
40 - # ${*/%/ } adds a space to the end of each object name to prevent false
41 + # Add a space to the end of each object name to prevent false
42 # matches, for example /usr/bin/dia matching /usr/bin/dialog (bug #196460).
43 + # The same for "${rpath} ".
44 +
45 + rpath=$(realpath "${*}" 2>/dev/null)
46 + # To ensure we always have something in rpath...
47 + [[ -z $rpath ]] && rpath=${*}
48 +
49 find -L /var/db/pkg -name CONTENTS -print0 |
50 - xargs -0 grep -Fl "${*/%/ }" |
51 + xargs -0 grep -Fl -e "${*} " -e "${rpath} " |
52 sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:'
53 }
54 ##