Skip to content

Commit

Permalink
Fix issues introduced by new semantic-version ... version
Browse files Browse the repository at this point in the history
There were some changes in how "partial" version were handled and
Knossos relied on the old behavior. I hope that this should fix the
issues by filling in missing parts of the versions where necessary.
  • Loading branch information
asarium committed Feb 2, 2020
1 parent ae1b964 commit 2cce68c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __pycache__
build
dist
version-rthook.py
/knossos/parser.out
/knossos/ui/*
/knossos/data/resources.rcc
/knossos/data/resources.qrc
Expand Down
2 changes: 1 addition & 1 deletion knossos/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def set(self, values):
self.mid = values['id']
self.title = values['title']
self.mtype = values.get('type', 'mod') # Backwards compatibility
self.version = semantic_version.Version(values['version'], partial=True)
self.version = semantic_version.Version.coerce(values['version'])
self.stability = values.get('stability', 'stable')
self.parent = values.get('parent', 'FS2')
self.cmdline = values.get('cmdline', '')
Expand Down
2 changes: 1 addition & 1 deletion knossos/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _get_mod(self, mid, spec=None, mod_repo=None):
spec = None
else:
if re.search(r'^\d+', spec):
spec = '==' + spec
spec = '==' + str(semantic_version.Version.coerce(spec))

try:
spec = util.Spec(spec)
Expand Down

0 comments on commit 2cce68c

Please sign in to comment.