2007-12-22 01:14:50 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
LC_ALL=C LANG=C
|
|
|
|
SVNURL=http://svn.ruby-lang.org/repos/ruby/trunk
|
|
|
|
export LC_ALL LANG
|
|
|
|
: ${VPATH=include/ruby} ${YACC=bison} ${BASERUBY=ruby} ${RUBY=ruby} ${MV=mv}
|
|
|
|
export VPATH YACC BASERUBY RUBY MV
|
|
|
|
|
2007-12-25 06:24:50 -05:00
|
|
|
if [ ! "$1" ]; then
|
|
|
|
echo usage: `basename $0` new-directory-to-save 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2007-12-22 01:14:50 -05:00
|
|
|
[ -d "$1" ] || mkdir "$1" || exit 1
|
|
|
|
dest=`cd "$1"; pwd`
|
|
|
|
|
2007-12-25 07:44:52 -05:00
|
|
|
tmp="${TMP_DIR-/tmp}/ruby-snapshot-$$"
|
2007-12-22 01:14:50 -05:00
|
|
|
mkdir -p "$tmp"
|
2007-12-25 07:44:52 -05:00
|
|
|
(cd "$tmp"
|
2007-12-25 06:14:38 -05:00
|
|
|
revision=`svn export $SVNURL ruby | sed -n '$s/[^0-9]//gp'`
|
2007-12-22 01:14:50 -05:00
|
|
|
[ $revision ] || revision=`svn info $SVNURL | sed -n 's/Revision: //p'`
|
|
|
|
echo "#define RUBY_REVISION $revision" > ruby/revision.h
|
2007-12-25 07:44:52 -05:00
|
|
|
version=`sed -n -e '/^#define RUBY_VERSION /s/[^0-9.]//gp' ruby/version.h`
|
|
|
|
v=ruby-$version-r$revision
|
2007-12-22 01:14:50 -05:00
|
|
|
mv ruby $v
|
2007-12-24 13:24:15 -05:00
|
|
|
(cd $v; autoconf; (sed '/lex\.c/,/^$/!d' Makefile.in; sed 's/{[^{}]*}//g' common.mk) | make -f - prereq srcdir=.)
|
2007-12-22 01:14:50 -05:00
|
|
|
|
|
|
|
for cmd in "bzip tarball.tar.bz2 tar cjf" "gzip tarball.tar.gz tar czf" "zip archive.zip zip -qr"; do
|
|
|
|
mesg="${cmd%%.*}" cmd="${cmd#*.}"
|
|
|
|
ext="${cmd%% *}" cmd="${cmd#* }"
|
|
|
|
echo -n creating $mesg... $dest/$v.$ext
|
|
|
|
if $cmd $dest/$v.$ext $v; then
|
|
|
|
echo " done"
|
|
|
|
else
|
|
|
|
echo " failed"
|
|
|
|
fi
|
|
|
|
done
|
2007-12-25 07:44:52 -05:00
|
|
|
exec rm -fr $v)
|
|
|
|
exec rmdir "$tmp"
|