add user setable version using configure

1. update setup.py-configure to add keyword pkgversion

2. If pkgversion is specified in cli.cfg, update __version__
with its value.
.
Signed-off-by: Gene Czarcinski <gene@czarc.net>
This commit is contained in:
Gene Czarcinski 2013-04-16 20:44:15 -04:00 committed by Cole Robinson
parent ad3f69e12d
commit fd8420ef1b
2 changed files with 6 additions and 0 deletions

View File

@ -221,6 +221,7 @@ class my_rpm(Command):
class configure(Command):
user_options = [
("pkgversion=", None, "user specified version-id"),
("prefix=", None, "installation prefix"),
("without-tui", None, "don't install virt-manager-tui"),
("qemu-user=", None,
@ -256,12 +257,14 @@ class configure(Command):
self.preferred_distros = ""
self.default_graphics = "vnc"
self.prefix = sysprefix
self.pkgversion = ""
def run(self):
template = ""
template += "[config]\n"
template += "prefix = %s\n" % self.prefix
template += "pkgversion = %s\n" % self.pkgversion
template += "with_tui = %s\n" % int(not self.without_tui)
template += "default_qemu_user = %s\n" % self.qemu_user
template += "libvirt_packages = %s\n" % self.libvirt_package_names

View File

@ -44,6 +44,9 @@ def _get_param(name, default):
__version__ = "0.9.100"
_usr_version = _get_param("pkgversion", "")
if _usr_version is not None and _usr_version != "":
__version__ = _usr_version
# We should map this into the config somehow but I question if anyone cares
prefix = _get_param("prefix", "/usr")