aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2014-08-23 20:57:52 +0200
committerAndré Erdmann <dywi@mailerd.de>2014-08-23 20:57:52 +0200
commite27f0b7bfc4555d1ac9720e2545d01c584d318d3 (patch)
tree2db8d8d71b6c24ea946865bbb226c69dc2aa4d7e
parentroverlay/depres, slot rules: fix get_slot_result() (diff)
downloadR_overlay-e27f0b7bfc4555d1ac9720e2545d01c584d318d3.tar.gz
R_overlay-e27f0b7bfc4555d1ac9720e2545d01c584d318d3.tar.bz2
R_overlay-e27f0b7bfc4555d1ac9720e2545d01c584d318d3.zip
roverlay/depres/depenv: skip vmod dict lookup
When checking/normalizing vmod_str, set vmod directly if possible.
-rw-r--r--roverlay/depres/depenv.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/roverlay/depres/depenv.py b/roverlay/depres/depenv.py
index 7d1bf5e..c0ea6e1 100644
--- a/roverlay/depres/depenv.py
+++ b/roverlay/depres/depenv.py
@@ -218,14 +218,19 @@ class DepEnv ( object ):
# fix versions like ".9" (-> "0.9")
if version [0] == '.': version = '0' + version
- vmod = m.group ( 'vmod' )
+ vmod_str = m.group ( 'vmod' )
- if not vmod:
+ if not vmod_str:
# version required, but no modifier: set vmod to '>='
- vmod = '>='
- elif vmod == '==':
+ vmod = self.VMOD_GE
+ vmod_str = '>='
+ #vmod_weak = True # for slot-resolve // TODO-MAYBE
+ elif vmod_str == '==':
# "normalize"
- vmod = '='
+ vmod = self.VMOD_EQ
+ vmod_str = '='
+ else:
+ vmod = self.VMOD.get ( vmod_str, self.VMOD_UNDEF )
version_strlist = version.split ( '.' )
version_iparts = list()
@@ -243,13 +248,13 @@ class DepEnv ( object ):
result.append ( dict (
name = m.group ( 'name' ),
name_low = m.group ( 'name' ).lower(),
- version_modifier = vmod,
+ version_modifier = vmod_str,
version = version,
version_strlist = version_strlist,
version_tuple = roverlay.versiontuple.IntVersionTuple (
version_iparts
),
- vmod = self.VMOD.get ( vmod, self.VMOD_UNDEF ),
+ vmod = vmod,
) )
if not self.try_all_regexes: break