/* 190 */ /* UserNode.h */
/* 191-193 */ #include "ModuleFunctions.h"
/* 194 */ /* bots.h */
+/* 195-196 */ /* version.h */
#define Function void *
/* 191 */ (Function) module_global_cmd_register_neonbackup,
/* 192 */ (Function) module_global_cmd_unregister_neonbackup,
/* 193 */ (Function) module_neonbackup_recover_chan,
-/* 194 */ (Function) requestInvite
+/* 194 */ (Function) requestInvite,
+/* 195 */ (Function) is_stable_revision,
+/* 196 */ (Function) get_dev_revision
};
static int module_id_counter = 1;
#endif
if(strcmp(get_revision(), ""))
- sprintf(tmp, "%s.%d (%s)", NEONSERV_VERSION, get_patchlevel(), get_revision());
+ sprintf(tmp, "%s.%d (%s: %s)", NEONSERV_VERSION, get_patchlevel(), (is_stable_revision() ? "stable" : "dev"), (is_stable_revision() ? get_revision() : get_dev_revision()));
else
sprintf(tmp, "%s.%d", NEONSERV_VERSION, get_patchlevel());
content[0] = get_language_string(user, "NS_NETINFO_VERSION");
*/
CMD_BIND(global_cmd_version) {
- reply(textclient, user, "\002NeonServ %s.%d\002 (%s), written by pk910", NEONSERV_VERSION, get_patchlevel(), (strcmp(get_revision(), "") ? get_revision() : "-"));
+ reply(textclient, user, "\002NeonServ %s.%d %s\002 (%s), written by pk910", NEONSERV_VERSION, get_patchlevel(), (is_stable_revision() ? "(stable)" : "(dev)"), (is_stable_revision() ? (strcmp(get_revision(), "") ? get_revision() : "-") : get_dev_revision()));
reply(textclient, user, "Build (#%s) %s (%s lines, " COMPILER ")", get_compilation(), get_creation(), get_codelines());
reply(textclient, user, "NeonServ can be found on: http://dev.pk910.de/NeonServ");
//helpers :D
/* 192 */ #define module_global_cmd_unregister_neonbackup ((void (*)(char *))global[192])
/* 193 */ #define module_neonbackup_recover_chan ((void (*)(struct ChanNode *))global[193])
/* 194 */ #define requestInvite ((void (*)(struct UserNode *, struct ChanNode *))global[194])
+/* 195 */ #define is_stable_revision ((const int (*)(void))global[195])
+/* 196 */ #define get_dev_revision ((const char * (*)(void))global[196])
#define MODULE_HEADER(initfunc,startfunc,stopfunc) \
void **global = NULL; \
extern const char *creation;
extern const char *revision;
extern const char *codelines;
+extern const int revision_master;
+extern const char *dev_revision;
extern const int patchlevel;
const char *get_compilation();
const char *get_creation();
const char *get_revision();
+const int is_stable_revision();
+const char *get_dev_revision();
const char *get_codelines();
const int get_patchlevel();
#endif
codelines=`find . -type f -regex '\./.*\.h' -or -regex '\./.*\.c' |xargs cat|wc -l`
-git_revision=`git rev-list -n 1 --pretty="format:%h" --header master | grep '^[0-9a-f]*$'`
-if test "x$git_revision" = "x" ; then
+git_revision_id=`git rev-list -n 1 --pretty="format:%h" --header refs/heads/master | grep '^[0-9a-f]*$'`
+if test "x$git_revision_id" = "x" ; then
git_revision="0"
git_commitcount="0"
+ git_is_stable="1"
+ git_dev_rev=""
else
- git_commitcount=`git rev-list --oneline --header master | wc -l | sed "s/[ \t]//g"`
- git_revision="git-$git_commitcount-$git_revision"
+ git_commitcount=`git rev-list --oneline --first-parent refs/heads/master | wc -l | sed "s/[ \t]//g"`
+ git_revision="git-$git_revision_id"
+
+ git_real_revision_id=`git rev-list -n 1 --pretty="format:%h" --header HEAD | grep '^[0-9a-f]*$'`
+ if test "$git_revision_id" = "$git_real_revision_id" ; then
+ git_is_stable="1"
+ git_dev_rev=""
+ else
+ git_is_stable="0"
+ git_dev_rev="git-$git_real_revision_id"
+ fi
fi
const char *creation = "$creation";
const char *revision = "$git_revision";
const char *codelines = "$codelines";
+const int revision_master = $git_is_stable;
+const char *dev_revision = "$git_dev_rev";
const int patchlevel = ($git_commitcount ? ($git_commitcount - VERSION_PATCHLEVEL) : 0);
return codelines;
}
+const int is_stable_revision() {
+ return revision_master;
+}
+
+const char *get_dev_revision() {
+ return dev_revision;
+}
+
const int get_patchlevel() {
return patchlevel;
}