mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Merged in david_alessio/nuttx/feature/add-git-revision (pull request #1020)
report git info on /proc/gitrev
* report git info on /proc/gitrev
git info reported: branch, version, git hash, hostname, usr, build date
* use existing .version and procfs for git info
* reduce script's coupling
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
3806a01c5d
commit
a0867a7f4f
@@ -220,15 +220,23 @@ static ssize_t version_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
if (filep->f_pos == 0)
|
||||
{
|
||||
#if defined(__DATE__) && defined(__TIME__)
|
||||
#ifdef CONFIG_GIT_REVISION_STR
|
||||
linesize = snprintf(attr->line, VERSION_LINELEN,
|
||||
"NuttX version %s %s\n"
|
||||
"%s\n",
|
||||
CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD,
|
||||
CONFIG_GIT_REVISION_STR);
|
||||
#else
|
||||
# if defined(__DATE__) && defined(__TIME__)
|
||||
linesize = snprintf(attr->line, VERSION_LINELEN,
|
||||
"NuttX version %s %s %s %s\n",
|
||||
CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD,
|
||||
__DATE__, __TIME__);
|
||||
#else
|
||||
# else
|
||||
linesize = snprintf(attr->line, VERSION_LINELEN,
|
||||
"NuttX version %s %s\n",
|
||||
CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Save the linesize in case we are re-entered with f_pos > 0 */
|
||||
|
||||
Reference in New Issue
Block a user