From: Tormod Volden <debian.tor...@gmail.com>

Saves forking an expr for every object.

Signed-off-by: Tormod Volden <debian.tor...@gmail.com>
---

On Thu, Apr 30, 2009 at 8:37 AM, Tormod Volden wrote:
> Dan Nicholson wrote:
>> Is there any reason not to just use a case statement instead of forking expr?
>
> No, that was just copied from another part of the script.

And to save the trees, here is an additional patch to fix the part I had copied 
from.

Cheers,
Tormod

--

 bin/mklib |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/bin/mklib b/bin/mklib
index 86aa80f..6331f5a 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -279,18 +279,21 @@ case $ARCH in
            # expand any .a objects into constituent .o files.
            NEWOBJECTS=""
            DELETIA=""
-           for OBJ in ${OBJECTS} ; do
-               if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then
-                   # extract the .o files from this .a archive
-                   FILES=`ar t $OBJ`
-                   ar x $OBJ
-                   NEWOBJECTS="$NEWOBJECTS $FILES"
-                   # keep track of temporary .o files and delete them below
-                   DELETIA="$DELETIA $FILES"
-               else
-                   # ordinary .o file
-                   NEWOBJECTS="$NEWOBJECTS $OBJ"
-               fi
+           for OBJ in $OBJECTS ; do
+               case $OBJ in
+                   *.a)
+                       # extract the .o files from this .a archive
+                       FILES=`ar t $OBJ`
+                       ar x $OBJ
+                       NEWOBJECTS="$NEWOBJECTS $FILES"
+                       # keep track of temporary .o files and delete them below
+                       DELETIA="$DELETIA $FILES"
+                       ;;
+                   *)
+                       # ordinary .o file
+                       NEWOBJECTS="$NEWOBJECTS $OBJ"
+                       ;;
+               esac
            done
 
             # make lib
-- 
1.6.0.4


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to