version: 1.7.0-rc0
authorThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 9 May 2014 17:18:02 +0000 (19:18 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 13 May 2014 08:11:17 +0000 (10:11 +0200)
Start development cycle for version 1.7.0.

This new development workflow introduces a new versioning scheme.
Instead of having releases r0, r1, r2, etc, there will be release
candidates. Last number has special meanings:
< 16 numbers are reserved for release candidates (RTE_VER_SUFFIX is -rc)
16 is reserved for the release (RTE_VER_SUFFIX must be unset)
> 16 numbers can be used locally (RTE_VER_SUFFIX must be set)

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/common/include/rte_version.h
mk/rte.sdkconfig.mk

index 419de24..e64cccc 100644 (file)
@@ -59,7 +59,7 @@ extern "C" {
 /**
  * Minor version number i.e. the y in x.y.z
  */
-#define RTE_VER_MINOR 6
+#define RTE_VER_MINOR 7
 
 /**
  * Patch level number i.e. the z in x.y.z
@@ -67,9 +67,16 @@ extern "C" {
 #define RTE_VER_PATCH_LEVEL 0
 
 /**
- * Patch release number i.e. the w in x.y.zrw
+ * Extra string to be appended to version number
  */
-#define RTE_VER_PATCH_RELEASE 2
+#define RTE_VER_SUFFIX "-rc"
+
+/**
+ * Patch release number
+ *   0-15 = release candidates
+ *   16   = release
+ */
+#define RTE_VER_PATCH_RELEASE 0
 
 /**
  * Macro to compute a version number usable for comparisons
@@ -86,31 +93,33 @@ extern "C" {
                        RTE_VER_PATCH_RELEASE)
 
 /**
- * Extra string to be appended to version number,
- * for example: pre1, EAR, final etc.
- */
-#define RTE_VER_SUFFIX ""
-
-/**
- * Function returning string of version number: "RTE x.y.zrw"
+ * Function returning version string
  * @return
  *     string
  */
 static inline const char *
-rte_version(void) {
-       if (sizeof(RTE_VER_SUFFIX) > sizeof(""))
-               return RTE_VER_PREFIX" "
-                               RTE_STR(RTE_VER_MAJOR)"."
-                               RTE_STR(RTE_VER_MINOR)"."
-                               RTE_STR(RTE_VER_PATCH_LEVEL)"r"
-                               RTE_STR(RTE_VER_PATCH_RELEASE)
-                               "-"RTE_VER_SUFFIX;
+rte_version(void)
+{
+       static char version[32];
+       if (version[0] != 0)
+               return version;
+       if (strlen(RTE_VER_SUFFIX) == 0)
+               sprintf(version, "%s %d.%d.%d",
+                       RTE_VER_PREFIX,
+                       RTE_VER_MAJOR,
+                       RTE_VER_MINOR,
+                       RTE_VER_PATCH_LEVEL);
        else
-               return RTE_VER_PREFIX" "
-                               RTE_STR(RTE_VER_MAJOR)"."
-                               RTE_STR(RTE_VER_MINOR)"."
-                               RTE_STR(RTE_VER_PATCH_LEVEL)"r"
-                               RTE_STR(RTE_VER_PATCH_RELEASE);
+               sprintf(version, "%s %d.%d.%d%s%d",
+                       RTE_VER_PREFIX,
+                       RTE_VER_MAJOR,
+                       RTE_VER_MINOR,
+                       RTE_VER_PATCH_LEVEL,
+                       RTE_VER_SUFFIX,
+                       RTE_VER_PATCH_RELEASE < 16 ?
+                               RTE_VER_PATCH_RELEASE :
+                               RTE_VER_PATCH_RELEASE - 16);
+       return version;
 }
 
 #ifdef __cplusplus
index a96beeb..d0692e7 100644 (file)
 
 .PHONY: showversion
 showversion:
-       @sed -rn 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
-               $(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h | \
-               tr '\n' '.' | sed -r 's,\.([0-9]+)\.$$,r\1\n,'
+       @set -- \
+               $$(sed -rne 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
+                       -e 's,^#define RTE_VER_SUFFIX[[:space:]]+"(.*)",\1,p' \
+                       $(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h) ;\
+               printf '%d.%d.%d' "$$1" "$$2" "$$3"; \
+               if [ -z "$$4" ]; then echo; \
+               else printf '%s' "$$4"; \
+                       if [ $$5 -lt 16 ] ; then echo $$5; \
+                       else echo $$(($$5 - 16)); fi; \
+               fi
 
 INSTALL_CONFIGS := $(sort $(filter-out %~,\
        $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\