[commit] Handle duplicates when generating init.c

Andrew Cagney cagney@gnu.org
Sun Feb 8 21:52:00 GMT 2004


Hello,

(peters noticed init.c was now getting duplicates)
This patch cleans up the SH generating init.c thus:

To eliminates duplicates it uses the classic SH hack:
+       while read f; do \
+           case "$$fs" in \
+               "* $$f *") ;; \
+               *) echo $$f ; fs="$$fs $$f ";; \
+            esac; \
+       done >> init.l-tmp

To keep the length of "$fs" in the above short, and eliminate a grep, it 
strips each filename back to FOO (from _initialize_FOO):
+       while read f; do \
+           sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' $$f 
2>/dev/null;
  \
+       done | \
A second grep+echo is removed by using the inital sed to strip it out.

Finally, so that understanding the problem is easier, I've eliminates a 
redundant level of indirection (via $(OBS)), and moved the macros that 
caused the redirection to a more obvious location.

committed,
Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20040208/1ce94fa9/attachment.ksh>


More information about the Gdb-patches mailing list