update 678 B

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