summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage.py15
-rw-r--r--pym/portage_versions.py2
2 files changed, 6 insertions, 11 deletions
diff --git a/pym/portage.py b/pym/portage.py
index e9b965c7f..acd34f1f4 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -96,6 +96,10 @@ try:
# Need these functions directly in portage namespace to not break every external tool in existence
from portage_versions import ververify,vercmp,catsplit,catpkgsplit,pkgsplit,pkgcmp
+ # endversion and endversion_keys are for backward compatibility only.
+ from portage_versions import endversion_keys
+ from portage_versions import suffix_value as endversion
+
except ImportError, e:
sys.stderr.write("\n\n")
sys.stderr.write("!!! Failed to complete portage imports. There are internal modules for\n")
@@ -495,17 +499,6 @@ def elog_process(cpv, mysettings):
except portage_exception.PortageException, e:
print e
-# valid end of version components; integers specify offset from release version
-# pre=prerelease, p=patchlevel (should always be followed by an int), rc=release candidate
-# all but _p (where it is required) can be followed by an optional trailing integer
-
-endversion={"pre":-2,"p":0,"alpha":-4,"beta":-3,"rc":-1}
-# as there's no reliable way to set {}.keys() order
-# netversion_keys will be used instead of endversion.keys
-# to have fixed search order, so that "pre" is checked
-# before "p"
-endversion_keys = ["pre", "p", "alpha", "beta", "rc"]
-
#parse /etc/env.d and generate /etc/profile.env
def env_update(makelinks=1):
diff --git a/pym/portage_versions.py b/pym/portage_versions.py
index ddb35a38c..43f45f2fc 100644
--- a/pym/portage_versions.py
+++ b/pym/portage_versions.py
@@ -3,6 +3,8 @@ import re,string
ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?$")
suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$")
suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1}
+endversion_keys = ["pre", "p", "alpha", "beta", "rc"]
+
def ververify(myver, silent=1):
if ver_regexp.match(myver):