summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlinux_dpdk/ws_main.py17
-rwxr-xr-xlinux_dpdk/wscript3
-rwxr-xr-xsrc/main_dpdk.cpp3
3 files changed, 22 insertions, 1 deletions
diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py
index 566ceb1a..e5ac40fb 100755
--- a/linux_dpdk/ws_main.py
+++ b/linux_dpdk/ws_main.py
@@ -12,6 +12,7 @@ import shutil;
import copy;
import re
import uuid
+import subprocess
# these variables are mandatory ('/' are converted automatically)
@@ -702,6 +703,15 @@ def get_build_num ():
return s;
def create_version_files ():
+ git_sha="N/A"
+ try:
+ r=commands.getstatusoutput("git log --pretty=format:'%H' -n 1")
+ if r[0]==0:
+ git_sha=r[1]
+ except :
+ pass;
+
+
s =''
s +="#ifndef __TREX_VER_FILE__ \n"
s +="#define __TREX_VER_FILE__ \n"
@@ -712,6 +722,7 @@ def create_version_files ():
s +='extern const char * get_build_date(void); \n'
s +='extern const char * get_build_time(void); \n'
s +='#define VERSION_UIID "%s" \n' % uuid.uuid1()
+ s +='#define VERSION_GIT_SHA "%s" \n' % git_sha
s +='#define VERSION_BUILD_NUM "%s" \n' % get_build_num()
s +="#ifdef __cplusplus \n"
s +=" } \n"
@@ -877,6 +888,12 @@ def publish_ext(bld):
+def test (bld):
+ r=commands.getstatusoutput("git log --pretty=format:'%H' -n 1")
+ if r[0]==0:
+ print r[1]
+
+
diff --git a/linux_dpdk/wscript b/linux_dpdk/wscript
index be048bd8..459e2201 100755
--- a/linux_dpdk/wscript
+++ b/linux_dpdk/wscript
@@ -45,6 +45,9 @@ def publish_web(bld):
def sync(bld):
ws_main.sync(bld)
+def test(bld):
+ ws_main.test(bld)
+
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 65015bcd..15d7451e 100755
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -678,7 +678,7 @@ static int usage(){
printf(" limitations under the License. \n");
printf(" \n");
printf(" Open Source Components / Libraries \n");
- printf(" DPDK (BSD) \n");
+ printf(" DPDK (BSD) \n");
printf(" YAML-CPP (BSD) \n");
printf(" JSONCPP (MIT) \n");
printf(" \n");
@@ -689,6 +689,7 @@ static int usage(){
printf(" User : %s \n",VERSION_USER);
printf(" Date : %s , %s \n",get_build_date(),get_build_time());
printf(" Uuid : %s \n",VERSION_UIID);
+ printf(" Git SHA : %s \n",VERSION_GIT_SHA);
return (0);
}