Fixed the format of the git revision.

Removed the product title.
This commit is contained in:
Jan Vidar Krey 2009-06-25 22:04:48 +02:00
parent 0b59941102
commit 9c49f07826
4 changed files with 16 additions and 19 deletions

View File

@ -1,6 +1,6 @@
## ##
## Makefile for uhub (Use GNU make) ## Makefile for uhub (Use GNU make)
## Copyright (C) 2007-2008, Jan Vidar Krey <janvidar@extatic.org> ## Copyright (C) 2007-2009, Jan Vidar Krey <janvidar@extatic.org>
# #
CC = gcc CC = gcc
@ -61,13 +61,9 @@ else
MSG_CLEAN="Clean as a whistle" MSG_CLEAN="Clean as a whistle"
endif endif
CFLAGS += -I/source/libevent CFLAGS += -I/source/libevent
LDFLAGS += -L/source/libevent LDFLAGS += -L/source/libevent
-include release_setup.mk
ifeq ($(RELEASE),YES) ifeq ($(RELEASE),YES)
CFLAGS += -Os -DNDEBUG CFLAGS += -Os -DNDEBUG
GIT_REVISION ?= NO GIT_REVISION ?= NO
@ -131,7 +127,7 @@ LDFLAGS += -L$(LIBEVENT_PATH)
endif endif
ifeq ($(GIT_REVISION),YES) ifeq ($(GIT_REVISION),YES)
CFLAGS += -DGIT_REVISION=\"-git:$(shell git show --abbrev-commit | head -n 1 | cut -f 2 -d " ")\" CFLAGS += -DGIT_REVISION=\"$(shell git show --abbrev-commit | head -n 1 | cut -f 2 -d " ")\"
endif endif
# Sources # Sources
@ -274,5 +270,4 @@ clean:
@rm -rf $(libuhub_OBJECTS) $(PCH) *~ core $(uhub_BINARY) $(LIBUHUB) $(all_OBJECTS) && \ @rm -rf $(libuhub_OBJECTS) $(PCH) *~ core $(uhub_BINARY) $(LIBUHUB) $(all_OBJECTS) && \
echo $(MSG_CLEAN) echo $(MSG_CLEAN)
-include release_targets.mk

View File

@ -555,14 +555,14 @@ void hub_set_variables(struct hub_info* hub, struct acl_handle* acl)
int fd, ret; int fd, ret;
char buf[MAX_RECV_BUF]; char buf[MAX_RECV_BUF];
char* tmp; char* tmp;
char* server = adc_msg_escape(SERVER); /* FIXME: OOM */
hub->acl = acl; hub->acl = acl;
hub->command_info = adc_msg_construct(ADC_CMD_IINF, 15 + strlen(SERVER)); hub->command_info = adc_msg_construct(ADC_CMD_IINF, 15 + strlen(server));
if (hub->command_info) if (hub->command_info)
{ {
adc_msg_add_named_argument(hub->command_info, ADC_INF_FLAG_CLIENT_TYPE, ADC_CLIENT_TYPE_HUB); adc_msg_add_named_argument(hub->command_info, ADC_INF_FLAG_CLIENT_TYPE, ADC_CLIENT_TYPE_HUB);
adc_msg_add_named_argument(hub->command_info, ADC_INF_FLAG_USER_AGENT, SERVER); adc_msg_add_named_argument(hub->command_info, ADC_INF_FLAG_USER_AGENT, server);
tmp = adc_msg_escape(hub->config->hub_name); tmp = adc_msg_escape(hub->config->hub_name);
adc_msg_add_named_argument(hub->command_info, ADC_INF_FLAG_NICK, tmp); adc_msg_add_named_argument(hub->command_info, ADC_INF_FLAG_NICK, tmp);
@ -600,13 +600,17 @@ void hub_set_variables(struct hub_info* hub, struct acl_handle* acl)
adc_msg_add_argument(hub->command_support, ADC_PROTO_SUPPORT); adc_msg_add_argument(hub->command_support, ADC_PROTO_SUPPORT);
} }
hub->command_banner = adc_msg_construct(ADC_CMD_ISTA, 25 + strlen(SERVER)); hub->command_banner = adc_msg_construct(ADC_CMD_ISTA, 25 + strlen(server));
if (hub->command_banner) if (hub->command_banner)
{ {
adc_msg_add_argument(hub->command_banner, "000 Powered\\sby\\s" SERVER); tmp = adc_msg_escape("Powered by " SERVER);
adc_msg_add_argument(hub->command_banner, "000");
adc_msg_add_argument(hub->command_banner, tmp);
hub_free(tmp);
} }
hub->status = (hub->config->hub_enabled ? hub_status_running : hub_status_disabled); hub->status = (hub->config->hub_enabled ? hub_status_running : hub_status_disabled);
hub_free(server);
} }

View File

@ -191,7 +191,7 @@ int check_configuration(int dump)
void print_version() void print_version()
{ {
fprintf(stdout, "" PRODUCT " " VERSION " " PRODUCT_TITLE "\n"); fprintf(stdout, "" PRODUCT " " VERSION "\n");
fprintf(stdout, "Copyright (C) 2007-2009, Jan Vidar Krey <janvidar@extatic.org>\n" fprintf(stdout, "Copyright (C) 2007-2009, Jan Vidar Krey <janvidar@extatic.org>\n"
"This is free software with ABSOLUTELY NO WARRANTY.\n\n"); "This is free software with ABSOLUTELY NO WARRANTY.\n\n");
exit(0); exit(0);

View File

@ -2,16 +2,14 @@
#define PRODUCT "uHub" #define PRODUCT "uHub"
#endif #endif
#ifndef PRODUCT_TITLE
#define PRODUCT_TITLE "(micro-Hub)"
#endif
#ifndef GIT_REVISION #ifndef GIT_REVISION
#define GIT_REVISION "" #define REVISION ""
#else
#define REVISION " (git: " GIT_REVISION ")"
#endif #endif
#ifndef VERSION #ifndef VERSION
#define VERSION "0.3.0-rc2" GIT_REVISION #define VERSION "0.3.0-rc2" REVISION
#endif #endif
#ifndef COPYRIGHT #ifndef COPYRIGHT