update 726 B

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