|
|
|
|
|
|
|
|
|
|
|
vercmp(ver1,
ver2,
silent=1)
Compare two versions
Example usage:
>>> from portage.versions import vercmp
>>> vercmp('1.0-r1','1.2-r3')
negative number
>>> vercmp('1.3','1.2-r3')
positive number
>>> vercmp('1.0_p3','1.0_p3')
0 |
source code
|
|
|
None or integer
|
pkgcmp(pkg1,
pkg2)
Compare 2 package versions created in pkgsplit format. |
source code
|
|
|
|
|
|
|
catpkgsplit(mydata,
silent=1,
eapi=None)
Takes a Category/Package-Version-Rev and returns a list of each. |
source code
|
|
|
|
|
|
|
cpv_getkey(mycpv,
eapi=None)
Calls catpkgsplit on a cpv and returns only the cp. |
source code
|
|
|
|
cpv_getversion(mycpv,
eapi=None)
Returns the v (including revision) from an cpv. |
source code
|
|
|
key object for sorting
|
cpv_sort_key(eapi=None)
Create an object for sorting cpvs, to be used as the 'key' parameter
in places like list.sort() or sorted(). |
source code
|
|
|
|
|
|
|
best(mymatches,
eapi=None)
Accepts None arguments; assumes matches are valid. |
source code
|
|
|
|
_unknown_repo = u'__unknown__'
|
|
|
_slot = u'([\w+][\w+.-]*)'
|
|
|
_cat = u'[\w+][\w+.-]*'
|
|
|
_pkg = {u'dots_allowed_in_PN': u'[\w+][\w+.-]*?', u'dots_disal...
|
|
|
_v = u'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)...
|
|
|
_rev = u'\d+'
|
|
|
_vr = u'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc...
|
|
|
_cp = {u'dots_allowed_in_PN': u'([\w+][\w+.-]*/[\w+][\w+.-]*?(...
|
|
|
_cpv = {u'dots_allowed_in_PN': u'(([\w+][\w+.-]*/[\w+][\w+.-]*...
|
|
|
_pv = {u'dots_allowed_in_PN': u'(?P<pn>[\w+][\w+.-]*?(?P<pn_in...
|
|
|
ver_regexp = re.compile(r'^(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(...
|
|
|
suffix_regexp = re.compile(r'^(alpha|beta|rc|pre|p)(\d*)$')
|
|
|
suffix_value = {u'alpha': -4, u'beta': -3, u'p': 0, u'pre': -2...
|
|
|
endversion_keys = [u'pre', u'p', u'alpha', u'beta', u'rc']
|
|
|
_slot_re_cache = {}
|
|
|
_pv_re_cache = {True: re.compile(r'(?ux)^(?P<pn>[\w\+][\w\+\.-...
|
|
|
_cat_re = re.compile(r'(?u)^[\w\+][\w\+\.-]*$')
|
|
|
_missing_cat = u'null'
|
|
|
__package__ = 'portage'
|