New version string on the form: 7.1.0-1+11+g2b25294
This commit is contained in:
parent
3cad374f33
commit
0a37cf31ab
15 changed files with 66 additions and 25 deletions
|
|
@ -43,6 +43,7 @@ Expected: October 2024
|
|||
|
||||
Users may have to change how they access the system
|
||||
|
||||
* New version string on the form: `7.1.0-1+11+g2b25294`
|
||||
* Restconf: Better RFC compliance with Accept errors: 406 vs 415
|
||||
* Removed YANG line-number in error-messages for memory optimization
|
||||
* Re-enable by setting `YANG_SPEC_LINENR` compile-time option
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ main(int argc,
|
|||
help = 1;
|
||||
break;
|
||||
case 'V':
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_GITHASH);
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION);
|
||||
print_version++; /* plugins may also print versions w ca-version callback */
|
||||
break;
|
||||
case 'D' : /* debug */
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ main(int argc,
|
|||
help = 1;
|
||||
break;
|
||||
case 'V': /* version */
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_GITHASH);
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION);
|
||||
print_version++; /* plugins may also print versions w ca-version callback */
|
||||
break;
|
||||
case 'D' : /* debug, if set here overrides option CLICON_DEBUG */
|
||||
|
|
|
|||
|
|
@ -994,7 +994,7 @@ cli_show_version(clixon_handle h,
|
|||
cvec *cvv,
|
||||
cvec *argv)
|
||||
{
|
||||
cligen_output(stdout, "Clixon: %s\n", CLIXON_GITHASH);
|
||||
cligen_output(stdout, "Clixon: %s\n", CLIXON_VERSION);
|
||||
cligen_output(stdout, "CLIgen: %s\n", CLIGEN_VERSION);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -707,7 +707,7 @@ main(int argc,
|
|||
usage(h, argv[0]);
|
||||
break;
|
||||
case 'V': /* version */
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_GITHASH);
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION);
|
||||
print_version++; /* plugins may also print versions w ca-version callback */
|
||||
break;
|
||||
case 'D' : /* debug */
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ main(int argc,
|
|||
usage(h, argv[0]);
|
||||
break;
|
||||
case 'V':
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_GITHASH);
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION);
|
||||
print_version++; /* plugins may also print versions w ca-version callback */
|
||||
break;
|
||||
case 'D' : { /* debug */
|
||||
|
|
|
|||
|
|
@ -1189,7 +1189,7 @@ main(int argc,
|
|||
usage(h, argv0);
|
||||
break;
|
||||
case 'V': /* version */
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_GITHASH);
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION);
|
||||
print_version++; /* plugins may also print versions w ca-version callback */
|
||||
break;
|
||||
case 'D' : /* debug. Note this overrides any setting in the config */
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ main(int argc,
|
|||
usage(h, argv[0]);
|
||||
break;
|
||||
case 'V': /* version */
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_GITHASH);
|
||||
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION);
|
||||
print_version++; /* plugins may also print versions w ca-version callback */
|
||||
break;
|
||||
case 'D' : { /* debug */
|
||||
|
|
|
|||
19
configure
vendored
19
configure
vendored
|
|
@ -2813,10 +2813,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
|||
|
||||
|
||||
# Use GIT version (what if no git?)
|
||||
CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)"
|
||||
CLIXON_VERSION_MAJOR="7"
|
||||
CLIXON_VERSION_MINOR="1"
|
||||
CLIXON_VERSION_PATCH="0"
|
||||
CLIXON_VERSION="$(./scripts/version.sh)"
|
||||
CLIXON_VERSION2=$(echo ${CLIXON_VERSION} | awk -F- '{print $1}')
|
||||
CLIXON_VERSION_MAJOR=$(echo ${CLIXON_VERSION2} | awk -F. '{print $1}')
|
||||
CLIXON_VERSION_MINOR=$(echo ${CLIXON_VERSION2} | awk -F. '{print $2}')
|
||||
CLIXON_VERSION_PATCH=$(echo ${CLIXON_VERSION2} | awk -F. '{print $3}')
|
||||
|
||||
# Debug flag
|
||||
# Check whether --enable-debug was given.
|
||||
|
|
@ -5304,11 +5305,11 @@ if test x$ac_prog_cxx_stdcxx = xno
|
|||
then :
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
|
||||
printf %s "checking for $CXX option to enable C++11 features... " >&6; }
|
||||
if test ${ac_cv_prog_cxx_11+y}
|
||||
if test ${ac_cv_prog_cxx_cxx11+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
ac_cv_prog_cxx_11=no
|
||||
ac_cv_prog_cxx_cxx11=no
|
||||
ac_save_CXX=$CXX
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
|
@ -5350,11 +5351,11 @@ if test x$ac_prog_cxx_stdcxx = xno
|
|||
then :
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
|
||||
printf %s "checking for $CXX option to enable C++98 features... " >&6; }
|
||||
if test ${ac_cv_prog_cxx_98+y}
|
||||
if test ${ac_cv_prog_cxx_cxx98+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
ac_cv_prog_cxx_98=no
|
||||
ac_cv_prog_cxx_cxx98=no
|
||||
ac_save_CXX=$CXX
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
|
@ -6549,7 +6550,7 @@ printf "%s\n" "Generated YANGs from MIB files are expected to be in ${MIB_GENERA
|
|||
fi
|
||||
|
||||
# Set default config file location
|
||||
CLIXON_DEFAULT_CONFIG=/usr/local/etc/clixon.xml
|
||||
CLIXON_DEFAULT_CONFIG=${SYSCONFDIR}/clixon.xml
|
||||
|
||||
# Check whether --with-configfile was given.
|
||||
if test ${with_configfile+y}
|
||||
|
|
|
|||
|
|
@ -49,10 +49,11 @@ AC_CONFIG_SRCDIR([lib/clixon/clixon.h.in])
|
|||
AC_CONFIG_AUX_DIR(config-aux)
|
||||
|
||||
# Use GIT version (what if no git?)
|
||||
CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)"
|
||||
CLIXON_VERSION_MAJOR="7"
|
||||
CLIXON_VERSION_MINOR="1"
|
||||
CLIXON_VERSION_PATCH="0"
|
||||
CLIXON_VERSION="$(./scripts/version.sh)"
|
||||
CLIXON_VERSION2=$(echo ${CLIXON_VERSION} | awk -F- '{print $1}')
|
||||
CLIXON_VERSION_MAJOR=$(echo ${CLIXON_VERSION2} | awk -F. '{print $1}')
|
||||
CLIXON_VERSION_MINOR=$(echo ${CLIXON_VERSION2} | awk -F. '{print $2}')
|
||||
CLIXON_VERSION_PATCH=$(echo ${CLIXON_VERSION2} | awk -F. '{print $3}')
|
||||
|
||||
# Debug flag
|
||||
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Build with debug symbols, default: no]),[
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ example_cli_errmsg(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 no registered plugins exist, clixon prints CLIXON_GITHASH
|
||||
* If no registered plugins exist, clixon prints CLIXON_VERSION
|
||||
* Typically invoked by command-line option -V
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] f Output file
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ extern "C" {
|
|||
/*
|
||||
* CLIXON version macros, set in configure and resolved when expanding to
|
||||
* clixon.h
|
||||
* XXX: use github versioning: CLIXON_GITHASH[] instead
|
||||
*/
|
||||
#undef CLIXON_VERSION_MAJOR
|
||||
#undef CLIXON_VERSION_MINOR
|
||||
|
|
@ -123,7 +122,6 @@ extern "C" {
|
|||
* Global variables generated by Makefile
|
||||
*/
|
||||
extern const char CLIXON_BUILDSTR[];
|
||||
extern const char CLIXON_GITHASH[];
|
||||
extern const char CLIXON_VERSION[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ typedef int (errmsg_t)(clixon_handle h, const char *fn, const int line,
|
|||
*
|
||||
* A plugin can customize a version (or banner) output on stdout.
|
||||
* Several version strings can be printed if there are multiple callbacks.
|
||||
* If no registered plugins exist, clixon prints CLIXON_GITHASH
|
||||
* If no registered plugins exist, clixon prints CLIXON_VERSION
|
||||
* Typically invoked by command-line option -V
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] f Output file
|
||||
|
|
|
|||
|
|
@ -299,7 +299,6 @@ DATELEN = $(shell date +"%Y.%m.%d %H:%M by `whoami` on `hostname`XXXX"|wc -c)
|
|||
build.c:
|
||||
echo "/* This file is generated from the Clixon Makefile */" > $@;
|
||||
date +"const char CLIXON_BUILDSTR[$(DATELEN)]=\"%Y.%m.%d %H:%M by `whoami` on `hostname`"\"\; >> $@;
|
||||
echo "const char CLIXON_GITHASH[64]=\"$(shell git log --pretty="format:%(describe) %ci" -n1)\""\; >> $@;
|
||||
echo "const char CLIXON_VERSION[64]=\"$(CLIXON_VERSION)\""\; >> $@;
|
||||
|
||||
# Note: will always be remade since GENOBS is date dependent
|
||||
|
|
|
|||
41
scripts/version.sh
Executable file
41
scripts/version.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
# Version script
|
||||
# Usage:
|
||||
# ./version.sh
|
||||
# with optional fields:
|
||||
# PREFIX= INDEX=1 ARCH= SUFFIX=
|
||||
# Example:
|
||||
# PREFIX=cligen INDEX=1 ARCH=amd64 SUFFIX=deb ./version.sh
|
||||
set -eu
|
||||
: ${PREFIX:=}
|
||||
: ${INDEX=1}
|
||||
: ${ARCH=}
|
||||
: ${SUFFIX=}
|
||||
# Get version string from default git describe: <tag>-<nr>-g<hash>
|
||||
if [ -f .version ]; then
|
||||
v1=$(cat .version)
|
||||
else
|
||||
v1=$(git describe)
|
||||
fi
|
||||
if [ -z $v1 ]; then
|
||||
echo "No base version"
|
||||
exit 1
|
||||
fi
|
||||
TAG=$(echo $v1 | awk -F- '{print $1}')
|
||||
NR=$(echo $v1 | awk -F- '{print $2}')
|
||||
HASH=$(echo $v1 | awk -F- '{print $3}')
|
||||
V=""
|
||||
if [ -n "$PREFIX" ]; then
|
||||
V="${V}${PREFIX}_"
|
||||
fi
|
||||
V="${V}${TAG}"
|
||||
V="${V}-${INDEX}"
|
||||
V="${V}+${NR}"
|
||||
V="${V}+${HASH}"
|
||||
if [ -n "$ARCH" ]; then
|
||||
V="${V}_${ARCH}"
|
||||
fi
|
||||
if [ -n "$SUFFIX" ]; then
|
||||
V="${V}.${SUFFIX}"
|
||||
fi
|
||||
echo "${V}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue