109 |
return (nrs[0], nrs[1]) |
return (nrs[0], nrs[1]) |
110 |
|
|
111 |
|
|
112 |
def get_safe_max_version(version): |
def get_safe_max_version(version, module=None): |
113 |
if not re_majmin.match(version): |
if not re_majmin.match(version): |
114 |
return None |
return None |
115 |
|
|
116 |
majmin_nr = map(long, re_majmin.sub(r'\1', version).split('.')) |
majmin = get_majmin(version, module) |
117 |
|
|
118 |
if majmin_nr[1] % 2 == 0: |
min_nr = long(majmin[1]) |
119 |
return "%d.%d" % (majmin_nr[0], majmin_nr[1] + 1) |
|
120 |
|
if min_nr % 2 == 0: |
121 |
|
return "%s.%d" % (majmin[0], min_nr + 1) |
122 |
else: |
else: |
123 |
return "%d.%d" % (majmin_nr[0], majmin_nr[1] + 2) |
return "%s.%d" % (majmin[0], min_nr + 2) |
124 |
|
|
125 |
def judge_version_increase(version_old, version_new, module=None): |
def judge_version_increase(version_old, version_new, module=None): |
126 |
"""Judge quality of version increase: |
"""Judge quality of version increase: |
304 |
"""Update specfile (increase version)""" |
"""Update specfile (increase version)""" |
305 |
cur_version = self.version |
cur_version = self.version |
306 |
|
|
307 |
(judgement, msg) = judge_version_increase(cur_version, version) |
(judgement, msg) = judge_version_increase(cur_version, version, self.module) |
308 |
|
|
309 |
if judgement < 0: |
if judgement < 0: |
310 |
print >>sys.stderr, "ERROR: %s!" % (msg) |
print >>sys.stderr, "ERROR: %s!" % (msg) |
775 |
sys.stdout.write(package) |
sys.stdout.write(package) |
776 |
sys.stdout.write("\t%s\t%s" % (spec_version, package_version)) |
sys.stdout.write("\t%s\t%s" % (spec_version, package_version)) |
777 |
|
|
778 |
safe_max_version = get_safe_max_version(spec_version) |
safe_max_version = get_safe_max_version(spec_version, module=module) |
779 |
|
|
780 |
versions = Upstream.versions(module) |
versions = Upstream.versions(module) |
781 |
if versions: |
if versions: |