mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-11 13:51:04 +08:00
59 lines
1.9 KiB
Bash
Executable File
59 lines
1.9 KiB
Bash
Executable File
#!/bin/sh
|
|
# List the specified version-controlled files.
|
|
|
|
# Copyright (C) 2006 Free Software Foundation, Inc.
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
# List the specified version-controlled files.
|
|
# With no argument, list them all.
|
|
# This script must be run solely from the top of a $srcdir build directory.
|
|
|
|
# If there's an argument, it must be a single, "."-relative directory name,
|
|
# with no trailing slashes. In mercurial mode, it's used as part of a
|
|
# "grep" pattern (prepend "^", append "/"), and in cvs mode, it's simply
|
|
# used as an argument to the cvsu script.
|
|
|
|
include_prefix=
|
|
case $# in
|
|
0) ;;
|
|
1) include_prefix=$1 ;;
|
|
*) echo "$0: too many arguments" 1>&2; exit 1 ;;
|
|
esac
|
|
|
|
if test -d .git; then
|
|
if test "x$include_prefix" = x; then
|
|
git-ls-files | cut -d ' ' -f 3
|
|
else
|
|
git-ls-files | cut -d ' ' -f 3 | grep "^$include_prefix/"
|
|
fi
|
|
elif test -d .hg; then
|
|
if test "x$include_prefix" = x; then
|
|
hg manifest | cut -d ' ' -f 3
|
|
else
|
|
hg manifest | cut -d ' ' -f 3 | grep "^$include_prefix/"
|
|
fi
|
|
elif test -x build-aux/cvsu; then
|
|
build-aux/cvsu --find --types=AFGM $include_prefix
|
|
else
|
|
awk -F/ '{ \
|
|
if (!$1 && $3 !~ /^-/) { \
|
|
f=FILENAME; \
|
|
sub(/CVS\/Entries/, "", f); \
|
|
print f $2; \
|
|
}}' \
|
|
$(find ${*-*} -name Entries -print) /dev/null;
|
|
fi
|