2 # Make snapshot of nacl-binutils
3 # Author: Elan Ruusamäe <glen@pld-linux.org>
7 # git clone http://git.chromium.org/native_client/nacl-binutils.git
8 # (Checkout ID taken from chromium-17.0.963.46/native_client/tools/REVISIONS)
10 # git checkout 73acd6f5f2ec5daa6e9be737ade60f03e258602b
12 # For binutils version, grep "AM_INIT_AUTOMAKE(bfd, " bfd/configure.in
13 # mv nacl-binutils nacl-binutils-2.20.1-git73acd6f
14 # tar cfj nacl-binutils-2.20.1-git73acd6f.tar.bz2 nacl-binutils-2.20.1-git73acd6f
17 repo_url=http://git.chromium.org/native_client/$package.git
18 nacl_trunk=http://src.chromium.org/native_client/trunk
19 omahaproxy_url=https://omahaproxy.appspot.com
20 specfile=crossnacl-binutils.spec
23 chrome_version=$(curl -s "$omahaproxy_url/?os=linux&channel=$chrome_channel" | awk -F, 'NR > 1{print $3}')
24 chrome_revision=$(curl -s $omahaproxy_url/revision?version=$chrome_version)
25 chrome_branch=$(IFS=.; set -- $chrome_version; echo $3)
26 test -e DEPS.py || svn cat http://src.chromium.org/chrome/branches/$chrome_branch/src/DEPS@$chrome_revision > DEPS.py
27 nacl_revision=$(awk -F'"' '/nacl_revision.:/{print $4}' DEPS.py)
29 export GIT_DIR=$package/.git
31 if [ ! -d $package ]; then
34 git remote add origin $repo_url
35 git fetch --depth 1 origin refs/heads/master:refs/remotes/origin/master
37 git fetch origin refs/heads/master:refs/remotes/origin/master
40 # get src/native_client/tools/REVISIONS directly from svn
41 test -n "$nacl_revision"
42 test -e NACL_REVISIONS.sh || svn cat $nacl_trunk/src/native_client/tools/REVISIONS@$nacl_revision > NACL_REVISIONS.sh
44 if grep -Ev '^(#|(LINUX_HEADERS_FOR_NACL|NACL_(BINUTILS|GCC|GDB|GLIBC|NEWLIB))_COMMIT=[0-9a-f]+$|)' NACL_REVISIONS.sh >&2; then
45 echo >&2 "I refuse to execute grabbed file for security concerns"
50 githash=$NACL_BINUTILS_COMMIT
51 git show $githash:bfd/configure.in > configure.in
52 version=$(awk '/AM_INIT_AUTOMAKE/{v=$NF; sub(/\)/, "",v);print v}' configure.in)
53 shorthash=$(git rev-parse --short $githash)
54 prefix=$package-$version-git$shorthash
56 if [ -f $prefix.tar.bz2 ]; then
57 echo "Tarball $prefix.tar.bz2 already exists at $shorthash"
58 rm -f NACL_REVISIONS.sh DEPS.py configure.in
62 git archive $githash --prefix $prefix/ > $prefix.tar
65 ../dropin $prefix.tar.bz2
67 rm -f NACL_REVISIONS.sh DEPS.py configure.in