Avoid comma operator warnings.
[jlayton/glibc.git] / scripts / list-sources.sh
1 #!/bin/sh
2 #
3 # List all the files under version control in the source tree.
4 #
5
6 case $# in
7 0) ;;
8 1) cd "$1" ;;
9 *) echo >&2 "Usage: $0 [top_srcdir]"; exit 2 ;;
10 esac
11
12 if [ -r .git/HEAD ]; then
13
14   # List files for glibc core.
15   ${GIT:-git} ls-files
16   # List files for glibc ports.
17   ports="ports"
18   if [ -d "$PWD/$ports" ]; then
19     cd "$PWD/$ports"
20     ${GIT:-git} ls-files | sed -e "s,^,$ports/,g"
21   else
22     # We expect the glibc-ports directory to be symlinked as PORTS.
23     # The glibc release manager will run this script as part of libc.pot
24     # regeneration and should ensure the symlink to PORTS is setup.
25     echo >&2 "WARNING: No \"$ports\" directory found. Expected glibc-ports"\
26              "source directory to be symlinked as \"$ports\" directory."
27   fi
28   exit 0
29 fi
30
31 echo >&2 'Cannot list sources without some version control system in use.'
32 exit 1