mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
feat(third_party): initial update script
This update script does a go get and then checks in just the code into the third_party directory
This commit is contained in:
parent
6b3bbc1dd5
commit
c03d4666b8
1
third_party/.gitignore
vendored
Normal file
1
third_party/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
src
|
42
third_party/update
vendored
Executable file
42
third_party/update
vendored
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
packages="
|
||||
github.com/coreos/go-raft
|
||||
github.com/ccding/go-logging
|
||||
bitbucket.org/kardianos/osext
|
||||
code.google.com/p/go.net
|
||||
code.google.com/p/goprotobuf
|
||||
"
|
||||
|
||||
export GOPATH=${PWD}
|
||||
|
||||
for p in $packages; do
|
||||
# this is the target directory
|
||||
mkdir -p $p
|
||||
|
||||
# This will checkout the project into src
|
||||
go get -u -d $p
|
||||
|
||||
# The go get path
|
||||
gp=src/$p
|
||||
|
||||
HEAD=
|
||||
if [ -d $gp/.git ]; then
|
||||
# Grab the head if it is git
|
||||
HEAD=$(git --git-dir=$gp/.git rev-parse HEAD)
|
||||
fi
|
||||
|
||||
# Grab the head if it is mercurial
|
||||
if [ -d $gp/.hg ]; then
|
||||
cd $gp
|
||||
HEAD=$(hg id -i)
|
||||
cd -
|
||||
fi
|
||||
|
||||
# Copy the code into the final directory
|
||||
rsync -a -z -r --exclude '.git/' --exclude '.hg/' src/$p/ $p
|
||||
|
||||
git add $p
|
||||
|
||||
git commit -m "bump($p): $HEAD"
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user