Bug 179830 - MK/bsd.ruby.mk: RUBY_PROVIDED does not returned correct result
Summary: MK/bsd.ruby.mk: RUBY_PROVIDED does not returned correct result
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: TAKATSU Tomonari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-22 06:30 UTC by TAKATSU Tomonari
Modified: 2013-06-23 08:03 UTC (History)
0 users

See Also:


Attachments
file.diff (1.59 KB, patch)
2013-06-22 06:30 UTC, TAKATSU Tomonari
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TAKATSU Tomonari freebsd_committer freebsd_triage 2013-06-22 06:30:00 UTC
RUBY_VERSION has consisted of RUBY_RELVERSION and RUBY_PATCHLEVEL since r181277.

The value of RUBY_VERSION_CODE which is defined as RUBY_VERSION:S/.//g is
influenced by the number of digits of RUBY_PATCHLEVEL

For examples:

 In r312871
  RUBY_RELVERSION is 1.9.3, 
  RUBY_PATCHLEVEL is 385

  -> RUBY_VERSION_CODE is 193385

  RUBY_RELVERSION is 2.0.0, 
  RUBY_PATCHLEVEL is 0

  -> RUBY_VERSION_CODE is 2000

Consequently, RUBY_PROVIDED does not returned correct result
if RUBY_REQUIRE is defined as Ruby >= 193 in RUBY_DEFAULT_VER=2.0 environment.

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-22 06:30:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ruby

bsd.ruby.mk is ruby territory (via the GNATS Auto Assign Tool)
Comment 2 Steve Wills freebsd_committer freebsd_triage 2013-06-23 03:20:59 UTC
Responsible Changed
From-To: ruby->tota

submitter is ruby committer
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-06-23 07:57:53 UTC
Author: tota
Date: Sun Jun 23 06:57:46 2013
New Revision: 321622
URL: http://svnweb.freebsd.org/changeset/ports/321622

Log:
  - Fix the value of RUBY_PROVIDED to be able to compare with
    RUBY_REQUIRE correctly
  - Define RUBY_RELVERSION_CODE
  - Add descriptions about RUBY_RELVERSION and RUBY_RELVERSION_CODE
  
  PR:		ports/179830
  Submitted by:	tota (myself)

Modified:
  head/Mk/bsd.ruby.mk

Modified: head/Mk/bsd.ruby.mk
==============================================================================
--- head/Mk/bsd.ruby.mk	Sun Jun 23 06:35:15 2013	(r321621)
+++ head/Mk/bsd.ruby.mk	Sun Jun 23 06:57:46 2013	(r321622)
@@ -69,10 +69,15 @@ Ruby_Include_MAINTAINER=	ruby@FreeBSD.or
 #
 # RUBY_PKGNAMEPREFIX	- Common PKGNAMEPREFIX for ruby ports
 #			  (default: ruby${RUBY_SUFFIX}-)
-# RUBY_VERSION		- Full version of ruby without preview/beta suffix in
+# RUBY_RELVERSION	- Full version of ruby without preview/beta suffix in
 #			  the form of `x.y.z' (see below for current value).
-# RUBY_VERSION_CODE	- Full integer version of ruby without preview/beta
-#			  suffix in the form of `xyz'.
+# RUBY_RELVERSION_CODE	- Integer version of RUBY_RELVERSION in the form of
+#			  `xyz'.
+# RUBY_VERSION		- Composite version of RUBY_RELVERSION and
+#			  RUBY_PATCHLEVEL in the form of `x.y.z.p'.
+#			  (default: ${RUBY_RELVERSION}.${RUBY_PATCHLEVEL})
+# RUBY_VERSION_CODE	- Composite integer version of RUBY_VERSION in the form
+#			  of `xyzp'.
 # RUBY_PORTVERSION	- PORTVERSION for the standard ruby ports (ruby,
 #			  ruby-gdbm, etc.).
 # RUBY_PORTREVISION	- PORTREVISION for the standard ruby ports.
@@ -275,6 +280,7 @@ RUBY_DISTNAME?=		ruby-${RUBY_DISTVERSION
 
 RUBY_WRKSRC?=		${WRKDIR}/${RUBY_DISTNAME}
 
+RUBY_RELVERSION_CODE?=	${RUBY_RELVERSION:S/.//g}
 RUBY_VERSION_CODE?=	${RUBY_VERSION:S/.//g}
 RUBY_VER=		${RUBY_VERSION:C/([[:digit:]]+\.[[:digit:]]+).*/\1/}
 RUBY_SUFFIX=		${RUBY_VER:S/.//}
@@ -362,7 +368,7 @@ USE_RUBY=		yes
 
 .if exists(${RUBY})
 RUBY_PROVIDED!=		${RUBY} -e '\
-	Ruby = ${RUBY_VERSION_CODE}; \
+	Ruby = ${RUBY_RELVERSION_CODE}; \
 	value = begin; ${RUBY_REQUIRE}; end and puts value'
 .else
 RUBY_PROVIDED=		"should be"	# the latest version is going to be installed
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 TAKATSU Tomonari freebsd_committer freebsd_triage 2013-06-23 08:02:49 UTC
State Changed
From-To: open->closed

Committed. Thanks!