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