update 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. packages="
  3. github.com/coreos/go-raft
  4. github.com/coreos/go-etcd
  5. github.com/benbjohnson/go-raft
  6. github.com/ccding/go-logging
  7. github.com/ccding/go-config-reader
  8. bitbucket.org/kardianos/osext
  9. code.google.com/p/go.net
  10. code.google.com/p/goprotobuf
  11. "
  12. export GOPATH=${PWD}
  13. for p in $packages; do
  14. # this is the target directory
  15. mkdir -p $p
  16. # This will checkout the project into src
  17. go get -u -d $p
  18. # The go get path
  19. gp=src/$p
  20. # Attempt to find the commit hash of the repo
  21. HEAD=
  22. if [ -d $gp/.git ]; then
  23. # Grab the head if it is git
  24. HEAD=$(git --git-dir=$gp/.git rev-parse HEAD)
  25. fi
  26. # Grab the head if it is mercurial
  27. if [ -d $gp/.hg ]; then
  28. cd $gp
  29. HEAD=$(hg id -i)
  30. cd -
  31. fi
  32. # Copy the code into the final directory
  33. rsync -a -z -r --exclude '.git/' --exclude '.hg/' src/$p/ $p
  34. # Make a nice commit about what everything bumped to
  35. git add $p
  36. git commit -m "bump($p): $HEAD"
  37. done