public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/R_overlay:overlay_wip commit in: roverlay/depres/
@ 2012-07-19 16:53 André Erdmann
  2012-07-30  8:52 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
  0 siblings, 1 reply; 3+ messages in thread
From: André Erdmann @ 2012-07-19 16:53 UTC (permalink / raw
  To: gentoo-commits

commit:     b934d0728451c9c6127edcbfc40d5d28730c64a4
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 19 16:24:48 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 19 16:24:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=b934d072

handle versions correctly that start with a dot

---
 roverlay/depres/depenv.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/roverlay/depres/depenv.py b/roverlay/depres/depenv.py
index 7cef1c9..69e9d57 100644
--- a/roverlay/depres/depenv.py
+++ b/roverlay/depres/depenv.py
@@ -73,12 +73,16 @@ class DepEnv ( object ):
 			m = r.match ( self.dep_str_low )
 			if m is not None:
 
+				version = self.__class__.FIXVERSION_REGEX.sub (
+					'.', m.group ( 'ver' )
+				)
+				# fix versions like ".9" (-> "0.9")
+				if version [0] == '.': version = '0' + version
+
 				result.append ( dict (
 					name             = m.group ( 'name' ),
 					version_modifier = m.group ( 'vmod' ),
-					version          = self.__class__.FIXVERSION_REGEX.sub (
-												'.', m.group ( 'ver' )
-											)
+					version          = version
 				) )
 
 				if not self.try_all_regexes: break



^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] proj/R_overlay:overlay_wip commit in: roverlay/depres/
@ 2012-07-30  8:52 André Erdmann
  0 siblings, 0 replies; 3+ messages in thread
From: André Erdmann @ 2012-07-30  8:52 UTC (permalink / raw
  To: gentoo-commits

commit:     6a2487574fcf8b40f42b9e3046976b3ca0658195
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 30 08:44:06 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 30 08:44:06 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=6a248757

unquote dep strings, accept == version modifier

---
 roverlay/depres/depenv.py |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/roverlay/depres/depenv.py b/roverlay/depres/depenv.py
index 69e9d57..e70c6d3 100644
--- a/roverlay/depres/depenv.py
+++ b/roverlay/depres/depenv.py
@@ -2,14 +2,18 @@
 # Copyright 2006-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 import re
+from roverlay import strutil
 
 class DepEnv ( object ):
 
 	# excluding A-Z since dep_str_low will be used to find a match
-	_NAME = '(?P<name>[a-z0-9_\-/]+)'
+	_NAME = '(?P<name>[a-z0-9_\-/.+-]+)'
 	_VER  = '(?P<ver>[0-9._\-]+)'
-	# { <, >, <=, >=, =, != } (TODO !=)
-	_VERMOD = '(?P<vmod>[<>]|[<>!]?[=])'
+	# { <, >, ==, <=, >=, =, != } (TODO !=)
+	_VERMOD = '(?P<vmod>[<>]|[=<>!]?[=])'
+
+	# FIXME: "boost library (>1.0)" not resolved as >=dev-libs/boost-1.0,
+	# regex \s
 
 	V_REGEX_STR = frozenset ( (
 		# 'R >= 2.15', 'R >=2.15' etc. (but not 'R>=2.15'!)
@@ -52,8 +56,8 @@ class DepEnv ( object ):
 		* dep_str -- dependency string at it appears in the description data.
 		"""
 		self.deptype_mask = deptype_mask
-		self.dep_str      = dep_str
-		self.dep_str_low  = dep_str.lower()
+		self.dep_str      = strutil.unquote ( dep_str )
+		self.dep_str_low  = self.dep_str.lower()
 		self.status       = DepEnv.STATUS_UNDONE
 		self.resolved_by  = None
 
@@ -79,9 +83,12 @@ class DepEnv ( object ):
 				# fix versions like ".9" (-> "0.9")
 				if version [0] == '.': version = '0' + version
 
+				vmod = m.group ( 'vmod' )
+				if vmod == '==' : vmod = '='
+
 				result.append ( dict (
 					name             = m.group ( 'name' ),
-					version_modifier = m.group ( 'vmod' ),
+					version_modifier = vmod,
 					version          = version
 				) )
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-30  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-19 16:53 [gentoo-commits] proj/R_overlay:overlay_wip commit in: roverlay/depres/ André Erdmann
2012-07-30  8:52 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
  -- strict thread matches above, loose matches on Subject: below --
2012-07-30  8:52 [gentoo-commits] proj/R_overlay:overlay_wip " André Erdmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox