On 05/13/2013 02:58 PM, Rob Crittenden wrote:
Petr Viktorin wrote:
Due to my mistake in commit 9125285, the IPA_NUM_VERSION variable
contained a leading zero, so it was treated as octal in Python code.
Bumping the development version to 3.2.99 resulted in 030299, an invalid
value.
Luckily, 320 < 030200 < 30200 so the ordering is not broken.

Sorry for the mistake.


I think at least a comment somewhere is required too, probably in
version.h, describing which versions were affected by this octal problem.

rob

Added.

--
PetrĀ³
From 1ff6e677f6575539b34dd329802774a10f49da2c Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Mon, 13 May 2013 10:39:55 +0200
Subject: [PATCH] Remove leading zero from IPA_NUM_VERSION

The numeric IPA_NUM_VERSION contained a leading zero, so it was treated
as octal value in Python code instead of decimal.

https://fedorahosted.org/freeipa/ticket/3622
---
 Makefile                |  2 +-
 ipapython/version.py.in | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 8f4053b5db08bafb062ab4c08f2b7382c1d100f7..b6f4fa20c3d4a106c7dc7e69a3bd791134d59565 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ TARGET ?= master
 
 SUPPORTED_PLATFORM ?= redhat
 
-IPA_NUM_VERSION ?= $(shell printf %02d%02d%02d $(IPA_VERSION_MAJOR) $(IPA_VERSION_MINOR) $(IPA_VERSION_RELEASE))
+IPA_NUM_VERSION ?= $(shell printf %d%02d%02d $(IPA_VERSION_MAJOR) $(IPA_VERSION_MINOR) $(IPA_VERSION_RELEASE))
 
 # After updating the version in VERSION you should run the version-update
 # target.
diff --git a/ipapython/version.py.in b/ipapython/version.py.in
index 9cf8ddbe8bc755b955c4e2d357f68e52220a7446..04cf5f81f4fa32168ba208dd9c872464e62003d7 100644
--- a/ipapython/version.py.in
+++ b/ipapython/version.py.in
@@ -20,9 +20,26 @@
 # The full version including strings
 VERSION="__VERSION__"
 
+
 # Just the numeric portion of the version so one can do direct numeric
 # comparisons to see if the API is compatible.
+#
+# How NUM_VERSION was generated changed over time:
+# Before IPA 3.1.3, it was simply concatenated decimal numbers:
+#   IPA 2.2.2:  NUM_VERSION=222
+#   IPA 2.2.99: NUM_VERSION=2299 (development version)
+#   IPA 3.1.0:  NUM_VERSION=310
+#   IPA 3.1.3:  NUM_VERSION=313
+# In IPA 3.1.4 and 3.2.0, the version was taken as an octal number due to a bug
+# (https://fedorahosted.org/freeipa/ticket/3622):
+#   IPA 3.1.4:  NUM_VERSION=12356 (octal 030104)
+#   IPA 3.2.0:  NUM_VERSION=12416 (octal 030200)
+# After IPA 3.2.0, it is decimal number where each part has two digits:
+#   IPA 3.2.1:  NUM_VERSION=30201
+#   IPA 3.2.99: NUM_VERSION=30299 (development version)
+#   IPA 3.3.0:  NUM_VERSION=30300
 NUM_VERSION=__NUM_VERSION__
 
+
 # The version of the API.
 API_VERSION=u'__API_VERSION__'
-- 
1.8.1.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to