2 # Make snapshot of depot_tools
3 # Author: Elan Ruusamäe <glen@pld-linux.org>
6 repo_url=https://chromium.googlesource.com/chromium/tools/depot_tools.git
10 export GIT_DIR=$package.git
12 if [ ! -d $GIT_DIR ]; then
15 git remote add origin $repo_url
16 git fetch --depth 1 origin refs/heads/master:refs/remotes/origin/master
18 git fetch origin refs/heads/master:refs/remotes/origin/master
21 git update-ref HEAD refs/remotes/origin/master
23 githash=$(git rev-parse --short HEAD)
24 gitdate=$(git log -1 --date=short --pretty='format:%cd' HEAD | tr -d -)
25 prefix=$package-$gitdate
26 archive=$prefix-$githash.tar.xz
28 if [ -f $archive ]; then
29 echo "Tarball $archive already exists at $githash"
33 git -c tar.tar.xz.command="xz -9c" archive $githash --prefix $prefix/ -o $archive