libffado-snapshot.sh 837 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # $1 - revision number to checkout.
  3. : ${1?"You must either provide desired revision number \"X\" to checkout: `basename $0` X
  4. or fetch the latest revision by: `basename $0` HEAD"}
  5. set -e
  6. tmp=$(mktemp -d)
  7. trap cleanup EXIT
  8. cleanup() {
  9. set +e
  10. [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
  11. }
  12. unset CDPATH
  13. pwd=$(pwd)
  14. name=libffado
  15. version=2.1.0
  16. revision=$1
  17. pushd "$tmp" >/dev/null
  18. echo "Fetching SVN revision: $1"
  19. svn export -r$revision http://subversion.ffado.org/ffado/trunk/$name $name-$version |tee $name.stdout
  20. revision=$(cat $name.stdout|grep "Exported revision"|sed 's|[^0-9]*||g')
  21. echo "Fetched SVN revision: $revision"
  22. rm -f $name.stdout
  23. tar jcf "$pwd"/$name-$version-svn$revision.tar.bz2 $name-$version
  24. echo "Written: $name-$version-svn$revision.tar.bz2"
  25. popd >/dev/null