Write the lorax verion in the .buildstamp (#689697)
(cherry picked from commit 4271e0fc02
)
Conflicts:
src/pylorax/buildstamp.py
Signed-off-by: Will Woods <wwoods@redhat.com>
This commit is contained in:
parent
0236440581
commit
73fc20b165
3
Makefile
3
Makefile
@ -13,6 +13,7 @@ all:
|
|||||||
$(PYTHON) setup.py build
|
$(PYTHON) setup.py build
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
|
@echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py
|
||||||
$(PYTHON) setup.py install --root=$(DESTDIR)
|
$(PYTHON) setup.py install --root=$(DESTDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@ -28,7 +29,7 @@ archive: tag
|
|||||||
|
|
||||||
local:
|
local:
|
||||||
@rm -rf $(PKGNAME)-$(VERSION).tar.bz2
|
@rm -rf $(PKGNAME)-$(VERSION).tar.bz2
|
||||||
@rm -rf /tmp/$(PKGNAME)-$(VERSION) /tmp/$(PKGNAME)
|
@rm -rf /tmp/$(PKGNAME)-$(VERSION)
|
||||||
@dir=$$PWD; cp -a $$dir /tmp/$(PKGNAME)-$(VERSION)
|
@dir=$$PWD; cp -a $$dir /tmp/$(PKGNAME)-$(VERSION)
|
||||||
@rm -rf /tmp/$(PKGNAME)-$(VERSION)/.git
|
@rm -rf /tmp/$(PKGNAME)-$(VERSION)/.git
|
||||||
@dir=$$PWD; cd /tmp; tar --bzip2 -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.bz2 $(PKGNAME)-$(VERSION)
|
@dir=$$PWD; cd /tmp; tar --bzip2 -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.bz2 $(PKGNAME)-$(VERSION)
|
||||||
|
15
setup.py
15
setup.py
@ -3,6 +3,7 @@
|
|||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
# config file
|
# config file
|
||||||
@ -17,8 +18,20 @@ for root, dnames, fnames in os.walk("share"):
|
|||||||
# executable
|
# executable
|
||||||
data_files.append(("/usr/sbin", ["src/sbin/lorax", "src/sbin/mkefiboot"]))
|
data_files.append(("/usr/sbin", ["src/sbin/lorax", "src/sbin/mkefiboot"]))
|
||||||
|
|
||||||
|
# get the version
|
||||||
|
sys.path.insert(0, "src")
|
||||||
|
try:
|
||||||
|
import pylorax.version
|
||||||
|
except ImportError:
|
||||||
|
vernum = "devel"
|
||||||
|
else:
|
||||||
|
vernum = pylorax.version.num
|
||||||
|
finally:
|
||||||
|
sys.path = sys.path[1:]
|
||||||
|
|
||||||
|
|
||||||
setup(name="lorax",
|
setup(name="lorax",
|
||||||
version="0.1",
|
version=vernum,
|
||||||
description="Lorax",
|
description="Lorax",
|
||||||
long_description="",
|
long_description="",
|
||||||
author="Martin Gracik",
|
author="Martin Gracik",
|
||||||
|
@ -38,7 +38,14 @@ class BuildStamp(object):
|
|||||||
self.uuid = "{0}.{1}".format(now, buildarch)
|
self.uuid = "{0}.{1}".format(now, buildarch)
|
||||||
|
|
||||||
def write(self, outfile):
|
def write(self, outfile):
|
||||||
vernum = "treebuilder" # XXX TODO FIXME
|
# get lorax version
|
||||||
|
try:
|
||||||
|
import pylorax.version
|
||||||
|
except ImportError:
|
||||||
|
vernum = "devel"
|
||||||
|
else:
|
||||||
|
vernum = pylorax.version.num
|
||||||
|
|
||||||
logger.info("writing .buildstamp file")
|
logger.info("writing .buildstamp file")
|
||||||
with open(outfile, "w") as fobj:
|
with open(outfile, "w") as fobj:
|
||||||
fobj.write("[Main]\n")
|
fobj.write("[Main]\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user