blob: 3d3b43a5467da6acef944a9123f0d7484123331d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/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
if [ ! "$1" ]; then
echo usage: `basename $0` new-directory-to-save 1>&2
exit 1
fi
[ -d "$1" ] || mkdir "$1" || exit 1
dest=`cd "$1"; pwd`
tmp="${TMP_DIR-/tmp}/ruby-snapshot-$$"
mkdir -p "$tmp"
(cd "$tmp"
revision=`svn export $SVNURL ruby | sed -n '$s/[^0-9]//gp'`
[ $revision ] || revision=`svn info $SVNURL | sed -n 's/Revision: //p'`
echo "#define RUBY_REVISION $revision" > ruby/revision.h
version=`sed -n -e '/^#define RUBY_VERSION /s/[^0-9.]//gp' ruby/version.h`
v=ruby-$version-r$revision
mv ruby $v
(cd $v; autoconf; (sed '/lex\.c/,/^$/!d' Makefile.in; sed 's/{[^{}]*}//g' common.mk) | make -f - prereq srcdir=.)
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
exec rm -fr $v)
exec rmdir "$tmp"
|