From b7269da23a03d1e07e38c9e27fa5da4c727bcd1e Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 21 Sep 2011 14:34:27 -0400 Subject: [PATCH] Fix is_beta -> isfinal and add [Compose] to .buildstamp --- src/pylorax/__init__.py | 6 +++--- src/pylorax/buildstamp.py | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index 5ed988de..5160e6cb 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -124,7 +124,7 @@ class Lorax(BaseLoraxClass): logger.addHandler(fh) def run(self, ybo, product, version, release, variant="", bugurl="", - is_beta=False, workdir=None, outputdir=None): + isfinal=False, workdir=None, outputdir=None): assert self._configured @@ -169,7 +169,7 @@ class Lorax(BaseLoraxClass): logger.info("setting up build parameters") product = DataHolder(name=product, version=version, release=release, - variant=variant, bugurl=bugurl, is_beta=is_beta) + variant=variant, bugurl=bugurl, isfinal=isfinal) self.product = product logger.debug("product data: %s" % product) @@ -184,7 +184,7 @@ class Lorax(BaseLoraxClass): # write .buildstamp buildstamp = BuildStamp(self.product.name, self.product.version, - self.product.bugurl, self.product.is_beta, self.arch.buildarch) + self.product.bugurl, self.product.isfinal, self.arch.buildarch) buildstamp.write(joinpaths(self.inroot, ".buildstamp")) diff --git a/src/pylorax/buildstamp.py b/src/pylorax/buildstamp.py index 8d0915ea..378c7ea0 100644 --- a/src/pylorax/buildstamp.py +++ b/src/pylorax/buildstamp.py @@ -27,22 +27,25 @@ import datetime class BuildStamp(object): - def __init__(self, product, version, bugurl, is_beta, buildarch): + def __init__(self, product, version, bugurl, isfinal, buildarch): self.product = product self.version = version self.bugurl = bugurl - self.is_beta = is_beta + self.isfinal = isfinal now = datetime.datetime.now() now = now.strftime("%Y%m%d%H%M") self.uuid = "{0}.{1}".format(now, buildarch) def write(self, outfile): + vernum = "treebuilder" # XXX TODO FIXME logger.info("writing .buildstamp file") with open(outfile, "w") as fobj: fobj.write("[Main]\n") fobj.write("Product={0.product}\n".format(self)) fobj.write("Version={0.version}\n".format(self)) fobj.write("BugURL={0.bugurl}\n".format(self)) - fobj.write("IsBeta={0.is_beta}\n".format(self)) + fobj.write("IsFinal={0.isfinal}\n".format(self)) fobj.write("UUID={0.uuid}\n".format(self)) + fobj.write("[Compose]\n") + fobj.write("Lorax={0}\n".format(vernum))