brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · d70232a Raw
42 lines · bash
1#!/bin/bash2#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 stable5# 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 the9#   latest SVN revision.10 11set -o nounset12set -o errexit13 14readonly LLVM_PROJECT_SVN="http://llvm.org/svn/llvm-project"15 16getLatestRevisionFromSVN() {17  svn info ${LLVM_PROJECT_SVN} | egrep ^Revision | sed 's/^Revision: //'18}19 20readonly REV="${1:-$(getLatestRevisionFromSVN)}"21 22createTarballFromSVN() {23  local module=$124  local log="${module}.log"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>&128 29  # Create "module-revision.tar.bz2" packages from the SVN checkout dirs.30  local tarball="${module}-${REV}.tar.bz2"31  echo "Creating tarball: ${tarball}"32  tar cjf ${tarball} ${module}33 34  echo "Cleaning up '${module}'"35  rm -rf ${module} ${log}36}37 38for module in "llvm" "llvm-gcc-4.2"; do39  createTarballFromSVN ${module}40done41 42