DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] version: 1.7.0-rc0
Date: Mon, 12 May 2014 15:31:49 +0200	[thread overview]
Message-ID: <1399901509-9804-1-git-send-email-thomas.monjalon@6wind.com> (raw)

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>
---
 lib/librte_eal/common/include/rte_version.h | 55 +++++++++++++++++------------
 mk/rte.sdkconfig.mk                         | 13 +++++--
 2 files changed, 42 insertions(+), 26 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_version.h b/lib/librte_eal/common/include/rte_version.h
index 419de24..e64cccc 100644
--- a/lib/librte_eal/common/include/rte_version.h
+++ b/lib/librte_eal/common/include/rte_version.h
@@ -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
diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index a96beeb..d0692e7 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -31,9 +31,16 @@
 
 .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_%,%,\
-- 
1.9.2

             reply	other threads:[~2014-05-12 13:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 13:31 Thomas Monjalon [this message]
2014-05-12 19:41 ` Richardson, Bruce
2014-05-13 14:23   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399901509-9804-1-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).