Skip to content
Merged
19 changes: 0 additions & 19 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,3 @@ release_tag:
target_project: home:networkupstools:nut-releases
filters:
event: tag_push
tags:
only:
- "v[0-9]+.[0-9]+.[0-9]+"
ignore:
# v1.2.3-rc1, these need a different regex in _service of template project
- "*-*"

release_candidate_tag:
steps:
- branch_package:
source_project: home:networkupstools:nut-stable-rc
source_package: "%{SCM_REPOSITORY_NAME}"
target_project: home:networkupstools:nut-releases
filters:
event: tag_push
tags:
only:
# v1.2.3-rc1, these need a different regex in _service of template project
- "v[0-9]+.[0-9]+.[0-9]+-.*"
2 changes: 2 additions & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ several `FSD` notifications into one executed action. [PR #3097]
* Now has JSON output mode via `?json` (or `&json`) CGI query parameter.
New `@TREELINK_JSON@` keyword added and HTML templates updated to expose
these JSON documents when browsing. [issue #2524, PRs #3171, #3249]
* The `@STATUS@` directive now optionally supports separators (not only
the hard-coded `<br/>` of the older versions. [issue #2525, PR #3318]
* Handle `device.model` in addition to `ups.model` in upsstats HTML
templates. [#3180]
* Introduced a `@NUT_UPSSTATS_TEMPLATE@` command which the HTML template
Expand Down
18 changes: 13 additions & 5 deletions clients/upsstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ static void parse_var(const char *var)
upsdebug_call_finished0();
}

static void do_status(void)
static void do_status(const char *sep)
{
int i;
int i, count = 0;
char status[SMALLBUF], *ptr, *last = NULL;

upsdebug_call_starting0();
Expand All @@ -244,7 +244,9 @@ static void do_status(void)
for (i = 0; stattab[i].name != NULL; i++) {

if (!strcasecmp(ptr, stattab[i].name)) {
printf("%s<br>", stattab[i].desc);
/* Note: sep="\0" is a valid case so we do not check for *sep */
printf("%s%s", count ? (sep ? sep : "<br/>") : "", stattab[i].desc);
count++;
}
}
}
Expand Down Expand Up @@ -926,8 +928,14 @@ static int do_command(char *cmd)
return 1;
}

if (!strncmp(cmd, "STATUS ", 7)) {
do_status(&cmd[7]);
upsdebug_call_finished0();
return 1;
}

if (!strcmp(cmd, "STATUS")) {
do_status();
do_status(NULL);
upsdebug_call_finished0();
return 1;
}
Expand Down Expand Up @@ -1305,7 +1313,7 @@ static void display_tree(int verbose)

printf("<TD>%s</TD>\n", answer[2]);
printf("<TD>:</TD>\n");
printf("<TD>%s<br></TD>\n", answer[3]);
printf("<TD>%s</TD>\n", answer[3]);

printf("</TR>\n");
}
Expand Down
1 change: 0 additions & 1 deletion conf/upsstats.html.sample.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ th, td{padding:0.5ex;}
.t2{background:#0f0;}
</style>
<!-- link rel="stylesheet" type="text/css" href="nut.css" / -->
@REFRESH@
</head>
<body>

Expand Down
34 changes: 19 additions & 15 deletions docs/maintainer-guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,26 @@ symbol names and API versions, similar to what `GNUC` or `SUNW` libraries do.

* bump the release identification (consider committing as one commit later on):
** see `docs/nut-versioning.adoc` for details about NUT SEMVER spec and practice
** revise `.github/workflows/08-PyNUTClient.yml` for fallback `TAG_NAME` naming
** revise `appveyor.yml` for branch naming
** revise `scripts/Windows/build-mingw-nut.sh` for fallback value of `VER_OPT`
** revise `scripts/obs/debian.changelog` (at least a dummy entry)
** revise `scripts/obs/nut.dsc` and `scripts/obs/nut.spec` for their `Version`
fields
** update the fallback `NUT_DEFAULT_VERSION` in `tools/gitlog2version.sh` to
<exact incremented version> (ex: `2.8.0`), and provide the `VERSION_FORCED`
and `VERSION_FORCED_SEMVER` files (to same effect but more explicitly and
<exact incremented version> (ex: `2.8.0`)
*** DOUBLE-CHECK that the `NUT_DEFAULT_VERSION` in `tools/gitlog2version.sh`
is an `X.Y.Z` triplet, without the fourth `.1` suffix, for the release!
*** Note that since NUT v2.8.3 this script dictates the version propagated by
the `configure` script, so direct changes of `AC_INIT` there are no longer
needed
** commit with a relevant release message, e.g.:
+
----
:; git commit -sm 'Update versions for release of NUT v2.8.0'
----
** provide the `VERSION_FORCED` and `VERSION_FORCED_SEMVER` files (to same
effect as fallback in `tools/gitlog2version.sh` but more explicitly and
visibly) in the local workspace to be added to the `dist` archive tarball
file (DO NOT add them to git to avoid confusion later, or revert any such
addition after the release -- still has a chance to confuse e.g. branches
Expand Down Expand Up @@ -214,19 +231,6 @@ VERSION_FORCED_SEMVER:NUT_VERSION_FORCED_SEMVER='2.8.3'
# if file names in your top_srcdir are removed:
:; ln .relver/* .
----
*** DOUBLE-CHECK that the `NUT_DEFAULT_VERSION` in `tools/gitlog2version.sh`
is an `X.Y.Z` triplet, without the fourth `.1` suffix, for the release!
*** Note that since NUT v2.8.3 this script dictates the version propagated by
the `configure` script, so direct changes of `AC_INIT` there are no longer
needed
** revise `.github/workflows/PyNUTClient.yml` for fallback `TAG_NAME` naming
** revise `appveyor.yml` for branch naming
** revise `scripts/Windows/build-mingw-nut.sh` for fallback value of `VER_OPT`
** commit with a relevant release message, e.g.:
+
----
:; git commit -sm 'Update versions for release of NUT v2.8.0'
----

* last-minute update against possible master-branch changes (and be sure to
apply the release-version changes described above to your local copy of
Expand Down
7 changes: 6 additions & 1 deletion docs/man/upsstats.html.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,14 @@ Insert the META header magic for refreshing the page if that variable
has been set by the browser. This needs to be in the HEAD section of
the page.

*@STATUS separator@*::
*@STATUS@*::
Expand the abbreviations in the ups.status variable -- OL becomes
"On line", OB becomes "On battery", and so on.
"On line", OB becomes "On battery", and so on. Reported values are
separated by the specified optional separator (`<br/>` if not specified),
which starts at the next character after the "STATUS<space>" (e.g.
a `@STATUS @` directive might be used to avoid any separation, or
`@STATUS @` to separate by spaces.

*@STATUSCOLOR@*::
Insert red, green, or yellow color triplets depending on the severity of
Expand Down
14 changes: 14 additions & 0 deletions scripts/Windows/build-mingw-nut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
#
# script to cross compile NUT for Windows from Linux using MinGW-w64
# http://mingw-w64.sourceforge.net/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#set -x

Expand Down
Loading