tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [RFC] Ruby version handling changes



On Thu, 03 Jul 2014 22:22:09 +0900, Greg Troxel <gdt%ir.bbn.com@localhost> 
wrote:


"OBATA Akio" <obata%lins.jp@localhost> writes:

+# RUBY_VERSIONS_ACCEPTED
 #      The Ruby versions that are acceptable for the package.
 #
 #              Possible values: 18 193 200 21
 #              Default: 200 193 18 21

This is an ordered list, it seems.   Perhaps that's really obvious, but
it would be nice to have a comment explaining that the user's default is
used if it's in the list, and otherwise the first one (filtered by
versions that are missing on this platform??).

Just a rename of variable.

-RUBY_VERSION_SUPPORTED?= 200 193 18 21
+RUBY_VERSIONS_ACCEPTED?= ${RUBY_VERSION_SUPPORTED:U200 193 18 21}
+RUBY_VERSIONS_INCOMPATIBLE?=   # empty

Presumably there should be a warning for use of a deprecated variable.
Or, it could be in pkglint.

I would like to "deprecate" after 2014Q3 out, to be pullup easier.

Index: lang/ruby/rubyversion.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby/rubyversion.mk,v
retrieving revision 1.122
diff -u -r1.122 rubyversion.mk
--- lang/ruby/rubyversion.mk    14 Aug 2014 03:59:22 -0000      1.122
+++ lang/ruby/rubyversion.mk    24 Aug 2014 01:16:29 -0000
@@ -33,17 +33,27 @@
 #      Ruby version to use. This variable should not be set in
 #      packages.  Normally it is used by bulk build tools.
 #
-#              Possible values: ${RUBY_VERSION_SUPPORTED}
+#              Possible values: ${RUBY_VERSIONS_ACCEPTED}
 #              Default:         ${RUBY_VERSION_DEFAULT}
 #
 # === Package-settable variables ===
 #
-# RUBY_VERSION_SUPPORTED
+# RUBY_VERSIONS_ACCEPTED
 #      The Ruby versions that are acceptable for the package.
 #
 #              Possible values: 18 193 200 21
 #              Default: 200 193 18 21
 #
+# RUBY_VERSIONS_INCOMPATIBLE
+#      The Ruby versions that are NOT acceptable for the package
+#
+#              Possible values: 18 193 200 21
+#              Default: (empty)
+#
+# RUBY_VERSION_SUPPORTED
+#      Deprecated.  Use RUBY_VERSIONS_ACCEPTED instead.
+#
+#
 # RUBY_NOVERSION
 #      If "Yes", the package dosen't depend on any version of Ruby, such
 #      as editing mode for emacs.  In this case, package's name would begin
@@ -232,30 +242,37 @@
 #
 RUBY_VERSION_DEFAULT?= 200

-RUBY_VERSION_SUPPORTED?= 200 193 18 21
+.if defined(RUBY_VERSION_SUPPORTED)
+#WARNINGS+=            "RUBY_VERSION_SUPPORTED is deprecated, please use 
RUBY_VERSIONS_ACCEPTED"
+RUBY_VERSIONS_ACCEPTED=        ${RUBY_VERSION_SUPPORTED}
+.endif
+RUBY_VERSIONS_ACCEPTED?= 200 193 18 21
+RUBY_VERSIONS_INCOMPATIBLE?=   # empty

 .if defined(RUBY_VERSION_REQD)
-. for rv in ${RUBY_VERSION_SUPPORTED}
-.  if "${rv}" == ${RUBY_VERSION_REQD}
-RUBY_VER=      ${rv}
-.  endif
-. endfor
-.elif !defined(RUBY_VER)
-. for rv in ${RUBY_VERSION_SUPPORTED}
-.  if "${rv}" == ${RUBY_VERSION_DEFAULT}
-RUBY_VER=      ${rv}
-.  endif
-. endfor
+RUBY_VER=      ${RUBY_VERSION_REQD}
+. if !empty(RUBY_VERSIONS_ACCEPTED:M${RUBY_VERSION_REQD}) &&   \
+       empty(RUBY_VERSIONS_INCOMPATIBLE:M${RUBY_VERSION_REQD})
+. else
+PKG_FAIL_REASON=       "No valid Ruby version"
+. endif
+.elif !defined(RUBY_VER) && \
+       !empty(RUBY_VERSIONS_ACCEPTED:M${RUBY_VERSION_DEFAULT}) &&      \
+       empty(RUBY_VERSIONS_INCOMPATIBLE:M${RUBY_VERSION_DEFAULT})
+RUBY_VER=      ${RUBY_VERSION_DEFAULT}
 .endif

 .if !defined(RUBY_VER)
-. for rv in ${RUBY_VERSION_SUPPORTED}
-.  if !defined(RUBY_VER)
+. for rv in ${RUBY_VERSIONS_ACCEPTED}
+.  if !defined(RUBY_VER) && empty(RUBY_VERSIONS_INCOMPATIBLE:M${rv})
 RUBY_VER=      ${rv}
 .  endif
 . endfor
 .endif

+.if !defined(RUBY_VER)
+PKG_FAIL_REASON=       "No valid Ruby version"
+.endif
 RUBY_VER:=     ${RUBY_VER_MAP.${RUBY_VER}:U${RUBY_VER}}

 RUBY_SUFFIX?=  ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}${_RUBY_VER_TEENY}

--
OBATA Akio / obata%lins.jp@localhost


Home | Main Index | Thread Index | Old Index