2007-12-22 09:14:50 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
LC_ALL=C LANG=C
|
|
|
|
SVNURL=http://svn.ruby-lang.org/repos/ruby/trunk
|
|
|
|
export LC_ALL LANG
|
2008-03-01 08:13:28 +03:00
|
|
|
: ${VPATH=include/ruby} ${YACC=bison} ${BASERUBY=ruby} ${RUBY=ruby} ${MV=mv} ${MINIRUBY=ruby}
|
|
|
|
export VPATH YACC BASERUBY RUBY MV MINIRUBY
|
2007-12-22 09:14:50 +03:00
|
|
|
|
2007-12-25 14:24:50 +03:00
|
|
|
if [ ! "$1" ]; then
|
|
|
|
echo usage: `basename $0` new-directory-to-save 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2007-12-22 09:14:50 +03:00
|
|
|
[ -d "$1" ] || mkdir "$1" || exit 1
|
|
|
|
dest=`cd "$1"; pwd`
|
|
|
|
|
2007-12-25 15:44:52 +03:00
|
|
|
tmp="${TMP_DIR-/tmp}/ruby-snapshot-$$"
|
2007-12-22 09:14:50 +03:00
|
|
|
mkdir -p "$tmp"
|
2007-12-25 15:44:52 +03:00
|
|
|
(cd "$tmp"
|
2008-03-01 11:45:04 +03:00
|
|
|
revision=`svn export $SVNURL ruby | sed -n '$s/[^0-9]//gp'`
|
2007-12-22 09:14:50 +03:00
|
|
|
[ $revision ] || revision=`svn info $SVNURL | sed -n 's/Revision: //p'`
|
|
|
|
echo "#define RUBY_REVISION $revision" > ruby/revision.h
|
2007-12-25 15:44:52 +03:00
|
|
|
version=`sed -n -e '/^#define RUBY_VERSION /s/[^0-9.]//gp' ruby/version.h`
|
2008-03-01 11:45:04 +03:00
|
|
|
v=ruby-$version-${2-r$revision}
|
2007-12-22 09:14:50 +03:00
|
|
|
mv ruby $v
|
2007-12-24 21:24:15 +03:00
|
|
|
(cd $v; autoconf; (sed '/lex\.c/,/^$/!d' Makefile.in; sed 's/{[^{}]*}//g' common.mk) | make -f - prereq srcdir=.)
|
2007-12-22 09:14:50 +03: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 15:44:52 +03:00
|
|
|
exec rm -fr $v)
|
|
|
|
exec rmdir "$tmp"
|