[fedora-java] proposed rebuild-gcj-db patch

Tom Tromey tromey at redhat.com
Fri Jan 20 23:43:32 UTC 2006


We've had a problem on multiarch hosts where the gcj shared library
caches weren't being updated properly, causing programs to run
interpreted instead.

This patch works around the problem by looping over all the databases
it can find.

Comments?  I'd particularly like to hear from Tom (Fitzsimmons), and
Gary...

Tom

Index: ChangeLog
from  Tom Tromey  <tromey at redhat.com>

	* rebuild-gcj-db.in: Loop over /usr/lib*.

Index: rebuild-gcj-db.in
===================================================================
RCS file: /cvs/rhug/java-gcj-compat/rebuild-gcj-db.in,v
retrieving revision 1.7
diff -u -r1.7 rebuild-gcj-db.in
--- rebuild-gcj-db.in 16 Nov 2005 00:09:50 -0000 1.7
+++ rebuild-gcj-db.in 20 Jan 2006 23:44:24 -0000
@@ -13,8 +13,16 @@
     fi
 fi
 
-dbLocation=`@GCJ_BIN_DIR@/gcj-dbtool at gcc_suffix@ -p @LIBDIR@`
-dirname $dbLocation | xargs mkdir -p
- at GCJ_BIN_DIR@/gcj-dbtool at gcc_suffix@ -n $dbLocation 64
-find $dbLocation.d @LIBDIR@/gcj -follow -name '*.db' -print0 | \
-    xargs -0 @GCJ_BIN_DIR@/gcj-dbtool at gcc_suffix@ -m $dbLocation $dbLocation
+# Rebuild all the standard databases.
+for base in /usr/lib*; do
+   dbLocation=`@GCJ_BIN_DIR@/gcj-dbtool at gcc_suffix@ -p $base`
+   libdir=$base/gcj
+   if ! test -d $dbLocation.d && ! test -d $libdir; then
+      # No shared libraries here.
+      continue
+   fi
+   dirname $dbLocation | xargs mkdir -p
+   @GCJ_BIN_DIR@/gcj-dbtool at gcc_suffix@ -n $dbLocation 64
+   find $dbLocation.d $libdir -follow -name '*.db' -print0 | \
+      xargs -0 @GCJ_BIN_DIR@/gcj-dbtool at gcc_suffix@ -m $dbLocation $dbLocation
+done




More information about the fedora-devel-java-list mailing list