Hi Thierry again

Thanks a lot for sending this through!

It's one call of sed and that's it, so that's cool. However running it,
we get e.g. for 'ldd /bin/grep'):

libc.so.6 /lib/tls/libc.so.6
/lib/ld-linux.so.2 /lib/ld-linux.so.2

which means that things appear effectively twice for every row.

The attached new patch mindi_patch_BTS324302_v5.diff makes it look like
this:

libc.so.6
/lib/ld-linux.so.2

Also, the latest patch tries to precisely address the different
situations we may encounter:

'[[:blank:]]*.*[[:blank:]]*=>[[:blank:]]*(.*/d' just get's rid of things
that are just in the kernel, i.e. point to a hex address.

's/[[:blank:]]*\(.*\)[[:blank:]]*=>[[:blank:]]*\/.*/\1/' deals with
normal library lines and ld-linux under old libc6.

's/[[:blank:]]*\(\/.*\)[[:blank:]]*(.*/\1/' handles ld-linux under new
libc6.

What do you think?

Finally, could you repeat once again what the exact circumstances are
for which first patch doesn't work? I know, I'm a pain. The thing is
that the patch is actually suggested by other people as well and it is
relatively short and elegant. All good reasons to use it. But if it
doesn't work, we have to do something else...

Cheers
Andree


On Sat, 2005-10-08 at 01:02 +0200, thierry lathuille wrote:
> Hello,
> 
> So, here is the same patch, where I replaced the small pipes with only one 
> sed 
> invocation. 
> Still easy to read... ;-)
> 
> Thierry
-- 
Andree Leidenfrost
Sydney - Australia

--- mindi-1.04.orig/mindi
+++ mindi-1.04/mindi
@@ -2252,17 +2265,13 @@
     main_fname=$1
     read incoming
     while [ "$incoming" != "" ] ; do
-	incoming=`echo "$incoming" | tr -s ' ' '\t'`
-	i=`echo "$incoming" | cut -f2`
-	if [ "$i" = "=>" ] ; then
-# was cut -f1,3
-	    for fname in `echo "$incoming" | cut -f1,3` ; do
-		fname=`LocateFile $fname`
-		for f in $fname ; do
-		    [ -e "$f" ] && echo $f
-		done
+	incoming=`echo "$incoming" | sed '/[[:blank:]]*.*[[:blank:]]*=>[[:blank:]]*(.*/d ; s/[[:blank:]]*\(.*\)[[:blank:]]*=>[[:blank:]]*\/.*/\1/ ; s/[[:blank:]]*\(\/.*\)[[:blank:]]*(.*/\1/'`
+	for fname in `echo "$incoming"` ; do
+	    fname=`LocateFile $fname`
+	    for f in $fname ; do
+		[ -e "$f" ] && echo $f
 	    done
-	fi
+	done
 	read incoming
     done
 }

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to