]> git.pld-linux.org Git - packages/crossnacl-binutils.git/blame_incremental - get-source.sh
- use http url for omahaproxy
[packages/crossnacl-binutils.git] / get-source.sh
... / ...
CommitLineData
1#!/bin/sh
2# Make snapshot of nacl-binutils
3# Author: Elan Ruusamäe <glen@pld-linux.org>
4set -e
5
6# Generated from git
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)
9# cd nacl-binutils
10# git checkout 73acd6f5f2ec5daa6e9be737ade60f03e258602b
11# cd ..
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
15
16package=nacl-binutils
17repo_url=http://git.chromium.org/native_client/$package.git
18nacl_trunk=http://src.chromium.org/native_client/trunk
19omahaproxy_url=http://omahaproxy.appspot.com
20specfile=crossnacl-binutils.spec
21
22chrome_channel=${1:-stable}
23chrome_version=$(curl -s "$omahaproxy_url/?os=linux&channel=$chrome_channel" | awk -F, 'NR > 1{print $3}')
24test -n "$chrome_version"
25chrome_revision=$(curl -s $omahaproxy_url/revision?version=$chrome_version)
26test -n "$chrome_revision"
27chrome_branch=$(IFS=.; set -- $chrome_version; echo $3)
28test -e DEPS.py || svn cat http://src.chromium.org/chrome/branches/$chrome_branch/src/DEPS@$chrome_revision > DEPS.py
29nacl_revision=$(awk -F'"' '/nacl_revision.:/{print $4}' DEPS.py)
30test -n "$nacl_revision"
31
32export GIT_DIR=$package.git
33
34if [ ! -d $GIT_DIR ]; then
35 install -d $GIT_DIR
36 git init --bare
37 git remote add origin $repo_url
38 git fetch --depth 1 origin refs/heads/master:refs/remotes/origin/master
39else
40 git fetch origin refs/heads/master:refs/remotes/origin/master
41fi
42
43# get src/native_client/tools/REVISIONS directly from svn
44test -n "$nacl_revision"
45test -e NACL_REVISIONS.sh || svn cat $nacl_trunk/src/native_client/tools/REVISIONS@$nacl_revision > NACL_REVISIONS.sh
46
47if grep -Ev '^(#|(LINUX_HEADERS_FOR_NACL|NACL_(BINUTILS|GCC|GDB|GLIBC|NEWLIB))_COMMIT=[0-9a-f]+$|)' NACL_REVISIONS.sh >&2; then
48 echo >&2 "I refuse to execute grabbed file for security concerns"
49 exit 1
50fi
51. ./NACL_REVISIONS.sh
52
53githash=$NACL_BINUTILS_COMMIT
54git show $githash:bfd/configure.in > configure.in
55version=$(awk '/AM_INIT_AUTOMAKE/{v=$NF; sub(/\)/, "",v);print v}' configure.in)
56shorthash=$(git rev-parse --short $githash)
57prefix=$package-$version-git$shorthash
58
59if [ -f $prefix.tar.xz ]; then
60 echo "Tarball $prefix.tar.xz already exists at $shorthash"
61 rm -f NACL_REVISIONS.sh DEPS.py configure.in
62 exit 0
63fi
64
65git archive $githash --prefix $prefix/ > $prefix.tar
66xz -9 $prefix.tar
67
68../dropin $prefix.tar.xz
69
70rm -f NACL_REVISIONS.sh DEPS.py configure.in
This page took 0.163895 seconds and 4 git commands to generate.