]> git.pld-linux.org Git - packages/crossnacl-gcc.git/blame - get-source.sh
- cleaned up directory mess, rel .1
[packages/crossnacl-gcc.git] / get-source.sh
CommitLineData
ced35f34
ER
1#!/bin/sh
2# Make snapshot of nacl-binutils
3# Author: Elan Ruusamäe <glen@pld-linux.org>
ced35f34
ER
4set -e
5
6# Generated from git
7# git clone http://git.chromium.org/native_client/nacl-gcc.git
8# (Checkout ID taken from chromium-15.0.874.106/native_client/tools/REVISIONS)
9# cd nacl-gcc
10# git checkout cff9ac884908ba53ae16149e7c7d19c336aa4895
11# cd ..
12# For gcc version, echo gcc/BASE-VER
13# mv nacl-gcc nacl-gcc-4.4.3-gitcff9ac88
14# tar cfj nacl-gcc-4.4.3-gitcff9ac88.tar.bz2 nacl-gcc-4.4.3-gitcff9ac88
15
16package=nacl-gcc
17repo_url=http://git.chromium.org/native_client/$package.git
9da9bef5 18nacl_trunk=http://src.chromium.org/native_client/trunk
3c7e8519 19omahaproxy_url=http://omahaproxy.appspot.com
ced35f34
ER
20specfile=crossnacl-gcc.spec
21
9da9bef5
ER
22# if you get errors that sha1 hash not found, try increasing depth
23# fatal: Path 'gcc/BASE-VER' does not exist in 'c69a5b7252d2f073d0f526800e4fca3b63cd1fab'
24depth=5
ced35f34 25
64a65cbc 26chrome_channel=${1:-stable}
1d283375 27chrome_version=$(curl -s "$omahaproxy_url/all?os=linux&channel=$chrome_channel" | awk -F, 'NR > 1{print $3}')
6fcf51a6 28test -n "$chrome_version"
1d283375 29chrome_revision=$((echo 'data='; curl -s $omahaproxy_url/revision.json?version=$chrome_version; echo ',print(data.chromium_revision)') | js)
6fcf51a6 30test -n "$chrome_revision"
ced35f34 31chrome_branch=$(IFS=.; set -- $chrome_version; echo $3)
1d283375 32test -s DEPS.py || svn cat http://src.chromium.org/chrome/branches/$chrome_branch/src/DEPS@$chrome_revision > DEPS.py
ced35f34 33nacl_revision=$(awk -F'"' '/nacl_revision.:/{print $4}' DEPS.py)
6fcf51a6 34test -n "$nacl_revision"
ced35f34 35
a6cd2124 36export GIT_DIR=$package.git
ced35f34 37
a6cd2124
ER
38if [ ! -d $GIT_DIR ]; then
39 install -d $GIT_DIR
40 git init --bare
ced35f34 41 git remote add origin $repo_url
9da9bef5 42 git fetch --depth $depth origin refs/heads/master:refs/remotes/origin/master
ced35f34
ER
43else
44 git fetch origin refs/heads/master:refs/remotes/origin/master
45fi
46
47# get src/native_client/tools/REVISIONS directly from svn
6fcf51a6 48test -n "$nacl_revision"
1d283375 49test -s NACL_REVISIONS.sh || svn cat $nacl_trunk/src/native_client/tools/REVISIONS@$nacl_revision > NACL_REVISIONS.sh
ced35f34
ER
50
51if grep -Ev '^(#|(LINUX_HEADERS_FOR_NACL|NACL_(BINUTILS|GCC|GDB|GLIBC|NEWLIB))_COMMIT=[0-9a-f]+$|)' NACL_REVISIONS.sh >&2; then
52 echo >&2 "I refuse to execute grabbed file for security concerns"
53 exit 1
54fi
55. ./NACL_REVISIONS.sh
56
57githash=$NACL_GCC_COMMIT
58version=$(git show $githash:gcc/BASE-VER)
59shorthash=$(git rev-parse --short $githash)
60prefix=$package-$version-git$shorthash
745ff429 61archive=$prefix.tar.xz
ced35f34 62
745ff429
ER
63if [ -f $archive ]; then
64 echo "Tarball $archive already exists at $shorthash"
9da9bef5 65 rm -f NACL_REVISIONS.sh DEPS.py
ced35f34
ER
66 exit 0
67fi
68
745ff429 69git -c tar.tar.xz.command="xz -9c" archive $githash --prefix $prefix/ -o $archive
ced35f34 70
745ff429 71../dropin $archive
ced35f34
ER
72
73rm -f NACL_REVISIONS.sh DEPS.py
This page took 0.116042 seconds and 4 git commands to generate.