Annotation of embedaddon/rsync/prepare-source, revision 1.1.1.3

1.1       misho       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]
1.1.1.3 ! misho       8: #   fetch     fetch the latest dev autoconfig files
        !             9: #   fetchgen  fetch all the latest dev generated files (including man pages)
1.1       misho      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`
1.1.1.3 ! misho      15: if test x"$dir" = x; then
        !            16:     dir=.
        !            17: fi
        !            18: 
        !            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=..
        !            24:     fi
        !            25: fi
        !            26: 
        !            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
        !            32:        fi
        !            33:     done
        !            34:     for fn in configure.sh config.h.in aclocal.m4; do
        !            35:        test ! -f $fn -a -f "$dir/$fn" && cp -p "$dir/$fn" $fn
        !            36:     done
1.1       misho      37: fi
                     38: 
                     39: if test $# = 0; then
                     40:     set -- build
                     41: fi
                     42: 
                     43: for action in "${@}"; do
                     44:     case "$action" in
                     45:     build|make)
1.1.1.3 ! misho      46:        make -f "$dir/prepare-source.mak"
1.1       misho      47:        ;;
1.1.1.3 ! misho      48:     fetch|fetchgen)
        !            49:        if test "$action" = fetchgen; then
        !            50:            match='*'
1.1       misho      51:        else
1.1.1.3 ! misho      52:            match='[ca]*'
1.1       misho      53:        fi
1.1.1.3 ! misho      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
1.1       misho      58:        ;;
                     59:     fetchSRC)
1.1.1.3 ! misho      60:        ./rsync-ssl -iipr --no-motd --exclude=/.git/ rsync://download.samba.org/ftp/pub/unpacked/rsync/ .
1.1       misho      61:        ;;
                     62:     *)
                     63:        echo "Unknown action: $action"
                     64:        exit 1
1.1.1.3 ! misho      65:        ;;
1.1       misho      66:     esac
                     67:     if test $? = 0; then
                     68:        exit
                     69:     fi
                     70: done
                     71: 
                     72: exit 1

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>