[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [PATCH-v6.1 3/5] 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>
---
 setup.py             | 3 +++
 virtcli/cliconfig.py | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/setup.py b/setup.py
index f8ad290..167caf6 100644
--- a/setup.py
+++ b/setup.py
@@ -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
diff --git a/virtcli/cliconfig.py b/virtcli/cliconfig.py
index 1290e90..6b2660f 100644
--- a/virtcli/cliconfig.py
+++ b/virtcli/cliconfig.py
@@ -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")
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]