fix version calculation on gentoo

This commit is contained in:
Fredrik Eriksson 2021-07-04 14:52:35 +02:00
parent f5adcbc140
commit 214ec6abad
Signed by: feffe
GPG Key ID: F4329687B0FA7F8D

View File

@ -102,10 +102,7 @@ def pkg_upgrade():
_sync_portage()
# [ebuild U ] media-plugins/alsa-plugins-1.1.8 [1.1.6]
pretend_re = re.compile(r'^\[(?:ebuild|binary) ([^\]]*)\] ([^ ]+)( \[[^\]]+\])?')
# media-plugins/alsa-plugins-1.1.8
version_re = re.compile(r'^(.*/.*)-(\d+.*)$')
pretend_re = re.compile(r'^\[(?:ebuild|binary) ([^\]]*)\] ([^ ]+?)-(\d[-\.\w]*)( \[[^\]]+\])?')
ignore_re = re.compile(r'^(|.*caus.* rebuilds.*|.*scheduled for merge.*|.*waiting for lock on.*)$')
default_version_sens = conf.getint('default', 'version_sensitivity', fallback=1)
@ -131,20 +128,18 @@ def pkg_upgrade():
continue
status = match.group(1)
name = match.group(2)
old = match.group(3)
new = match.group(3)
old = match.group(4)
if not old:
continue
old = old.strip(' []')
nmatch = re.match(version_re, name)
name = nmatch.group(1)
version = nmatch.group(2)
sens = conf.getint('packages', name, fallback=default_version_sens)
common = sau.helpers.version_diff(version, old)
common = sau.helpers.version_diff(new, old)
if sens >= common:
log.info('{} -- {} -> {} configured level {} >= pkg level {}'.format(name, old, version, sens, common))
log.info('{} -- {} -> {} configured level {} >= pkg level {}'.format(name, old, new, sens, common))
else:
log.warning('{} -- {} -> {} configured level {} < pkg level {}'.format(name, old, version, sens, common))
log.warning('{} -- {} -> {} configured level {} < pkg level {}'.format(name, old, new, sens, common))
do_rebuild = False
if not do_rebuild: