#!/bin/sh #============================================================ # create a source tar ball from the tcl/websh project # $Id$ #============================================================ # \ exec tclsh "$0" "$@" set repository "https://svn.apache.org/repos/asf/tcl/websh" proc usage {} { global argv0 fatal "usage: $argv0 \nwhere is the name of a tagged build (e.g. 3.5.0)" } proc fatal {msg} { puts stderr $msg exit 1 } if {$argc != 1} { usage } # get build from command line set build [lindex $argv 0] # check whether build is valid puts "checking for build $build" if {[catch { set svnlist [exec svn list $repository/tags] if {![regexp "$build/" $svnlist]} { fatal "build $build is not tagged" } } msg]} {fatal $msg} # checkout build in a temporary directory set tmpdir [pid].tmp file mkdir $tmpdir cd $tmpdir puts "checking out build $build in temporary directory" catch {exec svn co $repository/tags/$build websh-$build} if {![file exists websh-$build/README]} { cd .. fatal "checkout in directory $tmpdir failed" } cd websh-$build ## ------------------------------------------------------------- ## do some cleanup in the build (just add more fixes or stuff # remove the examples file delete -force examples # make the docs (quickref in html format) cd doc file mkdir html catch {exec make} cd .. ## end of cleanup ## ------------------------------------------------------------- # creating tar ball for quickref puts "creating tar ball quickref-$build.tar.gz" cd doc file rename html quickref-$build exec tar czvf ../../../quickref-$build.tar.gz --exclude .svn quickref-$build file rename quickref-$build html cd ../.. # creating tar ball puts "creating tar ball websh-$build.tar.gz" exec tar czvf ../websh-$build.tar.gz --exclude .svn websh-$build # cleanup cd .. file delete -force $tmpdir puts "done."