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.
8 # $0 [REV] -- grabs the revision $REV from SVN; if not specified, grabs the
14 readonly REV="${1:-HEAD}"
18 local log="${module}.log"
19 echo "Running: svn co -r ${REV} ${module}; log in ${log}"
20 svn co -r ${REV} http://llvm.org/svn/llvm-project/${module}/trunk ${module} \
23 # Delete all the ".svn" dirs; they take quite a lot of space.
24 echo "Cleaning up .svn dirs"
25 find ${module} -type d -name \.svn -print0 | xargs -0 /bin/rm -rf
27 # Create "module-revision.tar.bz2" packages from the SVN checkout dirs.
28 local revision=$(grep "Checked out revision" ${log} | \
29 sed 's/[^0-9]\+\([0-9]\+\)[^0-9]\+/\1/')
30 local tarball="${module}-${revision}.tar.bz2"
31 echo "Creating tarball: ${tarball}"
32 tar cjf ${tarball} ${module}
34 echo "Cleaning SVN checkout dir ${module}"
35 rm -rf ${module} ${log}
38 for module in "llvm" "llvm-gcc-4.2"; do