Fix race conditions in pldd that may leave the process stopped after detaching
[glibc.git] / scripts / list-sources.sh
blob528e971b42118f30964ac7b2d774c9bec1782bab
1 #!/bin/sh
3 # List all the files under version control in the source tree.
6 case $# in
7 0) ;;
8 1) cd "$1" ;;
9 *) echo >&2 "Usage: $0 [top_srcdir]"; exit 2 ;;
10 esac
12 if [ -r .git/HEAD ]; then
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."
28 exit 0
31 echo >&2 'Cannot list sources without some version control system in use.'
32 exit 1