pkg_version: allow HeadVersion and HEAD revisions

This commit is contained in:
Vlad Shablinsky 2016-06-18 20:52:01 +03:00 committed by Xu Cheng
parent 80489dcb49
commit 9ac5836604
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE

View File

@ -7,13 +7,13 @@ class PkgVersion
def self.parse(path)
_, version, revision = *path.match(RX)
version = Version.new(version)
version = Version.create(version)
new(version, revision.to_i)
end
def initialize(version, revision)
@version = version
@revision = version.head? ? 0 : revision
@revision = revision
end
def head?