e$B$J$+$@$G$9!#e(B
SVNe$B$X$N0\9T0JMhe(Bversion.he$B$N<+F099?7$,$G$-$J$/$J$C$?$N$H!“F|C10Le(B
e$B$G$O$”$^$jLr$KN)$?$J$$$3$H$b$"$k$N$G!“e(BSVNe$B$+$i%3%s%Q%$%k$7$?$H$-e(B
e$B$K$O0UL#$N$J$$e(Bpatchlevele$B$N$+$o$j$Ke(Brevisione$B$rI=<($9$k$h$&$K$7$?e(B
e$B$$$H;W$&$N$G$9$,!”$I$&$G$7$g$&$+!#e(B
Index: Makefile.in
— Makefile.in (revision 12064)
+++ Makefile.in (working copy)
@@ -93,4 +93,7 @@ MANTYPE = @MANTYPE@
INSTALLED_LIST= .installed.list
+
+IFCHANGE = $(srcdir)/tool/ifchange
+
End of variables
@@ -185,2 +188,5 @@ distclean-local::
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -o$@ -c ext/extinit.c
+
±update-revision-: $(srcdir)/new_rev.h
- @$(IFCHANGE) $(srcdir)/revision.h $(srcdir)/new_rev.h
Index: common.mk
===================================================================
— common.mk (revision 12064)
+++ common.mk (working copy)
@@ -92,5 +92,7 @@ TESTWORKDIR = testwork
BOOTSTRAPRUBY = $(MINIRUBY)
-all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
+VCS = svn
+
+all: $(MKFILES) $(PREP) $(REVISION_UP) $(RBCONFIG) $(LIBRUBY)
@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
prog: $(PROGRAM) $(WPROGRAM)
@@ -531,5 +533,5 @@ variable.$(OBJEXT): {$(VPATH)}variable.c
version.$(OBJEXT): {$(VPATH)}version.c {$(VPATH)}ruby.h config.h
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}version.h
- {$(VPATH)}version.h {$(VPATH)}$(REVISION_H)
compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}yarvcore.h
@@ -605,5 +607,5 @@ vm_macro.inc: $(srcdir)/vm_macro.def
$(BASERUBY) $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) vm_macro.inc
-incs: $(INSNS)
+incs: $(INSNS) $(REVISION_UP)
docs:
@@ -667,2 +669,8 @@ vtune: miniruby$(EXEEXT)
dist: $(PROGRAM)
$(RUNRUBY) $(srcdir)/distruby.rb
+
+revision-up: new_rev.h
- @$(IFCHANGE) revision.h new_rev.h
+new_rev.h: PHONY
- $(VCS) info --xml $(srcdir) | sed -f $(srcdir)/tool/svninfo.sed > $@
Index: configure.in
===================================================================
— configure.in (revision 12064)
+++ configure.in (working copy)
@@ -1673,4 +1673,14 @@ AC_CONFIG_FILES(Makefile, [{
echo; test x"$EXEEXT" = x || echo ‘miniruby: miniruby$(EXEEXT)’
test “$RUBY_INSTALL_NAME$EXEEXT” = ruby || echo ‘ruby: $(PROGRAM);’ - echo
- echo “### revision information”
- if test “
grep '^\#include \"revision\.h\"' ${srcdir}/version.h
”;
then -
echo "REVISION_H = revision.h"
-
echo "REVISION_UP = revision-up"
- else
-
echo "REVISION_H = version.h"
-
echo "REVISION_UP ="
- fi
- echo
sed [‘s/{$([^(){}])[^{}]}//g’] ${srcdir}/common.mk
} >> Makefile], [RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT])
Index: version.c
===================================================================
— version.c (revision 12064)
+++ version.c (working copy)
@@ -19,4 +19,5 @@ const char ruby_release_date[] = RUBY_RE
const char ruby_platform[] = RUBY_PLATFORM;
const int ruby_patchlevel = RUBY_PATCHLEVEL;
+const int ruby_revision = RUBY_REVISION;
void
@@ -31,4 +32,5 @@ Init_version(void)
rb_define_global_const(“RUBY_PLATFORM”, p);
rb_define_global_const(“RUBY_PATCHLEVEL”,
INT2FIX(RUBY_PATCHLEVEL));
- rb_define_global_const(“RUBY_REVISION”, INT2FIX(RUBY_REVISION));
}
@@ -36,5 +38,6 @@ void
ruby_show_version(void)
{
- printf(“ruby %s (%s patchlevel %d) [%s]\n”, RUBY_VERSION,
RUBY_RELEASE_DATE, RUBY_PATCHLEVEL, RUBY_PLATFORM);
- printf(“ruby %s (%s %s %d) [%s]\n”, RUBY_VERSION,
RUBY_RELEASE_DATE, -
fflush(stdout);RUBY_RELEASE_STR, RUBY_RELEASE_NUM, RUBY_PLATFORM);
}
Index: version.h
===================================================================
— version.h (revision 12064)
+++ version.h (working copy)
@@ -1,14 +1,25 @@
#define RUBY_VERSION “1.9.0”
-#define RUBY_RELEASE_DATE “2007-03-13”
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070313
-#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 0
-#define RUBY_RELEASE_YEAR 2007
-#define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 13
+#define RUBY_PATCHLEVEL 0
+#include “revision.h”
+
+#define RUBY_BIRTH_YEAR 1993
+#define RUBY_BIRTH_MONTH 2
+#define RUBY_BIRTH_DAY 24
+
+#if RUBY_VERSION_TEENY > 0 && RUBY_PATCHLEVEL < 5000
+#define RUBY_RELEASE_STR “patchlevel”
+#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL
+#else
+#ifdef RUBY_BRANCH_NAME
+#define RUBY_RELEASE_STR RUBY_BRANCH_NAME
+#else
+#define RUBY_RELEASE_STR “revision”
+#endif
+#define RUBY_RELEASE_NUM RUBY_REVISION
+#endif
#ifdef RUBY_EXTERN
Index: tool/ifchange
— tool/ifchange (revision 0)
+++ tool/ifchange (revision 0)
@@ -0,0 +1,16 @@
+#!/bin/sh
+# usage: ifchange target temporary
+
+target="$1"
+temp="$2"
+if [ “$temp” = - ]; then
- temp=“tmpdata$$.tmp~”
- cat > “$temp” || exit $?
+fi
+if cmp “$target” “$temp” >/dev/null 2>&1; then - echo “$target unchanged”
- rm -f “$temp”
+else - echo “$target updated”
- mv -f “$temp” “$target”
+fi
Property changes on: tool/ifchange
Name: svn:executable
Name: svn:eol-style
- LF
Index: tool/revision.sed
— tool/revision.sed (revision 0)
+++ tool/revision.sed (revision 0)
@@ -0,0 +1,5 @@
+#!/bin/sed -f
+/^#include “revision.h”/{
+r revision.h
+d
+}
Property changes on: tool/revision.sed
Name: svn:eol-type
- LF
Name: svn:executable -
Index: tool/svninfo.sed
— tool/svninfo.sed (revision 0)
+++ tool/svninfo.sed (revision 0)
@@ -0,0 +1,25 @@
+#!/bin/sed -f
+:swarp;$!{N;b swarp}
+s/\n/ /g
+s/ / /g
+s/(.)<url>[^<>]>([^<>])</url>/url=\2\n\1/
+s/(.)<root>[^<>]>([^<>])</root>/root=\2\n\1/
+s/^root=(.)\nurl=\1///
+s/^branches///
+s/^[^\n]/#define RUBY_BRANCH_NAME “&”/
+P
+s/^.\n//
+s/.<commit>([^<>])>(.)</commit>./\1\n\2/
+s/[^\n]<revision="([^\n])"[^\n]/#define RUBY_REVISION \1/
+P
+s/^.\n//
+s/.<date>[^<>]>(.)</date>./\1/
+s/.<(([1-9][0-9])-(0*([1-9][0-9]))-(0([1-9][0-9]*)))T[0-9.:]Z./
+#define RUBY_RELEASE_DATE “\1”
+#define RUBY_RELEASE_CODE \2\3\5
+#define RUBY_RELEASE_YEAR \2
+#define RUBY_RELEASE_MONTH \4
+#define RUBY_RELEASE_DAY \6
+/
+s/^\n//
+s/\n$//
Property changes on: tool/svninfo.sed
Name: svn:executable
Name: svn:eol-style
- LF
Index: win32/Makefile.sub
— win32/Makefile.sub (revision 12064)
+++ win32/Makefile.sub (working copy)
@@ -197,4 +197,14 @@ ASMEXT = asm
INSTALLED_LIST= .installed.list
+IFCHANGE = $(COMSPEC) /C $(srcdir:/=)\win32\ifchange.bat
+
+!if [find “revision.h” $(srcdir:/=)\version.h > nul] == 0
+REVISION_H = revision.h
+REVISION_UP = revision-up
+!else
+REVISION_H = version.h
+REVISION_UP =
+!endif
+
WINMAINOBJ = winmain.$(OBJEXT)
MINIOBJS = dmydln.$(OBJEXT)
@@ -219,5 +229,5 @@ config.status: $(CONFIG_H)
$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
@echo Creating config.h
- @$(COMSPEC) /C $(srcdir:/=)\win32\ifchange.bat config.h <<
- @$(IFCHANGE) config.h <<
#if _MSC_VER != $(MSC_VER)
#error MSC version unmatch
@@ -561,2 +571,5 @@ dir.$(OBJEXT) win32.$(OBJEXT): {$(srcdir
ext/extinit.obj: ext/extinit.c $(SETUP)
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fo$@ -c ext/extinit.c
±update-revision-: $(srcdir)/new_rev.h
- @$(IFCHANGE) $(srcdir:/=)\revision.h $(srcdir:/=)\new_rev.h