See SUBJ and Patch. Regards, Honza
commit 01cbe593996c01af1c5fa1e507954f27a9abd106 Author: Jan Friesse <jfrie...@redhat.com> Date: Tue Jul 28 11:56:15 2009 +0200
Added support for -v (version) feature This can be usefull for easier way to get informations of the corosync version from users. Version (trunk) and SVN revision (get by svninfo -c) are displayed. diff --git a/trunk/autogen.sh b/trunk/autogen.sh index 83770a1..ede39aa 100755 --- a/trunk/autogen.sh +++ b/trunk/autogen.sh @@ -3,3 +3,9 @@ echo Building configuration system... autoreconf -i && echo Now run ./configure and make + +# Tag version +version="trunk" +revision=`svnversion -c` +echo '#define RELEASE_VERSION "'$version'"' > exec/version.h +echo '#define SVN_REVISION "'$revision'"' >> exec/version.h diff --git a/trunk/exec/main.c b/trunk/exec/main.c index 96919b6..fafd1b8 100644 --- a/trunk/exec/main.c +++ b/trunk/exec/main.c @@ -757,7 +757,7 @@ int main (int argc, char **argv) background = 1; setprio = 1; - while ((ch = getopt (argc, argv, "fp")) != EOF) { + while ((ch = getopt (argc, argv, "fpv")) != EOF) { switch (ch) { case 'f': @@ -767,11 +767,18 @@ int main (int argc, char **argv) case 'p': setprio = 0; break; + case 'v': + printf ("Corosync Cluster Engine, version '%s' SVN revision '%s'\n", RELEASE_VERSION, SVN_REVISION); + printf ("Copyright (c) 2006-2009 Red Hat, Inc.\n"); + return EXIT_SUCCESS; + + break; default: fprintf(stderr, \ "usage:\n"\ " -f : Start application in foreground.\n"\ - " -p : Do not set process priority. \n"); + " -p : Do not set process priority. \n"\ + " -v : Display version and SVN revision of Corosync and exit.\n"); return EXIT_FAILURE; } } diff --git a/trunk/exec/version.h b/trunk/exec/version.h index 6c21615..22f07f8 100644 --- a/trunk/exec/version.h +++ b/trunk/exec/version.h @@ -1 +1,2 @@ #define RELEASE_VERSION "trunk" +#define SVN_REVISION "exported"
_______________________________________________ Openais mailing list Openais@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/openais