[checkmk-commits] Check_MK Git: check_mk: #2067 FIX windows agent: product version is no longer set to 1.0.0

Andreas Boesl ab at mathias-kettner.de
Wed Apr 15 10:40:31 CEST 2015


Module: check_mk
Branch: master
Commit: 651f6425439eaf8da1490cc81641f3cb0d7ea469
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=651f6425439eaf8da1490cc81641f3cb0d7ea469

Author: Andreas Boesl <ab at mathias-kettner.de>
Date:   Wed Apr 15 10:39:48 2015 +0200

#2067 FIX windows agent: product version is no longer set to 1.0.0

The windows agent no longer has a fixed product version of 1.0.0.
Instead it now shows product versions like 1.2.6.142 (Check_MK version + revision)
or 15.4.15.152 (Daily Build 2015.04.15 + revision)

---

 .werks/2067                        |   13 +++++++++++++
 ChangeLog                          |    3 ++-
 agents/windows/msibuild/msi-update |   21 +++++++++++++++++----
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/.werks/2067 b/.werks/2067
new file mode 100644
index 0000000..872b00c
--- /dev/null
+++ b/.werks/2067
@@ -0,0 +1,13 @@
+Title: windows agent: product version is no longer set to 1.0.0
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1429086999
+
+The windows agent no longer has a fixed product version of 1.0.0.
+Instead it now shows product versions like 1.2.6.142 (Check_MK version + revision)
+or 15.4.15.152 (Daily Build 2015.04.15 + revision)
+
diff --git a/ChangeLog b/ChangeLog
index fac4580..7bd6dd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -324,10 +324,11 @@
     * 2198 FIX: windows_updates: Fix missing warning if reboot required in case forced reboot is in the past...
     * 1955 FIX: lnx_quota: Fixed status message to show the correct values of limits...
     * 2064 FIX: windows agent: crash.log now uses \r\n as newline
-    * 2065 FIX: windows agent: now correctly installs service with elevated privileges...
     * 2202 FIX: hr_fs: Remove Label:... from mount point, replace \ with /...
             NOTE: Please refer to the migration notes!
+    * 2065 FIX: windows agent: now correctly installs service with elevated privileges...
     * 2179 FIX: apc_symmetra: Fixed regression introduced with last release when output state is empty
+    * 2067 FIX: windows agent: product version is no longer set to 1.0.0...
 
     Multisite:
     * 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/agents/windows/msibuild/msi-update b/agents/windows/msibuild/msi-update
index 71d97e0..8b5ac0c 100755
--- a/agents/windows/msibuild/msi-update
+++ b/agents/windows/msibuild/msi-update
@@ -47,16 +47,29 @@ try:
     # Directory where the sources are contained
     source_dir        = sys.argv[2]
 
-    # Version formatted, e.g. 1.2.4.99
+    # Revision (from build_version)
     revision  = sys.argv[3]
 
     # Official version name, e.g 1.2.5i4p1
     new_version_name  = sys.argv[4]
-    match = re.search("[a-z]", new_version_name)
+    major, minor, build = 1, 0, 0
+    try:
+        major, minor, build = map(lambda x: x.lstrip("0"), new_version_name.split(".")[:3])
+        if len(major) > 3:
+            # Looks like a daily build.. 2015.03.05
+            major = major[2:].lstrip("0")
+    except:
+        pass
+    new_product_version = "%s.%s.%s" % (major, minor, build)
+
+    # Remove any traces of i, p, b versions. Windows can't handle them...
+    # The revision should be enough to uniquely identify this build
+    # The original version name is also still visible in the list of programs
+    match = re.search("[a-z]", new_product_version)
     if match:
-        new_version_build = new_version_name[:match.start(0)] + "." + revision
+        new_version_build = "%s.%s" % (new_product_version[:match.start(0)], revision)
     else:
-        new_version_build = new_version_name + "." + revision
+        new_version_build = "%s.%s" % (new_product_version, revision)
 
 except:
     bail_out("Usage: %s MSIFILE.msi SOURCEDIR BUILDNUMBER VERSION" % sys.argv[0])



More information about the checkmk-commits mailing list