]>
Commit | Line | Data |
---|---|---|
e9bf62fa ER |
1 | #!/bin/sh |
2 | # Make snapshot of depot_tools | |
3 | # Author: Elan Ruusamäe <glen@pld-linux.org> | |
4 | set -e | |
5 | ||
6 | repo_url=https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
7 | package=depot_tools | |
8 | specfile=$package.spec | |
9 | ||
10 | export GIT_DIR=$package.git | |
11 | ||
12 | if [ ! -d $GIT_DIR ]; then | |
13 | install -d $GIT_DIR | |
14 | git init --bare | |
15 | git remote add origin $repo_url | |
16 | git fetch --depth 1 origin refs/heads/master:refs/remotes/origin/master | |
17 | else | |
18 | git fetch origin refs/heads/master:refs/remotes/origin/master | |
19 | fi | |
20 | ||
21 | git update-ref HEAD refs/remotes/origin/master | |
22 | ||
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 | |
27 | ||
28 | if [ -f $archive ]; then | |
29 | echo "Tarball $archive already exists at $githash" | |
30 | exit 0 | |
31 | fi | |
32 | ||
33 | git -c tar.tar.xz.command="xz -9c" archive $githash --prefix $prefix/ -o $archive | |
34 | ||
35 | ../dropin $archive |