diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-04-23 22:15:23 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-04-23 22:15:23 +0000 |
commit | 724f0720ab42ff488e93a26ae765dafc13cd0986 (patch) | |
tree | 6a59b6d6dc9a773028ba7fb08700775910fbaa63 | |
parent | 0f60052eb01aedb8fa95c1299cac7a58f91ba40f (diff) | |
download | portage-724f0720ab42ff488e93a26ae765dafc13cd0986.tar.gz portage-724f0720ab42ff488e93a26ae765dafc13cd0986.tar.bz2 portage-724f0720ab42ff488e93a26ae765dafc13cd0986.zip |
Move endversion and endversion_keys to portage_versions and import them for backward compatibility.
svn path=/main/trunk/; revision=3202
-rw-r--r-- | pym/portage.py | 15 | ||||
-rw-r--r-- | pym/portage_versions.py | 2 |
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): |