Remove leftover case match.
[rsync.git] / prepare-source
1 #!/bin/sh
2 # Either use autoconf and autoheader to create configure.sh and config.h.in
3 # or (optionally) fetch the latest development versions of generated files.
4 #
5 # Specify one action or more than one to provide a fall-back:
6 #
7 #   build     build the config files [the default w/no arg]
8 #   fetch     fetch the latest dev config files
9 #   fetchgen  fetch all the latest dev generated files
10 #   fetchSRC  fetch the latest dev source files [NON-GENERATED FILES]
11 #
12 # The script stops after the first successful action.
13
14 dir=`dirname $0`
15 if test x"$dir" = x; then
16     dir=.
17 fi
18
19 if test $# = 0; then
20     set -- build
21 fi
22
23 for action in "${@}"; do
24     case "$action" in
25     build|make)
26         (cd $dir && make -f prepare-source.mak)
27         ;;
28     fetch|fetchgen)
29         $dir/rsync-ssl -iip --no-motd rsync://download.samba.org/rsyncftp/generated-files/'[ca]*' $dir
30         if test "$action" = fetchgen; then
31             $dir/rsync-ssl -iip --no-motd rsync://download.samba.org/rsyncftp/generated-files/'[^ca]*' .
32         elif ! perl --version >/dev/null 2>/dev/null; then
33             $dir/rsync-ssl -iip --no-motd rsync://download.samba.org/rsyncftp/generated-files/'p*' .
34         fi
35         sleep 1 # The following files need to be newer than aclocal.m4
36         touch configure.sh config.h.in
37         ;;
38     fetchSRC)
39         ./rsync-ssl -iipr --no-motd --exclude=/.git/ rsync://download.samba.org/ftp/pub/unpacked/rsync/ .
40         ;;
41     *)
42         echo "Unknown action: $action"
43         exit 1
44     esac
45     if test $? = 0; then
46         exit
47     fi
48 done
49
50 exit 1