Mercurial > octave
annotate libinterp/find-defun-files.sh @ 21277:1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
* mk-octave-config-h.sh: Keep if-then on a single line.
* move-if-change: Insert a space in interpreter directive for consistency.
* build-env-features.sh, config-images.sh, config-module.sh, config-ops.sh,
find-defun-files.sh, find-files-with-tests.sh, mk-errno-list,
libinterp/mk-pkg-add, scripts/mk-pkg-add, mkbuiltins, mkdefs, mkdocs,
mkf77def.in, mkops: Initialize environment variable defaults consistently.
Use shift only when the argument list is not empty. Remove unnecessary
quotes and semicolons on variable assignments. Insert/remove blank lines for
consistency.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Tue, 16 Feb 2016 18:36:00 -0800 |
parents | 3b4bb843ffcd |
children | 112b20240c87 |
rev | line source |
---|---|
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 #! /bin/sh |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 set -e |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21276
diff
changeset
|
4 |
10016
3275dda012f7
find-defun-files.sh: use sed and egrep as found by configure
Rob Mahurin <octave@tertiarysource.net>
parents:
9906
diff
changeset
|
5 SED=${SED:-sed} |
3275dda012f7
find-defun-files.sh: use sed and egrep as found by configure
Rob Mahurin <octave@tertiarysource.net>
parents:
9906
diff
changeset
|
6 EGREP=${EGREP:-egrep} |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 # Some stupid egreps don't like empty elements in alternation patterns, |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 # so we have to repeat ourselves because some stupid egreps don't like |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 # empty elements in alternation patterns. |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 DEFUN_PATTERN="^[ \t]*DEF(CONSTFUN|CMD|UN|UN_DLD|UNX_DLD|UN_TEXT)[ \t]*\\(" |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 srcdir="$1" |
21277
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21276
diff
changeset
|
15 if [ "$1" ]; then |
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21276
diff
changeset
|
16 shift |
1bca6c72d2b1
maint: Use consistent coding style for build helper shell scripts
Mike Miller <mtmiller@octave.org>
parents:
21276
diff
changeset
|
17 fi |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 for arg |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 do |
9906 | 21 if [ -f "$arg" ]; then |
22 file="$arg" | |
23 else | |
24 file="$srcdir/$arg" | |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 fi |
21276
3b4bb843ffcd
maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents:
16174
diff
changeset
|
26 if [ -f "$file" ]; then |
3b4bb843ffcd
maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents:
16174
diff
changeset
|
27 if [ "`$EGREP -l "$DEFUN_PATTERN" $file`" ]; then |
3b4bb843ffcd
maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents:
16174
diff
changeset
|
28 echo "$file" | $SED "s,\\$srcdir/,," | $SED 's/\.cc$/.df/; s/\.ll$/.df/; s/\.in.yy$/.df/' |
3b4bb843ffcd
maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents:
16174
diff
changeset
|
29 fi |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 fi |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 done |