view build-aux/find-defun-files.sh @ 22761:708a4fcb7382 stable release-4-2-0

Version 4.2.0 released. * configure.ac: Bump version to 4.2.0. (OCTAVE_PATCH_VERSION): Set to 0. (OCTAVE_RELEASE_DATE): Update.
author John W. Eaton <jwe@octave.org>
date Sun, 13 Nov 2016 10:20:59 -0500
parents 6119019d42f6
children 592fa741e0aa
line wrap: on
line source

#! /bin/sh

set -e

SED=${SED:-sed}
EGREP=${EGREP:-egrep}

# Some stupid egreps don't like empty elements in alternation patterns,
# so we have to repeat ourselves because some stupid egreps don't like
# empty elements in alternation patterns.

DEFUN_PATTERN="^[ \t]*DEF(CONSTFUN|UN|UN_DLD|UNX|UNX_DLD)[ \t]*\\("

srcdir="$1"
if [ "$1" ]; then
  shift
fi

for arg
do
  if [ -f "$arg" ]; then
    file="$arg"
  else
    file="$srcdir/$arg"
  fi
  if [ -f "$file" ]; then
    if [ "`$EGREP -l "$DEFUN_PATTERN" $file`" ]; then
      echo "$file" | $SED "s,\\$srcdir/,,"
    fi
  fi
done