[packages/crossnacl-gcc] - add script to fetch source tarball

draenog draenog at pld-linux.org
Sat Jul 7 11:13:54 CEST 2012


commit ced35f34a289dfacc85cff48edc12fca5f383184
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Fri Jul 6 22:40:40 2012 +0000

    - add script to fetch source tarball
    
    Changed files:
        crossnacl-gcc.spec -> 1.11
        get-source.sh -> 1.1

 crossnacl-gcc.spec |  1 +
 get-source.sh      | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
---
diff --git a/crossnacl-gcc.spec b/crossnacl-gcc.spec
index 40d4f72..ee2acc2 100644
--- a/crossnacl-gcc.spec
+++ b/crossnacl-gcc.spec
@@ -20,6 +20,7 @@ License:	GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions
 Group:		Development/Languages
 Source0:	nacl-gcc-%{version}-git%{gitver}.tar.bz2
 # Source0-md5:	50e316936d59c7951b91cff8124c0b30
+Source1:	get-source.sh
 URL:		http://sourceware.org/gcc/
 BuildRequires:	cloog-ppl-devel
 BuildRequires:	crossnacl-binutils
diff --git a/get-source.sh b/get-source.sh
new file mode 100644
index 0000000..8519b09
--- /dev/null
+++ b/get-source.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+# Make snapshot of nacl-binutils
+# Author: Elan Ruusamäe <glen at pld-linux.org>
+# $Id$
+set -e
+
+# Generated from git
+# git clone http://git.chromium.org/native_client/nacl-gcc.git
+# (Checkout ID taken from chromium-15.0.874.106/native_client/tools/REVISIONS)
+# cd nacl-gcc
+# git checkout cff9ac884908ba53ae16149e7c7d19c336aa4895
+# cd ..
+# For gcc version, echo gcc/BASE-VER
+# mv nacl-gcc nacl-gcc-4.4.3-gitcff9ac88
+# tar cfj nacl-gcc-4.4.3-gitcff9ac88.tar.bz2 nacl-gcc-4.4.3-gitcff9ac88
+
+package=nacl-gcc
+repo_url=http://git.chromium.org/native_client/$package.git
+specfile=crossnacl-gcc.spec
+
+chrome_version=20.0.1132.47
+
+chrome_revision=$(curl -s https://omahaproxy.appspot.com/revision?version=$chrome_version)
+chrome_branch=$(IFS=.; set -- $chrome_version; echo $3)
+test -e DEPS.py || svn cat http://src.chromium.org/chrome/branches/$chrome_branch/src/DEPS@$chrome_revision > DEPS.py
+nacl_revision=$(awk -F'"' '/nacl_revision.:/{print $4}' DEPS.py)
+
+# nacl_revision taken from src/DEPS of chrome 20.0.1132.47
+nacl_revision=8118
+
+export GIT_DIR=$package/.git
+
+if [ ! -d $package ]; then
+	install -d $package
+	git init
+	git remote add origin $repo_url
+	git fetch --depth 1 origin refs/heads/master:refs/remotes/origin/master
+else
+	git fetch origin refs/heads/master:refs/remotes/origin/master
+fi
+
+# get src/native_client/tools/REVISIONS directly from svn
+test -e NACL_REVISIONS.sh || svn cat https://src.chromium.org/native_client/trunk/src/native_client/tools/REVISIONS@$nacl_revision > NACL_REVISIONS.sh
+
+if grep -Ev '^(#|(LINUX_HEADERS_FOR_NACL|NACL_(BINUTILS|GCC|GDB|GLIBC|NEWLIB))_COMMIT=[0-9a-f]+$|)' NACL_REVISIONS.sh >&2; then
+	echo >&2 "I refuse to execute grabbed file for security concerns"
+	exit 1
+fi
+. ./NACL_REVISIONS.sh
+
+githash=$NACL_GCC_COMMIT
+version=$(git show $githash:gcc/BASE-VER)
+shorthash=$(git rev-parse --short $githash)
+prefix=$package-$version-git$shorthash
+
+if [ -f $prefix.tar.bz2 ]; then
+	echo "Tarball $prefix.tar.bz2 already exists at $shorthash"
+	exit 0
+fi
+
+git archive $githash --prefix $prefix/ > $prefix.tar
+bzip2 -9 $prefix.tar
+
+../dropin $prefix.tar.bz2
+
+rm -f NACL_REVISIONS.sh DEPS.py


More information about the test mailing list