From 063988f12a21eaeb55912b54aa8a23866731c4bf Mon Sep 17 00:00:00 2001 From: Gregor Date: Fri, 12 Jul 2019 22:39:04 +0200 Subject: [PATCH] Change DTS to string since it is too big as number --- app/include/user_version.h | 2 ++ app/modules/node.c | 2 +- tools/update_buildinfo.sh | 8 ++------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/include/user_version.h b/app/include/user_version.h index 20048c67..33817c5c 100644 --- a/app/include/user_version.h +++ b/app/include/user_version.h @@ -13,6 +13,8 @@ #define NODE_VERSION_XSTR(x) NODE_VERSION_STR(x) # define NODE_VERSION "NodeMCU " ESP_SDK_VERSION_STRING "." NODE_VERSION_XSTR(NODE_VERSION_INTERNAL) " " NODE_VERSION_LONG +// Leave the space after # in the line above. It busts replacement of NODE_VERSION in the docker build which is not needed anymore with this PR. +// Can be removed when the script is adapted #ifndef BUILD_DATE #define BUILD_DATE "unspecified" diff --git a/app/modules/node.c b/app/modules/node.c index b50fc0db..af39f2c6 100644 --- a/app/modules/node.c +++ b/app/modules/node.c @@ -131,7 +131,7 @@ static int node_info( lua_State* L ) lua_pushstring(L, BUILDINFO_BRANCH); lua_pushstring(L, BUILDINFO_COMMIT_ID); lua_pushstring(L, BUILDINFO_RELEASE); - lua_pushnumber(L, BUILDINFO_RELEASE_DTS); + lua_pushstring(L, BUILDINFO_RELEASE_DTS); lua_pushboolean(L, BUILDINFO_SSL); lua_pushstring(L, BUILDINFO_LFS); lua_pushstring(L, BUILDINFO_MODULES); diff --git a/tools/update_buildinfo.sh b/tools/update_buildinfo.sh index 117ff0f1..9e8a553a 100755 --- a/tools/update_buildinfo.sh +++ b/tools/update_buildinfo.sh @@ -8,9 +8,6 @@ COMMIT_ID="$(git rev-parse HEAD)" BRANCH="$(git rev-parse --abbrev-ref HEAD | sed -r 's/[\/\\]+/_/g')" RELEASE="$(git describe --tags --long | sed -r 's/(.*)-(.*)-.*/\1 +\2/g' | sed 's/ +0$//')" RELEASE_DTS=$(git show -s --format=%cd --date=format:"%Y%m%d%H%M" HEAD) -if [ -z "$RELEASE_DTS"]; then - RELEASE_DTS=0 -fi # figure out whether SSL is enabled in user_config.h if grep -Eq "^#define CLIENT_SSL_ENABLE" $USER_CONFIG_H; then @@ -51,8 +48,7 @@ echo "#define USER_PROLOG \""$USER_PROLOG"\"" >> $TEMPFILE echo "#define BUILDINFO_BRANCH \""$BRANCH"\"" >> $TEMPFILE echo "#define BUILDINFO_COMMIT_ID \""$COMMIT_ID"\"" >> $TEMPFILE echo "#define BUILDINFO_RELEASE \""$RELEASE"\"" >> $TEMPFILE -echo "#define BUILDINFO_RELEASE_DTS "$RELEASE_DTS >> $TEMPFILE -echo "#define BUILDINFO_RELEASE_DTS_STR \""$RELEASE_DTS"\"" >> $TEMPFILE +echo "#define BUILDINFO_RELEASE_DTS \""$RELEASE_DTS"\"" >> $TEMPFILE echo "#define BUILDINFO_SSL "$SSL >> $TEMPFILE echo "#define BUILDINFO_SSL_STR \""$SSL"\"" >> $TEMPFILE echo "#define BUILDINFO_BUILD_TYPE \""$BUILD_TYPE"\"" >> $TEMPFILE @@ -65,7 +61,7 @@ cat >> $TEMPFILE << EndOfMessage2 "\tbranch: " BUILDINFO_BRANCH "\n" \\ "\tcommit: " BUILDINFO_COMMIT_ID "\n" \\ "\trelease: " BUILDINFO_RELEASE "\n" \\ - "\trelease DTS: " BUILDINFO_RELEASE_DTS_STR "\n" \\ + "\trelease DTS: " BUILDINFO_RELEASE_DTS "\n" \\ "\tSSL: " BUILDINFO_SSL_STR "\n" \\ "\tBuild type: " BUILDINFO_BUILD_TYPE "\n" \\ "\tLFS: " BUILDINFO_LFS "\n" \\