Don't wait until packaging for borking about invalid version strings
- Current pisi borks about invalid version string just before creating .pisi file. Move that check to __init__ in Builder to fail as early as possible. - Also handle unknown keywords in version strings to not fail with unhandled exceptions.
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
translations.xml reading.
|
||||
* pisi/specfile.py (read_translations): Ignore source package
|
||||
translations if <Name> is empty in translations.xml.
|
||||
* pisi/version.py (VersionItem): Handle unknown keywords in version
|
||||
strings,
|
||||
* pisi/operations/build.py (Builder.__init__): Don't wait until
|
||||
creating .pisi file for borking about invalid version strings e.g.
|
||||
something like "0.5.6.1_x1219" in <Update> element.
|
||||
|
||||
2010-01-12 Ozan Çağlayan <ozan@pardus.org.tr>
|
||||
* pisi/actionsapi/get.py: Add ARCH() for getting host architecture.
|
||||
|
||||
@@ -184,6 +184,9 @@ class Builder:
|
||||
else:
|
||||
self.specdir = os.path.dirname(self.specuri.get_uri())
|
||||
|
||||
# Don't wait until creating .pisi file for complaining about versioning scheme errors
|
||||
self.check_versioning("%s-%s" % (self.spec.getSourceVersion(), self.spec.getSourceRelease()))
|
||||
|
||||
self.read_translations(self.specdir)
|
||||
|
||||
self.sourceArchive = pisi.sourcearchive.SourceArchive(self.spec, self.pkg_work_dir())
|
||||
@@ -957,8 +960,6 @@ 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(),
|
||||
|
||||
+11
-6
@@ -25,13 +25,15 @@ maxdashes = 2
|
||||
# p > (no suffix) > m > rc > pre > beta > alpha
|
||||
# m: milestone. this was added for OO.o
|
||||
# p: patch-level
|
||||
keywords = {"alpha": 0,
|
||||
"beta" : 1,
|
||||
"pre" : 2,
|
||||
"rc" : 3,
|
||||
"m" : 4,
|
||||
keywords = {
|
||||
"alpha" : 0,
|
||||
"beta" : 1,
|
||||
"pre" : 2,
|
||||
"rc" : 3,
|
||||
"m" : 4,
|
||||
"NOKEY" : 5,
|
||||
"p" : 6}
|
||||
"p" : 6,
|
||||
}
|
||||
|
||||
# helper functions
|
||||
def has_keyword(versionitem):
|
||||
@@ -71,6 +73,9 @@ class VersionItem:
|
||||
if len(itemstring) == 1 and itemstring in string.ascii_letters:
|
||||
# single letter version item ('a' to 'Z')
|
||||
self._value = itemstring
|
||||
elif len(itemstring) > 1 and itemstring[0] in string.ascii_letters:
|
||||
# Unknown keyword
|
||||
raise VersionException("")
|
||||
else:
|
||||
self._value = int(itemstring)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user