view libinterp/find-defun-files.sh @ 20515:ad7fe3cb6fd2

pkg: fix regression on output of pkg list (bug #45873) * scripts/pkg/pkg.m: cset 7fa1970a655d reduced the checks to nargout to is there nargout or not. However, the subfunction installed_packages() returns alternative things based on its own nargout (it probably should not since that makes for a messy code). Fix, pkg to call the subfunction correctly based on its nargout too (but still, use "nargout > 1" instead of "nargout == 2". * scripts/pkg/private/installed_packages.m: do not check for exact number of nargout and reduce number of function return points.
author Carnë Draug <carandraug@octave.org>
date Fri, 04 Sep 2015 18:47:54 +0100
parents 39096b290a2f
children
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|CMD|UN|UN_DLD|UNX_DLD|UN_TEXT)[ \t]*\\("

srcdir="$1"
shift

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