update 889 B

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