| Wayne Davison | 20926fb | 2006-02-06 04:08:14 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| Wayne Davison | 9203c8d | 2007-12-17 23:09:35 -0800 | [diff] [blame] | 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 | |
| Wayne Davison | 20926fb | 2006-02-06 04:08:14 +0000 | [diff] [blame] | 14 | dir=`dirname $0` |
| Wayne Davison | 5dcd9a2 | 2006-10-07 14:39:01 +0000 | [diff] [blame] | 15 | if test x"$dir" != x -a x"$dir" != x.; then |
| Wayne Davison | 77b013a | 2006-04-17 18:15:02 +0000 | [diff] [blame] | 16 | cd "$dir" |
| Wayne Davison | 20926fb | 2006-02-06 04:08:14 +0000 | [diff] [blame] | 17 | fi |
| Wayne Davison | 9203c8d | 2007-12-17 23:09:35 -0800 | [diff] [blame] | 18 | |
| 19 | if test $# = 0; then |
| 20 | set -- build |
| Wayne Davison | 85cdbb6 | 2007-11-30 18:01:18 -0800 | [diff] [blame] | 21 | fi |
| Wayne Davison | 9203c8d | 2007-12-17 23:09:35 -0800 | [diff] [blame] | 22 | |
| 23 | for action in "${@}"; do |
| 24 | case "$action" in |
| 25 | build|make) |
| 26 | make -f prepare-source.mak |
| 27 | ;; |
| 28 | fetch) |
| 29 | if perl --version >/dev/null 2>/dev/null; then |
| 30 | files='c*' |
| 31 | else |
| 32 | files='[cp]*' |
| 33 | fi |
| 34 | rsync -pvz rsync://rsync.samba.org/rsyncftp/generated-files/"$files" . |
| 35 | ;; |
| 36 | fetchgen) |
| 37 | rsync -pvz rsync://rsync.samba.org/rsyncftp/generated-files/'*' . |
| 38 | ;; |
| 39 | fetchSRC) |
| 40 | rsync -pvrz --exclude=/.git/ rsync://rsync.samba.org/ftp/pub/unpacked/rsync/ . |
| 41 | ;; |
| 42 | *) |
| 43 | echo "Unknown action: $action" |
| 44 | exit 1 |
| 45 | esac |
| 46 | if test $? = 0; then |
| 47 | exit |
| 48 | fi |
| 49 | done |
| 50 | |
| 51 | exit 1 |