Do not pass top_srcdir to configure scripts in testsuite.
[autoconf.git] / build-aux / vc-list-files
blob903224475ef7829ca6e8dd4c007078a2d0704034
1 #!/bin/sh
2 # List the specified version-controlled files.
4 # Copyright (C) 2006 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # List the specified version-controlled files.
21 # With no argument, list them all.
22 # This script must be run solely from the top of a $srcdir build directory.
24 # If there's an argument, it must be a single, "."-relative directory name,
25 # with no trailing slashes. In mercurial mode, it's used as part of a
26 # "grep" pattern (prepend "^", append "/"), and in cvs mode, it's simply
27 # used as an argument to the cvsu script.
29 include_prefix=
30 case $# in
31 0) ;;
32 1) include_prefix=$1 ;;
33 *) echo "$0: too many arguments" 1>&2; exit 1 ;;
34 esac
36 if test -d .git; then
37 if test "x$include_prefix" = x; then
38 git-ls-files | cut -d ' ' -f 3
39 else
40 git-ls-files | cut -d ' ' -f 3 | grep "^$include_prefix/"
42 elif test -d .hg; then
43 if test "x$include_prefix" = x; then
44 hg manifest | cut -d ' ' -f 3
45 else
46 hg manifest | cut -d ' ' -f 3 | grep "^$include_prefix/"
48 elif test -x build-aux/cvsu; then
49 build-aux/cvsu --find --types=AFGM $include_prefix
50 else
51 awk -F/ '{ \
52 if (!$1 && $3 !~ /^-/) { \
53 f=FILENAME; \
54 sub(/CVS\/Entries/, "", f); \
55 print f $2; \
56 }}' \
57 $(find ${*-*} -name Entries -print) /dev/null;