[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Rewrite split-for-gcj
From: |
Tom Tromey |
Subject: |
Re: [cp-patches] Rewrite split-for-gcj |
Date: |
14 Aug 2005 15:38:56 -0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>>>>> "Andrew" == Andrew Haley <address@hidden> writes:
Andrew> split-for-gcj takes an ungodly amount of time. This is about 20x
Andrew> faster. As far as I can see it does the same thing as the previous
Andrew> version.
Andrew> +BEGIN {
Andrew> + print "Splitting for gcj"
Andrew> + system ("rm -f Makefile.deps > /dev/null 2>&1")
Andrew> + system ("test -d lists || mkdir lists")
I'm not an awk expert by any stretch ... one important thing here is
to make sure the code remains portable. Any ideas on that?
Andrew> + # Only update a .list file if it changed.
Andrew> + system ("for file in lists/*.list.1; do " \
Andrew> + "real=`echo \"$file\" | sed -e 's/.1$//'`;" \
Andrew> + "if cmp -s $real $file; then " \
Andrew> + " rm $file; " \
Andrew> + "else " \
Andrew> + " mv $file $real; " \
Andrew> + "fi " \
Andrew> + "done")
Andrew> +}
Andrew> +
Maybe instead of long system calls we should just have an awk script
embedded in the original shell script. If this is know to be
portable, though, then it is fine by me.
Tom