Split SOURCE_VERSION in RELEASE- AND EXTRA_VERSION
Commit Message
RELEASE_VERSION and EXTRA_VERSION can be concatenate to a single
SOURCE_VERSION string. This makes it possible to detect unstable
versions during compile time instead of removing the unstable warning
in a seperate commit (or forget this change).
Before releasing the a new stable version the release manager must set
EXTRA_VERSION to "", check INSTALL, THANKS and README and then create
the tag in the repository.
Afterwards the development branch should change the RELEASE_VERSION to
the upcoming version number and the EXTRA_VERSION to a string which
informs the user that it is "unstable" and in development. This could be
for example "-dev", "-pre-alpha", "-beta" or "-rc1".
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
batman/batman.h | 5 ++++-
batman/posix/init.c | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
Comments
Hello Sven,
> Afterwards the development branch should change the RELEASE_VERSION to
> the upcoming version number and the EXTRA_VERSION to a string which
> informs the user that it is "unstable" and in development. This could be
> for example "-dev", "-pre-alpha", "-beta" or "-rc1".
I like your patch a lot. It could solve a nasty little problem that always
tends to be forgotten. :-)
Unfortunately, our compile farm which feeds the package repository extracts
the SOURCE_VERSION from batman.h to generate the package name. Unless we
rewrite the compile scripts to extract both defines we can't apply your patch
as-is. This rewrite is not as painless as it could be. Certainly, at some
point we want to touch the scripts to optimize the speed but that wasn't on
our agenda right now.
Do you see alternatives which allow us to reuse the existing compile farm and
have the functionality you implemented ?
Regards,
Marek
On Sunday 28 December 2008 15:24:57 Marek Lindner wrote:
> Hello Sven,
>
> > Afterwards the development branch should change the RELEASE_VERSION to
> > the upcoming version number and the EXTRA_VERSION to a string which
> > informs the user that it is "unstable" and in development. This could be
> > for example "-dev", "-pre-alpha", "-beta" or "-rc1".
>
> I like your patch a lot. It could solve a nasty little problem that always
> tends to be forgotten. :-)
Yes, Simon told me about that :D
> Unfortunately, our compile farm which feeds the package repository extracts
> the SOURCE_VERSION from batman.h to generate the package name. Unless we
> rewrite the compile scripts to extract both defines we can't apply your
> patch as-is. This rewrite is not as painless as it could be. Certainly, at
> some point we want to touch the scripts to optimize the speed but that
> wasn't on our agenda right now.
Didn't know that but that makes patch of course useless. I liked the idea to
have a version which marks the next release and the extra part which marks the
actual status of the next release. This is only one way to express this.
> Do you see alternatives which allow us to reuse the existing compile farm
> and have the functionality you implemented ?
We could also assume that the version string has a specific format. A version
number (RELEASE_VERSION part thing in my last patch) which has a postfix
seperated by a dash. If that dash is found in the version string then we have
a postfix and we are currently in a unstable version.
Don't know if this makes really sense for B.A.T.M.A.N. but the patch for that
is trivial.
Best regards,
Sven Eckelmann
@@ -39,7 +39,8 @@
-#define SOURCE_VERSION "0.3.1" /* put exactly one distinct word inside the string like "0.3-pre-alpha" or "0.3-rc1" or "0.3" */
+#define RELEASE_VERSION "0.3.1" /* put exactly one distinct word inside the string like "0.3" or "0.3.1" */
+#define EXTRA_VERSION "" /* put one or less distinct words inside the string like "-pre-alpha" or "-rc1" or "" */
#define COMPAT_VERSION 5
#define PORT 4305
#define GW_PORT 4306
@@ -66,6 +67,8 @@
#define REVISION_VERSION "0"
#endif
+#define SOURCE_VERSION RELEASE_VERSION""EXTRA_VERSION
+
/*
@@ -249,7 +249,8 @@ void apply_init_args( int argc, char *argv[] ) {
stop = 0;
prog_name = argv[0];
-/* printf( "WARNING: You are using the unstable batman branch. If you are interested in *using* batman get the latest stable release !\n" );*/
+ if (strlen(EXTRA_VERSION) > 0)
+ printf( "WARNING: You are using the unstable batman branch. If you are interested in *using* batman get the latest stable release !\n" );
while ( ( optchar = getopt_long( argc, argv, "a:A:bcd:hHio:g:p:r:s:vV", long_options, &option_index ) ) != -1 ) {