[arch] fixes related to dependency checking

This commit is contained in:
Vinicius Moreira
2021-03-02 10:58:46 -03:00
parent 2d552316db
commit 66037186a4
4 changed files with 88 additions and 23 deletions

12
bauh/gems/arch/util.py Normal file
View File

@@ -0,0 +1,12 @@
import re
RE_STRIP_EPIC = re.compile(r'^\d+:')
RE_STRIP_RELEASE = re.compile(r'-[\d\.?]+$')
def clean_version(version: str) -> str:
treated_version = version.strip()
if treated_version:
return RE_STRIP_RELEASE.split(RE_STRIP_EPIC.split(treated_version)[-1])[0]
return treated_version