prepare-source 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. dir=`dirname $0`
  14. if test x"$dir" != x -a x"$dir" != x.; then
  15. cd "$dir"
  16. fi
  17. if test $# = 0; then
  18. set -- build
  19. fi
  20. for action in "${@}"; do
  21. case "$action" in
  22. build|make)
  23. make -f prepare-source.mak
  24. ;;
  25. fetch)
  26. if perl --version >/dev/null 2>/dev/null; then
  27. files='c*'
  28. else
  29. files='[cp]*'
  30. fi
  31. rsync -pvz rsync://rsync.samba.org/rsyncftp/generated-files/"$files" .
  32. ;;
  33. fetchgen)
  34. rsync -pvz rsync://rsync.samba.org/rsyncftp/generated-files/'*' .
  35. ;;
  36. fetchSRC)
  37. rsync -pvrz --exclude=/.git/ rsync://rsync.samba.org/ftp/pub/unpacked/rsync/ .
  38. ;;
  39. *)
  40. echo "Unknown action: $action"
  41. exit 1
  42. esac
  43. if test $? = 0; then
  44. exit
  45. fi
  46. done
  47. exit 1