Check versioning of the package while building and installing
BUG:FIXED:5493
This commit is contained in:
@@ -123,6 +123,7 @@ class Install(AtomicOperation):
|
||||
|
||||
self.ask_reinstall = ask_reinstall
|
||||
self.check_requirements()
|
||||
self.check_versioning("%s-%s" % (self.pkginfo.version, self.pkginfo.release))
|
||||
self.check_relations()
|
||||
self.check_operation()
|
||||
self.extract_install()
|
||||
@@ -151,6 +152,10 @@ class Install(AtomicOperation):
|
||||
import pisi.comariface as comariface
|
||||
comariface.get_iface()
|
||||
|
||||
def check_versioning(self, version):
|
||||
if not pisi.version.Version.valid(version):
|
||||
raise Error("%s is not a valid PiSi version format" % version)
|
||||
|
||||
def check_relations(self):
|
||||
# check dependencies
|
||||
if not ctx.config.get_option('ignore_dependency'):
|
||||
|
||||
@@ -480,6 +480,10 @@ class Builder:
|
||||
os.chdir(curDir)
|
||||
return True
|
||||
|
||||
def check_versioning(self, version):
|
||||
if not pisi.version.Version.valid(version):
|
||||
raise Error("%s is not a valid PiSi version format" % version)
|
||||
|
||||
def check_build_dependencies(self):
|
||||
"""check and try to install build dependencies, otherwise fail."""
|
||||
|
||||
@@ -882,6 +886,8 @@ class Builder:
|
||||
self.metadata.package.build = build_no
|
||||
self.metadata.write(pisi.util.join_path(self.pkg_dir(), ctx.const.metadata_xml))
|
||||
|
||||
self.check_versioning("%s-%s" % (self.spec.getSourceVersion(), self.spec.getSourceRelease()))
|
||||
|
||||
# Calculate new and oldpackage names for buildfarm
|
||||
name = pisi.util.package_name(package.name,
|
||||
self.spec.getSourceVersion(),
|
||||
|
||||
+8
-2
@@ -128,10 +128,16 @@ class VersionItem:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
class Version:
|
||||
|
||||
@staticmethod
|
||||
def valid(version):
|
||||
try:
|
||||
pisi.version.Version(version)
|
||||
except pisi.version.VersionException, e:
|
||||
return False
|
||||
return True
|
||||
|
||||
def __init__(self, verstring):
|
||||
# PiSi version policy does not allow "-" in version strings.
|
||||
# They are special and used for build and release no separation.
|
||||
|
||||
Reference in New Issue
Block a user