batman-adv: Replace version info instead of appending them
PATCH 1/1 batman-adv: Replace version info instead of appending them
The version number of modules build outside of the tree can get revision numbers added. This is useful to give hints about the revision of a distribution package and the used patchset. The prepended source number or branch name doesn't add any additional information which would help to identify problems and can therefore be omitted.
--- Makefile | 2 +- Makefile.kbuild | 2 +- gateway_client.c | 5 ++--- main.c | 9 ++------- main.h | 11 +++-------- originator.c | 5 ++--- 6 files changed, 11 insertions(+), 23 deletions(-)
Makefile +1 -1
@@ -30,7 +30,7 @@ endif export KERNELPATH REVISION= $(shell if [ -d .git ]; then \ - echo $$(git describe --always --dirty 2> /dev/null || echo "[unknown]"); \ + echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \ fi) NUM_CPUS = $(shell nproc 2> /dev/null || echo 1)
Makefile.kbuild +1 -1
@@ -28,7 +28,7 @@ endif # EXTRA_CFLAGS += -DCONFIG_BATMAN_ADV_DEBUG ifneq ($(REVISION),) -EXTRA_CFLAGS += -DREVISION_VERSION=\"$(REVISION)\" +EXTRA_CFLAGS += -DSOURCE_VERSION=\"$(REVISION)\" endif obj-m += batman-adv.o
gateway_client.c +2 -3
@@ -487,10 +487,9 @@ int gw_client_seq_print_text(struct seq_file *seq, void *offset) }seq_printf (seq," %-12s (%s/%i) %17s [%10s]: gw_class ... " -"[B.A.T.M.A.N. adv %s%s, MainIF/MAC: %s/%pM (%s)]\n" , +"[B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n" ,"Gateway" ,"#" ,TQ_MAX_VALUE ,"Nexthop" , -"outgoingIF" ,SOURCE_VERSION ,REVISION_VERSION_STR , - primary_if->net_dev->name, +"outgoingIF" ,SOURCE_VERSION , primary_if->net_dev->name, primary_if->net_dev->dev_addr, net_dev->name);rcu_read_lock ();
main.c +2 -7
@@ -58,9 +58,8 @@ static int __init batman_init(void)register_netdevice_notifier (&hard_if_notifier); -pr_info ("B.A.T.M.A.N. advanced %s%s (compatibility version %i) " -"loaded\n" ,SOURCE_VERSION ,REVISION_VERSION_STR , -COMPAT_VERSION ); +pr_info ("B.A.T.M.A.N. advanced %s (compatibility version %i) " +"loaded\n" ,SOURCE_VERSION ,COMPAT_VERSION );return 0 ; }
@@ -184,8 +183,4 @@ MODULE_LICENSE("GPL");MODULE_AUTHOR (DRIVER_AUTHOR );MODULE_DESCRIPTION (DRIVER_DESC );MODULE_SUPPORTED_DEVICE (DRIVER_DEVICE ); -#ifdef REVISION_VERSION -MODULE_VERSION (SOURCE_VERSION "-" REVISION_VERSION ); -#else MODULE_VERSION (SOURCE_VERSION ); -#endif
main.h +3 -8
@@ -27,8 +27,9 @@#define DRIVER_DESC "B.A.T.M.A.N. advanced"#define DRIVER_DEVICE "batman-adv" -#define SOURCE_VERSION "next" - +#ifndef SOURCE_VERSION +#define SOURCE_VERSION "2011.2.0" +#endif /* B.A.T.M.A.N. parameters */
@@ -146,12 +147,6 @@ enum dbg_level {#include "types.h" -#ifndef REVISION_VERSION -#define REVISION_VERSION_STR "" -#else -#define REVISION_VERSION_STR " "REVISION_VERSION -#endif -extern struct list_head hardif_list;extern unsigned char broadcast_addr[];
originator.c +2 -3
@@ -430,9 +430,8 @@ int orig_seq_print_text(struct seq_file *seq, void *offset) goto out; } -seq_printf (seq,"[B.A.T.M.A.N. adv %s%s, MainIF/MAC: %s/%pM (%s)]\n" , -SOURCE_VERSION ,REVISION_VERSION_STR , - primary_if->net_dev->name, +seq_printf (seq,"[B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n" , +SOURCE_VERSION , primary_if->net_dev->name, primary_if->net_dev->dev_addr, net_dev->name); seq_printf(seq, " %-15s %s (%s/%i) %17s [%10s]: %20s ...\n", "Originator", "last-seen", "#", TQ_MAX_VALUE, "Nexthop",
Signature · 1 line
1.7.5.4
PATCH 1/1 batctl: Replace version info instead of appending them
The version number of batctl can get revision numbers added. This is useful to give hints about the revision of a distribution package and the used patchset or the commit which was used to build it. The prepended source number or branch name doesn't add any additional information which would help to identify problems and can therefore be omitted.
--- Makefile | 9 ++++++--- main.c | 2 +- main.h | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-)
Makefile +6 -3
@@ -25,7 +25,6 @@ MANPAGE = man/batctl.8 # batctl flags and options CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -CPPFLAGS += -DREVISION_VERSION=$(REVISION_VERSION) LDLIBS += -lm # disable verbose output
@@ -52,8 +51,12 @@ SBINDIR = $(PREFIX)/sbin MANDIR = $(PREFIX)/share/man # try to generate revision -REVISION = $(shell if [ -d .git ]; then echo $$(git describe --always --dirty 2> /dev/null || echo "[unknown]"); fi) -REVISION_VERSION =\"\ $(REVISION)\" +REVISION= $(shell if [ -d .git ]; then \ + echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \ + fi) +ifneq ($(REVISION),) +CPPFLAGS += -DSOURCE_VERSION=\"$(REVISION)\" +endif # default target all: $(BINARY_NAME)
main.c +1 -1
@@ -95,7 +95,7 @@ int main(int argc, char **argv) goto err;if (strcmp (argv[1 ],"-v" ) ==0 ) { -printf ("batctl %s%s\n" ,SOURCE_VERSION , (strlen (REVISION_VERSION ) >3 ?REVISION_VERSION :"" )); +printf ("batctl %s\n" ,SOURCE_VERSION );exit (EXIT_SUCCESS ); }
main.h +3 -3
@@ -19,9 +19,9 @@* */ - - -#define SOURCE_VERSION "next" +#ifndef SOURCE_VERSION +#define SOURCE_VERSION "2011.2.0" +#endif #define SOCKET_PATH_FMT "%s/batman_adv/%s/socket"
Signature · 1 line
1.7.5.4
Marek Lindner
AppliedQuoted 5 lines · On Tuesday, July 05, 2011 10:42:51 Sven Eckelmann wrote:
The version number of modules build outside of the tree can get revision numbers added. This is useful to give hints about the revision of a distribution package and the used patchset. The prepended source number or branch name doesn't add any additional information which would help to identify problems and can therefore be omitted.
Applied in revision fa79bd9.
Thanks,
Marek
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH] batctl: Replace version info instead of appending them
In reply to Sven EckelmannQuoted 5 lines · On Tuesday, July 05, 2011 10:54:59 Sven Eckelmann wrote:
The version number of batctl can get revision numbers added. This is useful to give hints about the revision of a distribution package and the used patchset or the commit which was used to build it. The prepended source number or branch name doesn't add any additional information which would help to identify problems and can therefore be omitted.
Applied in revision 5052f4a.
Thanks,
Marek