[前][次][番号順一覧][スレッド一覧]

ruby-changes:41231

From: nobu <ko1@a...>
Date: Fri, 25 Dec 2015 22:43:38 +0900 (JST)
Subject: [ruby-changes:41231] nobu:r53303 (trunk): version.h: RUBY_RELEASE_DATE from YMD

nobu	2015-12-25 22:43:29 +0900 (Fri, 25 Dec 2015)

  New Revision: 53303

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53303

  Log:
    version.h: RUBY_RELEASE_DATE from YMD
    
    * configure.in: extract RUBY_RELEASE_DAY at generating Makefile.
    * version.h (RUBY_RELEASE_DATE): construct from RUBY_RELEASE_YEAR,
      RUBY_RELEASE_MONTH, and RUBY_RELEASE_DAY.

  Modified files:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/configure.in
    trunk/version.h
Index: configure.in
===================================================================
--- configure.in	(revision 53302)
+++ configure.in	(revision 53303)
@@ -4409,7 +4409,12 @@ AC_CONFIG_FILES(Makefile, [ https://github.com/ruby/ruby/blob/trunk/configure.in#L4409
 		["git svn"], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
 		[git],       [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
 		[VCSUP='$(VCS)'])
-	sed -n 's/^@%:@define \(RUBY_RELEASE_DATE\) "\(.*\)"/\1 = \2/p' "$srcdir/version.h"
+	sed -n \
+	    -e '[/^@%:@define \(RUBY_RELEASE_[A-Z]*\) \([0-9][0-9]*\)/]{' \
+	    -e   's//\1 = \2/' \
+	    -e   '[s/ \([0-9]\)$/ 0\1/]' \
+	    -e   p \
+	    -e '}' "$srcdir/version.h"
 	sed '/^MISSING/s/\$U\././g;/^VCS *=/s#@VCS@#'"$VCS"'#;/^VCSUP *=/s#@VCSUP@#'"$VCSUP"'#' Makefile
 	echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
 	if test "$gnumake" != yes; then
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53302)
+++ ChangeLog	(revision 53303)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Dec 25 22:43:26 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in: extract RUBY_RELEASE_DAY at generating Makefile.
+
+	* version.h (RUBY_RELEASE_DATE): construct from RUBY_RELEASE_YEAR,
+	  RUBY_RELEASE_MONTH, and RUBY_RELEASE_DAY.
+
 Fri Dec 25 21:33:06 2015  Yukihiro Matsumoto  <matz@r...>
 
 	* version.h (RUBY_VERSION): 2.4.0 development has started.
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 53302)
+++ Makefile.in	(revision 53303)
@@ -90,6 +90,7 @@ POSTLINK = @POSTLINK@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L90
 
 RUBY_BASE_NAME=@RUBY_BASE_NAME@
 RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
+RUBY_RELEASE_DATE = $(RUBY_RELEASE_YEAR)-$(RUBY_RELEASE_MONTH)-$(RUBY_RELEASE_DAY)
 RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
 RUBY_SO_NAME=@RUBY_SO_NAME@
 EXEEXT = @EXEEXT@
Index: version.h
===================================================================
--- version.h	(revision 53302)
+++ version.h	(revision 53303)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1
 #define RUBY_VERSION "2.4.0"
-#define RUBY_RELEASE_DATE "2015-12-25"
+#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
 #define RUBY_PATCHLEVEL -1
 
 #define RUBY_RELEASE_YEAR 2015
@@ -8,6 +8,22 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L8
 
 #include "ruby/version.h"
 
+#ifndef TOKEN_PASTE
+#define TOKEN_PASTE(x,y) x##y
+#endif
+#define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000
+#define RUBY_RELEASE_YEAR_STR STRINGIZE(RUBY_RELEASE_YEAR)
+#if ONLY_ONE_DIGIT(RUBY_RELEASE_MONTH)
+#define RUBY_RELEASE_MONTH_STR "0"STRINGIZE(RUBY_RELEASE_MONTH)
+#else
+#define RUBY_RELEASE_MONTH_STR STRINGIZE(RUBY_RELEASE_MONTH)
+#endif
+#if ONLY_ONE_DIGIT(RUBY_RELEASE_DAY)
+#define RUBY_RELEASE_DAY_STR "0"STRINGIZE(RUBY_RELEASE_DAY)
+#else
+#define RUBY_RELEASE_DAY_STR STRINGIZE(RUBY_RELEASE_DAY)
+#endif
+
 #if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
 # if RUBY_LIB_VERSION_STYLE == 3
 #   define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)"."STRINGIZE(RUBY_API_VERSION_TEENY)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]