Replace the iproute2 snapshot with a version string which is
autogenerated as part of the build process using git describe.
This will also allow seeing if the version of the command
is built from the same sources is as upstream.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
14 files changed:
for i in $(SUBDIRS); \
do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done
for i in $(SUBDIRS); \
do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done
+.PHONY: clean clobber distclean check cscope version
+
help:
@echo "Make Targets:"
@echo " all - build binaries"
help:
@echo "Make Targets:"
@echo " all - build binaries"
@echo " install - install binaries on local machine"
@echo " check - run tests"
@echo " cscope - build cscope database"
@echo " install - install binaries on local machine"
@echo " check - run tests"
@echo " cscope - build cscope database"
- @echo " snapshot - generate version number header"
+ @echo " version - update version"
@echo ""
@echo "Make Arguments:"
@echo " V=[0|1] - set build verbosity level"
@echo ""
@echo "Make Arguments:"
@echo " V=[0|1] - set build verbosity level"
install -m 0644 bash-completion/devlink $(DESTDIR)$(BASH_COMPDIR)
install -m 0644 include/bpf_elf.h $(DESTDIR)$(HDRDIR)
install -m 0644 bash-completion/devlink $(DESTDIR)$(BASH_COMPDIR)
install -m 0644 include/bpf_elf.h $(DESTDIR)$(HDRDIR)
-snapshot:
- echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
- > include/SNAPSHOT.h
+version:
+ echo "static const char version[] = \""`git describe --tags --long`"\";" \
+ > include/version.h
clean:
@for i in $(SUBDIRS) testsuite; \
clean:
@for i in $(SUBDIRS) testsuite; \
#include <string.h>
#include <errno.h>
#include <string.h>
#include <errno.h>
#include "utils.h"
#include "br_common.h"
#include "namespace.h"
#include "utils.h"
#include "br_common.h"
#include "namespace.h"
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include "list.h"
#include "mnlg.h"
#include "json_print.h"
#include "list.h"
#include "mnlg.h"
#include "json_print.h"
- printf("devlink utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("devlink utility, iproute2-%s\n", version);
ret = EXIT_SUCCESS;
goto dl_free;
case 'f':
ret = EXIT_SUCCESS;
goto dl_free;
case 'f':
#include <errno.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h> /* until we put our own header */
#include <errno.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h> /* until we put our own header */
#include "utils.h"
#include "genl_utils.h"
#include "utils.h"
#include "genl_utils.h"
} else if (matches(argv[1], "-raw") == 0) {
++show_raw;
} else if (matches(argv[1], "-Version") == 0) {
} else if (matches(argv[1], "-raw") == 0) {
++show_raw;
} else if (matches(argv[1], "-Version") == 0) {
- printf("genl utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("genl utility, iproute2-%s\n", version);
exit(0);
} else if (matches(argv[1], "-help") == 0) {
usage();
exit(0);
} else if (matches(argv[1], "-help") == 0) {
usage();
+++ /dev/null
-static const char SNAPSHOT[] = "200602";
--- /dev/null
+static const char version[] = "v5.7.0-77-gb687d1067169";
#include <string.h>
#include <errno.h>
#include <string.h>
#include <errno.h>
#include "utils.h"
#include "ip_common.h"
#include "namespace.h"
#include "utils.h"
#include "ip_common.h"
#include "namespace.h"
++timestamp;
++timestamp_short;
} else if (matches(opt, "-Version") == 0) {
++timestamp;
++timestamp_short;
} else if (matches(opt, "-Version") == 0) {
- printf("ip utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("ip utility, iproute2-%s\n", version);
exit(0);
} else if (matches(opt, "-force") == 0) {
++force;
exit(0);
} else if (matches(opt, "-force") == 0) {
++force;
#include <netinet/in.h>
#include <string.h>
#include <netinet/in.h>
#include <string.h>
#include "utils.h"
#include "libnetlink.h"
#include "utils.h"
#include "libnetlink.h"
} else if (strcmp(argv[1], "-0") == 0) {
family = AF_PACKET;
} else if (matches(argv[1], "-Version") == 0) {
} else if (strcmp(argv[1], "-0") == 0) {
family = AF_PACKET;
} else if (matches(argv[1], "-Version") == 0) {
- printf("rtmon utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("rtmon utility, iproute2-%s\n", version);
exit(0);
} else if (matches(argv[1], "file") == 0) {
argc--;
exit(0);
} else if (matches(argv[1], "file") == 0) {
argc--;
#include "libnetlink.h"
#include "json_writer.h"
#include "libnetlink.h"
#include "json_writer.h"
#include "utils.h"
int dump_zeros;
#include "utils.h"
int dump_zeros;
break;
case 'v':
case 'V':
break;
case 'v':
case 'V':
- printf("ifstat utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("ifstat utility, iproute2-%s\n", version);
exit(0);
case 'h':
case '?':
exit(0);
case 'h':
case '?':
#include <getopt.h>
#include <json_writer.h>
#include <getopt.h>
#include <json_writer.h>
#include "utils.h"
int dump_zeros;
#include "utils.h"
int dump_zeros;
break;
case 'v':
case 'V':
break;
case 'v':
case 'V':
- printf("nstat utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("nstat utility, iproute2-%s\n", version);
exit(0);
case 'h':
case '?':
exit(0);
case 'h':
case '?':
int reset_history;
int ignore_history;
int reset_history;
int ignore_history;
break;
case 'v':
case 'V':
break;
case 'v':
case 'V':
- printf("rtacct utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("rtacct utility, iproute2-%s\n", version);
exit(0);
case 'M':
/* Some secret undocumented option, nobody
exit(0);
case 'M':
/* Some secret undocumented option, nobody
#include "ll_map.h"
#include "libnetlink.h"
#include "namespace.h"
#include "ll_map.h"
#include "libnetlink.h"
#include "namespace.h"
#include "rt_names.h"
#include "cg_map.h"
#include "rt_names.h"
#include "cg_map.h"
break;
case 'v':
case 'V':
break;
case 'v':
case 'V':
- printf("ss utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("ss utility, iproute2-%s\n", version);
exit(0);
case 'z':
show_sock_ctx++;
exit(0);
case 'z':
show_sock_ctx++;
#include "color.h"
static void help(char *name)
#include "color.h"
static void help(char *name)
long_options, NULL)) >= 0) {
switch (opt) {
case 'V':
long_options, NULL)) >= 0) {
switch (opt) {
case 'V':
- printf("%s utility, iproute2-ss%s\n",
- filename, SNAPSHOT);
+ printf("%s utility, iproute2-%s\n",
+ filename, version);
return EXIT_SUCCESS;
case 'p':
pretty = 1;
return EXIT_SUCCESS;
case 'p':
pretty = 1;
#include <string.h>
#include <errno.h>
#include <string.h>
#include <errno.h>
#include "utils.h"
#include "tc_util.h"
#include "tc_common.h"
#include "utils.h"
#include "tc_util.h"
#include "tc_common.h"
} else if (matches(argv[1], "-graph") == 0) {
show_graph = 1;
} else if (matches(argv[1], "-Version") == 0) {
} else if (matches(argv[1], "-graph") == 0) {
show_graph = 1;
} else if (matches(argv[1], "-Version") == 0) {
- printf("tc utility, iproute2-ss%s\n", SNAPSHOT);
+ printf("tc utility, iproute2-%s\n", version);
return 0;
} else if (matches(argv[1], "-iec") == 0) {
++use_iec;
return 0;
} else if (matches(argv[1], "-iec") == 0) {
++use_iec;