Skip to content

Commit

Permalink
Changed intermediate version numbers to be git-style, eg 1.0.0-39
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed May 8, 2024
1 parent e0925a5 commit e4ede5b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ build.c:
echo "/* This file is generated from the Controller Makefile */" > $@;
date +"const char CONTROLLER_BUILDSTR[$(DATELEN)]=\"%Y.%m.%d %H:%M by `whoami` on `hostname`"\"\; >> $@;
echo "const char CONTROLLER_VERSIONSTR[64]=\"$(CONTROLLER_VERSION)\""\; >> $@;
echo "const char CONTROLLER_GITHASHSTR[10]=\"$(shell git rev-parse --short HEAD)\""\; >> $@;
echo "const char CONTROLLER_GITHASH[64]=\"$(shell git log --pretty="format:%(describe) %ci" -n1)\""\; >> $@;

CLISPECS = $(APPNAME)_operation.cli
CLISPECS += $(APPNAME)_configure.cli
Expand Down
2 changes: 1 addition & 1 deletion src/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@
*/
extern const char CONTROLLER_BUILDSTR[];
extern const char CONTROLLER_VERSIONSTR[];
extern const char CONTROLLER_GITHASHSTR[];
extern const char CONTROLLER_GITHASH[];

#endif /* _CONTROLLER_H */
4 changes: 3 additions & 1 deletion src/controller.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
<CLICON_CLI_HELPSTRING_LINES>1</CLICON_CLI_HELPSTRING_LINES>
<CLICON_YANG_SCHEMA_MOUNT>true</CLICON_YANG_SCHEMA_MOUNT>
<CLICON_BACKEND_USER>@CLICON_USER@</CLICON_BACKEND_USER>
<!-- Length limitation of debug and log strings -->
<CLICON_LOG_STRING_LIMIT>0</CLICON_LOG_STRING_LIMIT>
<!-- Enable for exclusive lock on edit -->
<!--CLICON_AUTOLOCK>true</CLICON_AUTOLOCK-->
<CLICON_AUTOLOCK>false</CLICON_AUTOLOCK>
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
<!-- pyapi produces some duplicates, when not, please remove me -->
Expand Down
10 changes: 7 additions & 3 deletions src/controller_cli_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ transaction_exist(clixon_handle h,
cxobj *xerr;
cxobj *xt;
cvec *nsc = NULL;
char *state;

if ((nsc = xml_nsctx_init("co", CONTROLLER_NAMESPACE)) == NULL)
goto done;
Expand Down Expand Up @@ -2322,14 +2321,19 @@ cli_auto_load_devs(clixon_handle h,
}

/*! Show controller and clixon version
*
* @see controller_version
*/
int
cli_controller_show_version(clixon_handle h,
cvec *vars,
cvec *argv)
{
cligen_output(stdout, "Clixon: \t%s\n", CLIXON_VERSION_STRING);
return controller_version(h, stdout);
cligen_output(stdout, "CLIgen: \t%s\n", CLIGEN_VERSION);
cligen_output(stdout, "Clixon: \t%s\n", CLIXON_GITHASH);
cligen_output(stdout, "Controller:\t%s\n", CONTROLLER_GITHASH);
cligen_output(stdout, "Build:\t\t%s\n", CONTROLLER_BUILDSTR);
return 0;
}

/*! Apply template on devices
Expand Down
6 changes: 2 additions & 4 deletions src/controller_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ controller_mount_yspec_set(clixon_handle h,
*
* A plugin can customize a version (or banner) output on stdout.
* Several version strings can be printed if there are multiple callbacks.
* If not registered plugins exist, clixon prints CLIXON_VERSION_STRING
* Typically invoked by command-line option -V
* @param[in] h Clixon handle
* @param[in] f Output file
Expand All @@ -489,9 +488,8 @@ controller_version(clixon_handle h,
{
/* Assume clixon version already printed */
cligen_output(f, "CLIgen: \t%s\n", CLIGEN_VERSION);
cligen_output(f, "Controller: \t%s\n", CONTROLLER_VERSIONSTR);
cligen_output(f, "Controller GIT:\t%s\n", CONTROLLER_GITHASHSTR);
cligen_output(f, "Controller bld:\t%s\n", CONTROLLER_BUILDSTR);
cligen_output(f, "Controller:\t%s\n", CONTROLLER_GITHASH);
cligen_output(f, "Build:\t\t%s\n", CONTROLLER_BUILDSTR);
return 0;
}

Expand Down

0 comments on commit e4ede5b

Please sign in to comment.