Misha Brukman | cb6f9c8 | 2009-06-12 01:55:57 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Creates LLVM SVN snapshots: llvm-$REV.tar.bz2 and llvm-gcc-4.2-$REV.tar.bz2, |
| 4 | # where $REV is an SVN revision of LLVM. This is used for creating stable |
| 5 | # tarballs which can be used to build known-to-work crosstools. |
| 6 | # |
| 7 | # Syntax: |
| 8 | # $0 [REV] -- grabs the revision $REV from SVN; if not specified, grabs the |
| 9 | # latest SVN revision. |
| 10 | |
| 11 | set -o nounset |
| 12 | set -o errexit |
| 13 | |
Misha Brukman | 0307a76 | 2009-08-04 15:47:18 +0000 | [diff] [blame] | 14 | readonly LLVM_PROJECT_SVN="http://llvm.org/svn/llvm-project" |
Misha Brukman | cb6f9c8 | 2009-06-12 01:55:57 +0000 | [diff] [blame] | 15 | |
Misha Brukman | 0307a76 | 2009-08-04 15:47:18 +0000 | [diff] [blame] | 16 | getLatestRevisionFromSVN() { |
| 17 | svn info ${LLVM_PROJECT_SVN} | egrep ^Revision | sed 's/^Revision: //' |
| 18 | } |
| 19 | |
| 20 | readonly REV="${1:-$(getLatestRevisionFromSVN)}" |
| 21 | |
| 22 | createTarballFromSVN() { |
Misha Brukman | cb6f9c8 | 2009-06-12 01:55:57 +0000 | [diff] [blame] | 23 | local module=$1 |
| 24 | local log="${module}.log" |
Misha Brukman | 0307a76 | 2009-08-04 15:47:18 +0000 | [diff] [blame] | 25 | echo "Running: svn export -r ${REV} ${module}; log in ${log}" |
| 26 | svn -q export -r ${REV} ${LLVM_PROJECT_SVN}/${module}/trunk \ |
| 27 | ${module} > ${log} 2>&1 |
Misha Brukman | cb6f9c8 | 2009-06-12 01:55:57 +0000 | [diff] [blame] | 28 | |
| 29 | # Create "module-revision.tar.bz2" packages from the SVN checkout dirs. |
Misha Brukman | 0307a76 | 2009-08-04 15:47:18 +0000 | [diff] [blame] | 30 | local tarball="${module}-${REV}.tar.bz2" |
Misha Brukman | cb6f9c8 | 2009-06-12 01:55:57 +0000 | [diff] [blame] | 31 | echo "Creating tarball: ${tarball}" |
| 32 | tar cjf ${tarball} ${module} |
| 33 | |
Misha Brukman | 0307a76 | 2009-08-04 15:47:18 +0000 | [diff] [blame] | 34 | echo "Cleaning up '${module}'" |
Misha Brukman | cb6f9c8 | 2009-06-12 01:55:57 +0000 | [diff] [blame] | 35 | rm -rf ${module} ${log} |
| 36 | } |
| 37 | |
| 38 | for module in "llvm" "llvm-gcc-4.2"; do |
Misha Brukman | 0307a76 | 2009-08-04 15:47:18 +0000 | [diff] [blame] | 39 | createTarballFromSVN ${module} |
Misha Brukman | cb6f9c8 | 2009-06-12 01:55:57 +0000 | [diff] [blame] | 40 | done |
| 41 | |