Allow basic connectivity check via rrsync
[rsync.git] / prepare-source
bloba4e78e61ea63bd5970d95028bba5b3dfc17b709b
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.
5 # Specify one action or more than one to provide a fall-back:
7 # build build the config files [the default w/no arg]
8 # fetch fetch the latest dev autoconfig files
9 # fetchgen fetch all the latest dev generated files (including manpages)
10 # fetchSRC fetch the latest dev source files [NON-GENERATED FILES]
12 # The script stops after the first successful action.
14 dir=`dirname $0`
15 if test x"$dir" = x; then
16 dir=.
19 if test "$dir" = '.'; then
20 branch=`packaging/prep-auto-dir` || exit 1
21 if test x"$branch" != x; then
22 cd build || exit 1
23 dir=..
27 if test "$dir" != '.'; then
28 for lnk in configure.ac m4; do
29 if test ! -h $lnk; then
30 rm -f $lnk # Just in case
31 ln -s "$dir/$lnk" $lnk
33 done
34 for fn in configure.sh config.h.in aclocal.m4; do
35 test ! -f $fn && test -f "$dir/$fn" && cp -p "$dir/$fn" $fn
36 done
39 if test $# = 0; then
40 set -- build
43 for action in "${@}"; do
44 case "$action" in
45 build|make)
46 make -f "$dir/prepare-source.mak"
48 fetch|fetchgen)
49 if test "$action" = fetchgen; then
50 match='*'
51 else
52 match='[ca]*'
54 $dir/rsync-ssl -iipc --no-motd "rsync://download.samba.org/rsyncftp/generated-files/$match" ./
55 test $? != 0 && continue
56 sleep 1 # The following files need to be newer than aclocal.m4
57 touch configure.sh config.h.in
59 fetchSRC)
60 ./rsync-ssl -iipr --no-motd --exclude=/.git/ rsync://download.samba.org/ftp/pub/unpacked/rsync/ .
63 echo "Unknown action: $action"
64 exit 1
66 esac
67 if test $? = 0; then
68 exit
70 done
72 exit 1