small fixes as outcome of review

This commit is contained in:
Gregor 2019-07-27 08:27:19 +02:00
parent 9eec82fead
commit 0ff3084fe3
2 changed files with 15 additions and 20 deletions

View File

@ -280,20 +280,20 @@ Returns information about hardware, software version and build configuration.
#### Syntax
`node.info([kind])`
`node.info([group])`
#### Parameters
`kind` kind of information (optional, if ommited return legacy information). May be one of `"hw"`, `"sw_version"`, `"build_config"`.
`group` group of information (optional, if ommited return legacy information). May be one of `"hw"`, `"sw_version"`, `"build_config"`.
#### Returns
if a `kind` is given the return value will be a table containing the following elements:
- for `kind` = `"hw"`
if a `group` is given the return value will be a table containing the following elements:
- for `group` = `"hw"`
- `chip_id` (number)
- `flash_id` (number)
- `flash_size` (number)
- `flash_mode` (number) QIO = 0, QOUT = 1, DIO = 2, DOUT = 15.
- `flash_speed` (number)
- for `kind` = `"sw_version"`
- for `group` = `"sw_version"`
- `git_branch` (string)
- `git_commit_id` (string)
- `git_release` (string) Release name +additional commits e.g. "2.0.0-master_20170202 +403"
@ -301,7 +301,7 @@ Returns information about hardware, software version and build configuration.
- `node_verion_major` (number)
- `node_verion_minor` (number)
- `node_verion_revision` (number)
- for `kind` = `"build_config"`
- for `group` = `"build_config"`
- `ssl` (boolean)
- `lfs_size` (number) as defined at build time
- `modules` (string) comma separated list
@ -311,7 +311,7 @@ Returns information about hardware, software version and build configuration.
This interface is deprecated and will be removed in one of the next releases. Use the above calls instead.
- for no `kind` given: --deprecated
- for no `group` given: --deprecated
- `majorVer` (number)
- `minorVer` (number)
- `devVer` (number)

View File

@ -1,9 +1,7 @@
#!/usr/bin/env bash
USER_MODULES_H=app/include/user_modules.h
USER_CONFIG_H=app/include/user_config.h
BUILD_DATE="$(date "+%Y-%m-%d %H:%M")"
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$//')"
@ -42,18 +40,15 @@ cat > $TEMPFILE << EndOfMessage
#define BUILDINFO_BUILD_TYPE "float"
#endif
EndOfMessage
#define USER_PROLOG "$USER_PROLOG"
#define BUILDINFO_BRANCH "$BRANCH"
#define BUILDINFO_COMMIT_ID "$COMMIT_ID"
#define BUILDINFO_RELEASE "$RELEASE"
#define BUILDINFO_RELEASE_DTS "$RELEASE_DTS"
#define BUILDINFO_MODULES "$MODULES"
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_MODULES \""$MODULES"\"" >> $TEMPFILE
cat >> $TEMPFILE << EndOfMessage2
#define NODE_VERSION_LONG \\
"$USER_PROLOG \n" \\
USER_PROLOG "\n" \\
"\tbranch: " BUILDINFO_BRANCH "\n" \\
"\tcommit: " BUILDINFO_COMMIT_ID "\n" \\
"\trelease: " BUILDINFO_RELEASE "\n" \\
@ -63,7 +58,7 @@ cat >> $TEMPFILE << EndOfMessage2
"\tLFS: " BUILDINFO_TO_STR(BUILDINFO_LFS) "\n" \\
"\tmodules: " BUILDINFO_MODULES "\n"
EndOfMessage2
EndOfMessage
echo "#endif /* __BUILDINFO_H__ */" >> $TEMPFILE