[Nut-upsdev] Patch -- SVN revision in the version string
Eric S. Raymond
esr at thyrsus.com
Fri May 25 06:14:31 UTC 2007
This is the patch to include SVN revision level in version number displays.
There should be two enclosures; the patch itself and a new source file.
common/upsversion.c.
upversion.c defines a single function. upsversion(), that returns a version
string for display. Some Makefile trickery ensures that this file will
be recompiled whenever the project's SVN revision level has changed since
it was last built.
The other point of having a function is so this can encapsulate our policy
about how to compose a version string. At the moment, the policy is this:
if the output of svnversion -n is empty, display only the configured
version number. If it's non-empty, display the output in parentheses
after the configured version number.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
-------------- next part --------------
Diffs between last version checked in and current workfile(s):
Index: clients/upsc.c
===================================================================
--- clients/upsc.c (revision 916)
+++ clients/upsc.c (working copy)
@@ -27,7 +27,7 @@
static void help(const char *prog)
{
- printf("Network UPS Tools upsc %s\n\n", UPS_VERSION);
+ printf("Network UPS Tools upsc %s\n\n", upsversion());
printf("usage: %s -l | -L [<hostname>[:port]]\n", prog);
printf(" %s <ups> [<variable>]\n", prog);
@@ -223,7 +223,7 @@
/* special cases since we're not using getopt */
if (!strcmp(argv[1], "-V")) {
- printf("Network UPS Tools upsc %s\n", UPS_VERSION);
+ printf("Network UPS Tools upsc %s\n", upsversion());
exit(EXIT_SUCCESS);
}
Index: clients/upscmd.c
===================================================================
--- clients/upscmd.c (revision 916)
+++ clients/upscmd.c (working copy)
@@ -34,7 +34,7 @@
static void usage(char *prog)
{
- printf("Network UPS Tools upscmd %s\n\n", UPS_VERSION);
+ printf("Network UPS Tools upscmd %s\n\n", upsversion());
printf("usage: %s [-h]\n", prog);
printf(" %s [-l <ups>]\n", prog);
printf(" %s [-u <username>] [-p <password>] <ups> <command>\n\n", prog);
@@ -234,7 +234,7 @@
case 'V':
printf("Network UPS Tools upscmd %s\n",
- UPS_VERSION);
+ upsversion());
exit(EXIT_SUCCESS);
case 'h':
Index: clients/upslog.c
===================================================================
--- clients/upslog.c (revision 916)
+++ clients/upslog.c (working copy)
@@ -375,7 +375,7 @@
logformat = DEFAULT_LOGFORMAT;
user = RUN_AS_USER;
- printf("Network UPS Tools upslog %s\n", UPS_VERSION);
+ printf("Network UPS Tools upslog %s\n", upsversion());
prog = argv[0];
Index: clients/upsmon.c
===================================================================
--- clients/upsmon.c (revision 916)
+++ clients/upsmon.c (working copy)
@@ -1931,7 +1931,7 @@
cmd = 0;
- printf("Network UPS Tools upsmon %s\n", UPS_VERSION);
+ printf("Network UPS Tools upsmon %s\n", upsversion());
while ((i = getopt(argc, argv, "+Dhic:f:pu:VK46")) != -1) {
switch (i) {
Index: clients/upsrw.c
===================================================================
--- clients/upsrw.c (revision 916)
+++ clients/upsrw.c (working copy)
@@ -33,7 +33,7 @@
static void usage(const char *prog)
{
- printf("Network UPS Tools upsrw %s\n\n", UPS_VERSION);
+ printf("Network UPS Tools upsrw %s\n\n", upsversion());
printf("usage: %s [-h]\n", prog);
printf(" %s [-s <variable>] [-u <username>] [-p <password>] <ups>\n\n", prog);
printf("Demo program to set variables within UPS hardware.\n");
@@ -460,7 +460,7 @@
username = optarg;
break;
case 'V':
- printf("Network UPS Tools upsrw %s\n", UPS_VERSION);
+ printf("Network UPS Tools upsrw %s\n", upsversion());
exit(EXIT_SUCCESS);
default:
usage(prog);
Index: clients/upsset.c
===================================================================
--- clients/upsset.c (revision 916)
+++ clients/upsset.c (working copy)
@@ -145,7 +145,7 @@
printf("<TABLE CELLPADDING=\"5\" CELLSPACING=\"0\" ALIGN=\"CENTER\" WIDTH=\"100%%\">\n");
printf("<TR><TH COLSPAN=2 BGCOLOR=\"#60B0B0\">\n");
printf("<FONT SIZE=\"+2\">Network UPS Tools upsset %s</FONT>\n",
- UPS_VERSION);
+ upsversion());
printf("</TH></TR>\n");
}
Index: clients/upsstats.c
===================================================================
--- clients/upsstats.c (revision 916)
+++ clients/upsstats.c (working copy)
@@ -731,7 +731,7 @@
return do_img(&cmd[4]);
if (!strcmp(cmd, "VERSION")) {
- printf("%s\n", UPS_VERSION);
+ printf("%s\n", upsversion());
return 1;
}
Index: common/Makefile.am
===================================================================
--- common/Makefile.am (revision 916)
+++ common/Makefile.am (working copy)
@@ -1,11 +1,21 @@
# Network UPS Tools: common
-AM_CFLAGS = -I$(top_srcdir)/include
+SVNREV = $(shell svnversion -n $(topdir) 2>/dev/null)
+# Should be touched each time the SVN revision number goes up
+revision-stamp: FORCE
+ if [ x"$(SVNREV)" != x`cat revision-stamp 2>/dev/null` ]; then echo -n $(SVNREV) >revision-stamp; fi
+
+FORCE:
+
+AM_CFLAGS = -I$(top_srcdir)/include "-DSVNREV=\"$(SVNREV)\""
+
noinst_LIBRARIES = libcommon.a
-libcommon_a_SOURCES = common.c
+libcommon_a_SOURCES = common.c upsversion.c
libcommon_a_LIBADD = $(LIBOBJS) $(ALLOCA)
+upsversion.o: revision-stamp
+
all: libcommon.a upsconf.o parseconf.o state.o parseconf.lo
# Define a dummy library so that Automake builds rules for the
Index: common/upsversion.c
===================================================================
--- common/upsversion.c (revision 0)
+++ common/upsversion.c (revision 0)
@@ -0,0 +1,10 @@
+#include "config.h"
+#include "common.h"
+
+const char *upsversion(void)
+{
+ if (SVNREV[0])
+ return UPS_VERSION " (" SVNREV ")";
+ else
+ return UPS_VERSION;
+}
Index: drivers/al175.c
===================================================================
--- drivers/al175.c (revision 916)
+++ drivers/al175.c (working copy)
@@ -1296,7 +1296,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Eltek AL175/COMLI support module %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
/*
* This driver does not support upsdrv_shutdown(), which makes
* it not very useful in a real world application. This alone
Index: drivers/apcsmart.c
===================================================================
--- drivers/apcsmart.c (revision 916)
+++ drivers/apcsmart.c (working copy)
@@ -1199,7 +1199,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools (version %s) - APC Smart protocol driver\n",
- UPS_VERSION);
+ upsversion());
printf("\tDriver version %s, command table %s\n",
APC_DRIVER_VERSION,
APC_TABLE_VERSION);
Index: drivers/bcmxcp.c
===================================================================
--- drivers/bcmxcp.c (revision 916)
+++ drivers/bcmxcp.c (working copy)
@@ -1252,7 +1252,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - BCMXCP UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1;
}
Index: drivers/belkin.c
===================================================================
--- drivers/belkin.c (revision 916)
+++ drivers/belkin.c (working copy)
@@ -393,7 +393,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Belkin Smart protocol driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_help(void)
Index: drivers/belkinunv.c
===================================================================
--- drivers/belkinunv.c (revision 916)
+++ drivers/belkinunv.c (working copy)
@@ -1282,7 +1282,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Belkin 'Universal UPS' driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
/* prep the serial port */
Index: drivers/bestfcom.c
===================================================================
--- drivers/bestfcom.c (revision 916)
+++ drivers/bestfcom.c (working copy)
@@ -436,7 +436,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Best Ferrups/Fortress %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1;
}
Index: drivers/bestuferrups.c
===================================================================
--- drivers/bestuferrups.c (revision 916)
+++ drivers/bestuferrups.c (working copy)
@@ -344,7 +344,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Best Ferrups Series ME/RE/MD %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
static void sync_serial(void) {
Index: drivers/bestups.c
===================================================================
--- drivers/bestups.c (revision 916)
+++ drivers/bestups.c (working copy)
@@ -395,7 +395,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Best UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/cpsups.c
===================================================================
--- drivers/cpsups.c (revision 916)
+++ drivers/cpsups.c (working copy)
@@ -464,7 +464,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - CyberPower text protocol UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1; /* Causes a warning message to be printed */
}
Index: drivers/cyberpower.c
===================================================================
--- drivers/cyberpower.c (revision 916)
+++ drivers/cyberpower.c (working copy)
@@ -519,7 +519,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - CyberPower driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_help(void)
Index: drivers/dummy-ups.c
===================================================================
--- drivers/dummy-ups.c (revision 916)
+++ drivers/dummy-ups.c (working copy)
@@ -102,7 +102,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Dummy UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/energizerups.c
===================================================================
--- drivers/energizerups.c (revision 916)
+++ drivers/energizerups.c (working copy)
@@ -478,7 +478,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Energizer USB UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1; /* Causes a warning to be printed */
}
Index: drivers/etapro.c
===================================================================
--- drivers/etapro.c (revision 916)
+++ drivers/etapro.c (working copy)
@@ -346,7 +346,7 @@
upsdrv_banner(void)
{
printf("Network UPS Tools - ETA PRO driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void
Index: drivers/everups.c
===================================================================
--- drivers/everups.c (revision 916)
+++ drivers/everups.c (working copy)
@@ -179,7 +179,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Ever UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/gamatronic.c
===================================================================
--- drivers/gamatronic.c (revision 916)
+++ drivers/gamatronic.c (working copy)
@@ -328,7 +328,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Gamatronic UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void setup_serial(const char *port)
Index: drivers/genericups.c
===================================================================
--- drivers/genericups.c (revision 916)
+++ drivers/genericups.c (working copy)
@@ -256,7 +256,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Generic UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_makevartable(void)
Index: drivers/isbmex.c
===================================================================
--- drivers/isbmex.c (revision 916)
+++ drivers/isbmex.c (working copy)
@@ -333,7 +333,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - ISBMEX UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/liebert.c
===================================================================
--- drivers/liebert.c (revision 916)
+++ drivers/liebert.c (working copy)
@@ -163,7 +163,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Liebert MultiLink UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1;
}
Index: drivers/main-hal.c
===================================================================
--- drivers/main-hal.c (revision 916)
+++ drivers/main-hal.c (working copy)
@@ -680,7 +680,7 @@
dstate_init(progname, device_name);
/* publish the top-level data: version number, driver name */
- dstate_setinfo("driver.version", "%s", UPS_VERSION);
+ dstate_setinfo("driver.version", "%s", upsversion());
dstate_setinfo("driver.name", "%s", progname);
/* The poll_interval may have been changed from the default */
Index: drivers/main.c
===================================================================
--- drivers/main.c (revision 916)
+++ drivers/main.c (working copy)
@@ -578,7 +578,7 @@
dstate_init(progname, device_name);
/* publish the top-level data: version number, driver name */
- dstate_setinfo("driver.version", "%s", UPS_VERSION);
+ dstate_setinfo("driver.version", "%s", upsversion());
dstate_setinfo("driver.name", "%s", progname);
/* The poll_interval may have been changed from the default */
Index: drivers/masterguard.c
===================================================================
--- drivers/masterguard.c (revision 916)
+++ drivers/masterguard.c (working copy)
@@ -561,7 +561,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - MASTERGUARD UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
/********************************************************************
Index: drivers/megatec.c
===================================================================
--- drivers/megatec.c (revision 916)
+++ drivers/megatec.c (working copy)
@@ -781,7 +781,7 @@
void upsdrv_banner(void)
{
- printf("Network UPS Tools %s - Megatec protocol driver %s [%s]\n", UPS_VERSION, DRV_VERSION, progname);
+ printf("Network UPS Tools %s - Megatec protocol driver %s [%s]\n", upsversion(), DRV_VERSION, progname);
printf("Carlos Rodrigues (c) 2003-2007\n\n");
megatec_subdrv_banner();
Index: drivers/mge-shut.c
===================================================================
--- drivers/mge-shut.c (revision 916)
+++ drivers/mge-shut.c (working copy)
@@ -282,7 +282,7 @@
void upsdrv_banner (void)
{
printf("Network UPS Tools - %s %s (%s)\n",
- DRIVER_NAME, DRIVER_VERSION, UPS_VERSION);
+ DRIVER_NAME, DRIVER_VERSION, upsversion());
}
/* --------------------------------------------------------------- */
Index: drivers/mge-utalk.c
===================================================================
--- drivers/mge-utalk.c (revision 916)
+++ drivers/mge-utalk.c (working copy)
@@ -100,7 +100,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - %s %s (%s)\n",
- DRIVER_NAME, DRIVER_VERSION, UPS_VERSION);
+ DRIVER_NAME, DRIVER_VERSION, upsversion());
}
/* --------------------------------------------------------------- */
Index: drivers/nitram.c
===================================================================
--- drivers/nitram.c (revision 916)
+++ drivers/nitram.c (working copy)
@@ -328,7 +328,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Nitram UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
Index: drivers/oneac.c
===================================================================
--- drivers/oneac.c (revision 916)
+++ drivers/oneac.c (working copy)
@@ -278,7 +278,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Oneac EG/ON UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1; /*causes a warning to be printed*/
}
Index: drivers/optiups.c
===================================================================
--- drivers/optiups.c (revision 916)
+++ drivers/optiups.c (working copy)
@@ -532,7 +532,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Opti-UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/powercom.c
===================================================================
--- drivers/powercom.c (revision 916)
+++ drivers/powercom.c (working copy)
@@ -546,7 +546,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - PowerCom and similars protocol UPS driver %s (%s)\n\n",
- POWERCOM_DRIVER_VERSION, UPS_VERSION);
+ POWERCOM_DRIVER_VERSION, upsversion());
}
/* initialize information */
Index: drivers/powerpanel.c
===================================================================
--- drivers/powerpanel.c (revision 916)
+++ drivers/powerpanel.c (working copy)
@@ -794,7 +794,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - CyberPower text/binary protocol UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1;
}
Index: drivers/rhino.c
===================================================================
--- drivers/rhino.c (revision 916)
+++ drivers/rhino.c (working copy)
@@ -789,7 +789,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Microsol Rhino UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
printf("by Silvino B. Magalhaes for Microsol - sbm2yk at gmail.com\n\n");
}
Index: drivers/safenet.c
===================================================================
--- drivers/safenet.c (revision 916)
+++ drivers/safenet.c (working copy)
@@ -407,7 +407,7 @@
void upsdrv_banner(void)
{
- printf("Network UPS Tools - Generic SafeNet UPS driver %s (%s)\n\n", DRV_VERSION, UPS_VERSION);
+ printf("Network UPS Tools - Generic SafeNet UPS driver %s (%s)\n\n", DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/skel.c
===================================================================
--- drivers/skel.c (revision 916)
+++ drivers/skel.c (working copy)
@@ -117,7 +117,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Skeleton UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/snmp-ups.c
===================================================================
--- drivers/snmp-ups.c (revision 916)
+++ drivers/snmp-ups.c (working copy)
@@ -148,7 +148,7 @@
void upsdrv_banner(void)
{
upslogx(1,"Network UPS Tools - Multi-MIBS SNMP UPS driver %s (%s)",
- DRIVER_VERSION, UPS_VERSION);
+ DRIVER_VERSION, upsversion());
experimental_driver = 1;
}
Index: drivers/solis.c
===================================================================
--- drivers/solis.c (revision 916)
+++ drivers/solis.c (working copy)
@@ -1124,7 +1124,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Microsol Solis UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
printf("by Silvino B. Magalhaes for Microsol - sbm2yk at gmail.com\n\n");
}
Index: drivers/tripplite.c
===================================================================
--- drivers/tripplite.c (revision 916)
+++ drivers/tripplite.c (working copy)
@@ -518,7 +518,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Tripp-Lite SmartUPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: drivers/tripplite_usb.c
===================================================================
--- drivers/tripplite_usb.c (revision 916)
+++ drivers/tripplite_usb.c (working copy)
@@ -1345,7 +1345,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Tripp Lite OMNIVS and SMARTPRO driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1;
}
Index: drivers/tripplitesu.c
===================================================================
--- drivers/tripplitesu.c (revision 916)
+++ drivers/tripplitesu.c (working copy)
@@ -804,7 +804,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - Tripp Lite SmartOnline driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
experimental_driver = 1;
}
Index: drivers/upscode2.c
===================================================================
--- drivers/upscode2.c (revision 916)
+++ drivers/upscode2.c (working copy)
@@ -441,7 +441,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - UPScode II UPS driver %s (%s)\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
printf("Copyright (C) 2001-2002 H K Lygre, <hklygre at online.no>\n");
printf("Copyright (C) 2004-2006 Niels Baggesen <niels at baggesen.net>\n");
printf("Copyright (C) 2006 Niklas Edmundsson <nikke at acc.umu.se>\n\n");
Index: drivers/upsdrvctl.c
===================================================================
--- drivers/upsdrvctl.c (revision 916)
+++ drivers/upsdrvctl.c (working copy)
@@ -395,7 +395,7 @@
void (*command)(const ups_t *) = NULL;
printf("Network UPS Tools - UPS driver controller %s\n",
- UPS_VERSION);
+ upsversion());
prog = argv[0];
while ((i = getopt(argc, argv, "+htu:r:DV")) != -1) {
Index: drivers/usbhid-ups.c
===================================================================
--- drivers/usbhid-ups.c (revision 916)
+++ drivers/usbhid-ups.c (working copy)
@@ -529,7 +529,7 @@
{
printf("Network UPS Tools: %s %s - core %s (%s)\n\n",
comm_driver->name, comm_driver->version,
- DRIVER_VERSION, UPS_VERSION);
+ DRIVER_VERSION, upsversion());
}
void upsdrv_updateinfo(void)
Index: drivers/victronups.c
===================================================================
--- drivers/victronups.c (revision 916)
+++ drivers/victronups.c (working copy)
@@ -504,7 +504,7 @@
void upsdrv_banner(void)
{
printf("Network UPS Tools - GE/IMV/Victron UPS driver %s (%s)\n\n",
- DRV_VERSION, UPS_VERSION);
+ DRV_VERSION, upsversion());
}
void upsdrv_initups(void)
Index: include/common.h
===================================================================
--- include/common.h (revision 916)
+++ include/common.h (working copy)
@@ -86,6 +86,7 @@
/* Return the alternate path for pid files */
const char * altpidpath(void);
+const char *upsversion(void);
void upslog_with_errno(int priority, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
void upslogx(int priority, const char *fmt, ...)
Index: server/netget.c
===================================================================
--- server/netget.c (revision 916)
+++ server/netget.c (working copy)
@@ -165,13 +165,13 @@
sendback(client, "VAR %s server.info "
"\"Network UPS Tools upsd %s - "
"http://www.networkupstools.org/\"\n",
- upsname, UPS_VERSION);
+ upsname, upsversion());
return;
}
if (!strcasecmp(var, "server.version")) {
sendback(client, "VAR %s server.version \"%s\"\n",
- upsname, UPS_VERSION);
+ upsname, upsversion());
return;
}
Index: server/netmisc.c
===================================================================
--- server/netmisc.c (revision 916)
+++ server/netmisc.c (working copy)
@@ -35,7 +35,7 @@
}
sendback(client, "Network UPS Tools upsd %s - http://www.networkupstools.org/\n",
- UPS_VERSION);
+ upsversion());
}
void net_help(ctype_t *client, int numarg, const char **arg)
Index: server/upsd.c
===================================================================
--- server/upsd.c (revision 916)
+++ server/upsd.c (working copy)
@@ -971,7 +971,7 @@
/* set up some things for later */
snprintf(pidfn, sizeof(pidfn), "%s/upsd.pid", altpidpath());
- printf("Network UPS Tools upsd %s\n", UPS_VERSION);
+ printf("Network UPS Tools upsd %s\n", upsversion());
while ((i = getopt(argc, argv, "+h46p:r:i:fu:Vc:D")) != -1) {
switch (i) {
End of diffs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: upsversion.c
Type: text/x-csrc
Size: 160 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20070525/8aaf8505/attachment.c
More information about the Nut-upsdev
mailing list