Skip to content

Commit b0b3898

Browse files
authored
Merge pull request networkupstools#3320 from jimklimov/prepare-release-2.8.5-picks
Pick some changes from "prepare release 2.8.5" branch and PR networkupstools#3318
2 parents 1ae96a7 + f022e6d commit b0b3898

File tree

7 files changed

+54
-41
lines changed

7 files changed

+54
-41
lines changed

.obs/workflows.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,3 @@ release_tag:
2828
target_project: home:networkupstools:nut-releases
2929
filters:
3030
event: tag_push
31-
tags:
32-
only:
33-
- "v[0-9]+.[0-9]+.[0-9]+"
34-
ignore:
35-
# v1.2.3-rc1, these need a different regex in _service of template project
36-
- "*-*"
37-
38-
release_candidate_tag:
39-
steps:
40-
- branch_package:
41-
source_project: home:networkupstools:nut-stable-rc
42-
source_package: "%{SCM_REPOSITORY_NAME}"
43-
target_project: home:networkupstools:nut-releases
44-
filters:
45-
event: tag_push
46-
tags:
47-
only:
48-
# v1.2.3-rc1, these need a different regex in _service of template project
49-
- "v[0-9]+.[0-9]+.[0-9]+-.*"

NEWS.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ several `FSD` notifications into one executed action. [PR #3097]
348348
* Now has JSON output mode via `?json` (or `&json`) CGI query parameter.
349349
New `@TREELINK_JSON@` keyword added and HTML templates updated to expose
350350
these JSON documents when browsing. [issue #2524, PRs #3171, #3249]
351+
* The `@STATUS@` directive now optionally supports separators (not only
352+
the hard-coded `<br/>` of the older versions. [issue #2525, PR #3318]
351353
* Handle `device.model` in addition to `ups.model` in upsstats HTML
352354
templates. [#3180]
353355
* Introduced a `@NUT_UPSSTATS_TEMPLATE@` command which the HTML template

clients/upsstats.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ static void parse_var(const char *var)
227227
upsdebug_call_finished0();
228228
}
229229

230-
static void do_status(void)
230+
static void do_status(const char *sep)
231231
{
232-
int i;
232+
int i, count = 0;
233233
char status[SMALLBUF], *ptr, *last = NULL;
234234

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

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

931+
if (!strncmp(cmd, "STATUS ", 7)) {
932+
do_status(&cmd[7]);
933+
upsdebug_call_finished0();
934+
return 1;
935+
}
936+
929937
if (!strcmp(cmd, "STATUS")) {
930-
do_status();
938+
do_status(NULL);
931939
upsdebug_call_finished0();
932940
return 1;
933941
}
@@ -1305,7 +1313,7 @@ static void display_tree(int verbose)
13051313

13061314
printf("<TD>%s</TD>\n", answer[2]);
13071315
printf("<TD>:</TD>\n");
1308-
printf("<TD>%s<br></TD>\n", answer[3]);
1316+
printf("<TD>%s</TD>\n", answer[3]);
13091317

13101318
printf("</TR>\n");
13111319
}

conf/upsstats.html.sample.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ th, td{padding:0.5ex;}
4141
.t2{background:#0f0;}
4242
</style>
4343
<!-- link rel="stylesheet" type="text/css" href="nut.css" / -->
44-
@REFRESH@
4544
</head>
4645
<body>
4746

docs/maintainer-guide.txt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,26 @@ symbol names and API versions, similar to what `GNUC` or `SUNW` libraries do.
164164

165165
* bump the release identification (consider committing as one commit later on):
166166
** see `docs/nut-versioning.adoc` for details about NUT SEMVER spec and practice
167+
** revise `.github/workflows/08-PyNUTClient.yml` for fallback `TAG_NAME` naming
168+
** revise `appveyor.yml` for branch naming
169+
** revise `scripts/Windows/build-mingw-nut.sh` for fallback value of `VER_OPT`
170+
** revise `scripts/obs/debian.changelog` (at least a dummy entry)
171+
** revise `scripts/obs/nut.dsc` and `scripts/obs/nut.spec` for their `Version`
172+
fields
167173
** update the fallback `NUT_DEFAULT_VERSION` in `tools/gitlog2version.sh` to
168-
<exact incremented version> (ex: `2.8.0`), and provide the `VERSION_FORCED`
169-
and `VERSION_FORCED_SEMVER` files (to same effect but more explicitly and
174+
<exact incremented version> (ex: `2.8.0`)
175+
*** DOUBLE-CHECK that the `NUT_DEFAULT_VERSION` in `tools/gitlog2version.sh`
176+
is an `X.Y.Z` triplet, without the fourth `.1` suffix, for the release!
177+
*** Note that since NUT v2.8.3 this script dictates the version propagated by
178+
the `configure` script, so direct changes of `AC_INIT` there are no longer
179+
needed
180+
** commit with a relevant release message, e.g.:
181+
+
182+
----
183+
:; git commit -sm 'Update versions for release of NUT v2.8.0'
184+
----
185+
** provide the `VERSION_FORCED` and `VERSION_FORCED_SEMVER` files (to same
186+
effect as fallback in `tools/gitlog2version.sh` but more explicitly and
170187
visibly) in the local workspace to be added to the `dist` archive tarball
171188
file (DO NOT add them to git to avoid confusion later, or revert any such
172189
addition after the release -- still has a chance to confuse e.g. branches
@@ -214,19 +231,6 @@ VERSION_FORCED_SEMVER:NUT_VERSION_FORCED_SEMVER='2.8.3'
214231
# if file names in your top_srcdir are removed:
215232
:; ln .relver/* .
216233
----
217-
*** DOUBLE-CHECK that the `NUT_DEFAULT_VERSION` in `tools/gitlog2version.sh`
218-
is an `X.Y.Z` triplet, without the fourth `.1` suffix, for the release!
219-
*** Note that since NUT v2.8.3 this script dictates the version propagated by
220-
the `configure` script, so direct changes of `AC_INIT` there are no longer
221-
needed
222-
** revise `.github/workflows/PyNUTClient.yml` for fallback `TAG_NAME` naming
223-
** revise `appveyor.yml` for branch naming
224-
** revise `scripts/Windows/build-mingw-nut.sh` for fallback value of `VER_OPT`
225-
** commit with a relevant release message, e.g.:
226-
+
227-
----
228-
:; git commit -sm 'Update versions for release of NUT v2.8.0'
229-
----
230234

231235
* last-minute update against possible master-branch changes (and be sure to
232236
apply the release-version changes described above to your local copy of

docs/man/upsstats.html.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,14 @@ Insert the META header magic for refreshing the page if that variable
244244
has been set by the browser. This needs to be in the HEAD section of
245245
the page.
246246

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

251256
*@STATUSCOLOR@*::
252257
Insert red, green, or yellow color triplets depending on the severity of

scripts/Windows/build-mingw-nut.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
#
55
# script to cross compile NUT for Windows from Linux using MinGW-w64
66
# http://mingw-w64.sourceforge.net/
7+
#
8+
# This program is free software; you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation; either version 2 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License along
19+
# with this program; if not, write to the Free Software Foundation, Inc.,
20+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
721

822
#set -x
923

0 commit comments

Comments
 (0)