Merge ~sergiodj/ubuntu/+source/nut:fix-ftbfs-gcc-11 into ubuntu/+source/nut:ubuntu/devel
- Git
- lp:~sergiodj/ubuntu/+source/nut
- fix-ftbfs-gcc-11
- Merge into ubuntu/devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Sergio Durigan Junior | ||||
Approved revision: | 9104363279602e6778b134572033b9179a197d21 | ||||
Merged at revision: | 9104363279602e6778b134572033b9179a197d21 | ||||
Proposed branch: | ~sergiodj/ubuntu/+source/nut:fix-ftbfs-gcc-11 | ||||
Merge into: | ubuntu/+source/nut:ubuntu/devel | ||||
Diff against target: |
1012 lines (+990/-0) 3 files modified
debian/changelog (+8/-0) debian/patches/Remove-dynamic-exception-specifications-from-clients.patch (+981/-0) debian/patches/series (+1/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bryce Harrington (community) | Approve | ||
Utkarsh Gupta (community) | Needs Information | ||
Review via email: mp+407043@code.launchpad.net |
Commit message
Description of the change
This MP fixes the FTBFS that happens when compiling nut with GCC 11.
GCC 11 defaults to C++17, which doesn't allow dynamic exception specifications anymore. This is the reason for the build failure.
Upstream has already fixed the issue:
https:/
The patch is big and required manual adjustments, but it makes the package compile again. Bear in mind that nut is in a sad state and there are a lot of warnings when building the package.
There's a PPA with the proposed change (built using GCC 11) here:
https:/
Bryce Harrington (bryce) wrote : | # |
* Changelog:
- [√] old content and logical tag match as expected
- [√] changelog entry correct version and targeted codename
- [√] changelog entries correct
- [√] update-maintainer has been run
* Actual changes:
- [√] no upstream changes to consider
- [√] no further upstream version to consider
- [√] debian changes look safe
* Old Delta:
- [-] dropped changes are ok to be dropped
- [-] nothing else to drop
- [-] changes forwarded upstream/debian (if appropriate)
* New Delta:
- [-] no new patches added
- [√] patches match what was proposed upstream
- [√] patches correctly included in debian/
- [√] patches have correct DEP3 metadata
* Build/Test:
- [√] build is ok
- [-] verified PPA package installs/uninstalls
- [√] autopkgtest against the PPA package passes
- [-] sanity checks test fine
I'm curious why the new patch is numbered 0012 since there already is a different patch 0012 (and 0013), so seems like this should should be 0014. Fwiw, when Debian numbers their patches, I sometimes deliberately don't number the ubuntu ones; figure it distinguishes them and is less likely to get confused in future merges as the Debian patches change. However, patch naming is entirely personal preference.
Everything else LGTM. The PPA package hasn't published but it's built successfully on all arches.
I ran the testsuite but get weird errors about test dependencies:
autopkgtest [03:52:23]: @@@@@@@
nut FAIL badpkg
blame: ./nut_2.
badpkg: Test dependencies are unsatisfiable. A common reason is that your testbed is out of date with respect to the archive, and you need to use a current testbed or run apt-get update or use -U.
Sergio Durigan Junior (sergiodj) wrote : | # |
On Friday, August 13 2021, Utkarsh Gupta wrote:
> Hey,
Thanks for the review.
Bear in mind that the issues you raised are orthogonal to the FTBFS fix,
although they are of course valid.
> -> build-time tests aren't being run, why? :(
> ```
> =======
> Testsuite summary for nut 2.7.4
> =======
> # TOTAL: 0
> # PASS: 0
> # SKIP: 0
> # XFAIL: 0
> # FAIL: 0
> # XPASS: 0
> # ERROR: 0
> =======
> ```
I don't know offhand. As you can see from the logs "make check" is
being properly invoked by the dh_auto_test target, and "make" is
traversing the tree and calling "check" on the subdirs as expected, but
for some reason all of them return with "Nothing to be done for
'check'."
Looking into the "tests/" directory, we can see that there's not much
there. I did find what looks like to be valid tests inside
scripts/
to be run.
I checked that the same problem obviously happens on Debian, and I
verified that the Fedora nut package doesn't run its tests during build
time either. The next step would be to build a pristine upstream
checkout and verify what happens there, I guess.
> -> there seem to be a symbols mismatch:
> ```
> dpkg-gensymbols: warning: debian/
> --- debian/
> +++ dpkg-gensymbols
> @@ -50,16 +50,16 @@
> (c++)"nut:
> std::char_
> std::__
> std::allocator<
> (c++)"nut:
> std::char_
> std::vector<
> std::allocator<
> std::allocator<
> std::char_
> (c++)"nut:
> - (c++|optional=
> - (c++|optional=
> - (c++|optional=
> - (c++|optional=
> - (c++|optional=
> - (c++|optional=
> - (c++|optional=
> +#MISSING: 2.7.4-13ubuntu5# (c++|optional=
> +#MISSING: 2.7.4-13ubuntu5# (c++|optional=
> +#MISSING: 2.7.4-13ubuntu5# (c++|optional=
Sergio Durigan Junior (sergiodj) wrote : | # |
On Friday, August 13 2021, Bryce Harrington wrote:
> Review: Approve
Thanks for the review.
> I'm curious why the new patch is numbered 0012 since there already is
> a different patch 0012 (and 0013), so seems like this should should be
> 0014. Fwiw, when Debian numbers their patches, I sometimes
> deliberately don't number the ubuntu ones; figure it distinguishes
> them and is less likely to get confused in future merges as the Debian
> patches change. However, patch naming is entirely personal
> preference.
Hm. I use "gbp pq" to manage patches (even with Ubuntu packages, which
don't use gbp), and I think that was a problem with how gbp calculated
this patch's number. That's a good point and I will manually rename it.
> I ran the testsuite but get weird errors about test dependencies:
> autopkgtest [03:52:23]: @@@@@@@
> nut FAIL badpkg
> blame: ./nut_2.
> badpkg: Test dependencies are unsatisfiable. A common reason is that
> your testbed is out of date with respect to the archive, and you need
> to use a current testbed or run apt-get update or use -U.
Yeah, that was happening with me when I was running the tests using
schroot/lxd as the backend. When I switched to qemu (and enabled the
proposed pocket), the tests succeeded:
autopkgtest [16:12:52]: @@@@@@@
nut PASS
Anyway, thanks again. I will rename the patch, force-push the branch
and upload the package.
--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14
Sergio Durigan Junior (sergiodj) wrote : | # |
On Friday, August 13 2021, Sergio Durigan Junior wrote:
> On Friday, August 13 2021, Utkarsh Gupta wrote:
>
>> -> build-time tests aren't being run, why? :(
>> ```
>> =======
>> Testsuite summary for nut 2.7.4
>> =======
>> # TOTAL: 0
>> # PASS: 0
>> # SKIP: 0
>> # XFAIL: 0
>> # FAIL: 0
>> # XPASS: 0
>> # ERROR: 0
>> =======
>> ```
>
> I don't know offhand. As you can see from the logs "make check" is
> being properly invoked by the dh_auto_test target, and "make" is
> traversing the tree and calling "check" on the subdirs as expected, but
> for some reason all of them return with "Nothing to be done for
> 'check'."
>
> Looking into the "tests/" directory, we can see that there's not much
> there. I did find what looks like to be valid tests inside
> scripts/
> to be run.
>
> I checked that the same problem obviously happens on Debian, and I
> verified that the Fedora nut package doesn't run its tests during build
> time either. The next step would be to build a pristine upstream
> checkout and verify what happens there, I guess.
A few more interesting bits regarding this topic:
While looking at the dep8 tests from nut, I noticed that they were added
by the following commit (from Debian):
commit f313323738fd5bf
Author: Laurent Bigonville <email address hidden>
AuthorDate: Tue Jun 18 21:52:31 2013 +0200
Commit: Laurent Bigonville <email address hidden>
CommitDate: Tue Jun 18 21:52:31 2013 +0200
Added dep-8-tests to improve QA (from Ubuntu, closes: #708130)
If we take a look at the actual tests inside d/t/, we can see that
there's a custom "d/t/test-nut.py", which came from Ubuntu. The file
looks a lot like what we have in the ~qa-regression-
and I bet that's where it came from.
This all contributes to the theory that upstream doesn't have a very
comprehensive testsuite and for that reason we had to come up with our
own test script that were later incorporated into the official package.
Cheers,
--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14
Sergio Durigan Junior (sergiodj) wrote : | # |
Uploaded:
$ git push pkg upload/
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 8 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 6.70 KiB | 1.34 MiB/s, done.
Total 11 (delta 7), reused 0 (delta 0)
remote: Checking connectivity: 11, done.
To ssh://git.
* [new tag] upload/
$ dput nut_2.7.
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/
Checking signature on .dsc
gpg: /home/sergio/
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading nut_2.7.
Uploading nut_2.7.
Uploading nut_2.7.
Uploading nut_2.7.
Successfully uploaded packages.
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog | |||
2 | index a79c717..ac54bcd 100644 | |||
3 | --- a/debian/changelog | |||
4 | +++ b/debian/changelog | |||
5 | @@ -1,3 +1,11 @@ | |||
6 | 1 | nut (2.7.4-13ubuntu5) impish; urgency=medium | ||
7 | 2 | |||
8 | 3 | * d/p/Remove-dynamic-exception-specifications-from-clients.patch: | ||
9 | 4 | Fix FTBFS with GCC 11 due to C++17 not allowing dynamic exception | ||
10 | 5 | specifications anymore. (LP: #1939744) | ||
11 | 6 | |||
12 | 7 | -- Sergio Durigan Junior <sergio.durigan@canonical.com> Thu, 12 Aug 2021 15:51:12 -0400 | ||
13 | 8 | |||
14 | 1 | nut (2.7.4-13ubuntu4) hirsute; urgency=medium | 9 | nut (2.7.4-13ubuntu4) hirsute; urgency=medium |
15 | 2 | 10 | ||
16 | 3 | * Mark symbols as optional not seen when building with lto. | 11 | * Mark symbols as optional not seen when building with lto. |
17 | diff --git a/debian/patches/Remove-dynamic-exception-specifications-from-clients.patch b/debian/patches/Remove-dynamic-exception-specifications-from-clients.patch | |||
18 | 4 | new file mode 100644 | 12 | new file mode 100644 |
19 | index 0000000..d0ce293 | |||
20 | --- /dev/null | |||
21 | +++ b/debian/patches/Remove-dynamic-exception-specifications-from-clients.patch | |||
22 | @@ -0,0 +1,981 @@ | |||
23 | 1 | From: Peter Klein <kleinpa00@gmail.com> | ||
24 | 2 | Date: Thu, 11 Jun 2020 02:32:13 +0000 | ||
25 | 3 | Subject: Remove dynamic exception specifications from clients/nutclient.cpp | ||
26 | 4 | |||
27 | 5 | These are invalid in c++17 and must be removed for compatibility with | ||
28 | 6 | modern compilers. | ||
29 | 7 | |||
30 | 8 | Origin: backport, https://github.com/networkupstools/nut/commit/fab323320d5b955ed034b2eea390a9bbb549e8e5 | ||
31 | 9 | Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1939744 | ||
32 | 10 | Reviewed-By: Sergio Durigan Junior <sergiodj@ubuntu.com> | ||
33 | 11 | --- | ||
34 | 12 | clients/nutclient.cpp | 128 ++++++++++++++++++------------------- | ||
35 | 13 | clients/nutclient.h | 170 +++++++++++++++++++++++++------------------------- | ||
36 | 14 | 2 files changed, 146 insertions(+), 152 deletions(-) | ||
37 | 15 | |||
38 | 16 | diff --git a/clients/nutclient.cpp b/clients/nutclient.cpp | ||
39 | 17 | index 8304473..a6004ab 100644 | ||
40 | 18 | --- a/clients/nutclient.cpp | ||
41 | 19 | +++ b/clients/nutclient.cpp | ||
42 | 20 | @@ -96,18 +96,18 @@ class Socket | ||
43 | 21 | public: | ||
44 | 22 | Socket(); | ||
45 | 23 | |||
46 | 24 | - void connect(const std::string& host, int port)throw(nut::IOException); | ||
47 | 25 | + void connect(const std::string& host, int port); | ||
48 | 26 | void disconnect(); | ||
49 | 27 | bool isConnected()const; | ||
50 | 28 | |||
51 | 29 | void setTimeout(long timeout); | ||
52 | 30 | bool hasTimeout()const{return _tv.tv_sec>=0;} | ||
53 | 31 | |||
54 | 32 | - size_t read(void* buf, size_t sz)throw(nut::IOException); | ||
55 | 33 | - size_t write(const void* buf, size_t sz)throw(nut::IOException); | ||
56 | 34 | + size_t read(void* buf, size_t sz); | ||
57 | 35 | + size_t write(const void* buf, size_t sz); | ||
58 | 36 | |||
59 | 37 | - std::string read()throw(nut::IOException); | ||
60 | 38 | - void write(const std::string& str)throw(nut::IOException); | ||
61 | 39 | + std::string read(); | ||
62 | 40 | + void write(const std::string& str); | ||
63 | 41 | |||
64 | 42 | |||
65 | 43 | private: | ||
66 | 44 | @@ -129,7 +129,7 @@ void Socket::setTimeout(long timeout) | ||
67 | 45 | _tv.tv_sec = timeout; | ||
68 | 46 | } | ||
69 | 47 | |||
70 | 48 | -void Socket::connect(const std::string& host, int port)throw(nut::IOException) | ||
71 | 49 | +void Socket::connect(const std::string& host, int port) | ||
72 | 50 | { | ||
73 | 51 | int sock_fd; | ||
74 | 52 | struct addrinfo hints, *res, *ai; | ||
75 | 53 | @@ -298,7 +298,7 @@ bool Socket::isConnected()const | ||
76 | 54 | return _sock!=INVALID_SOCKET; | ||
77 | 55 | } | ||
78 | 56 | |||
79 | 57 | -size_t Socket::read(void* buf, size_t sz)throw(nut::IOException) | ||
80 | 58 | +size_t Socket::read(void* buf, size_t sz) | ||
81 | 59 | { | ||
82 | 60 | if(!isConnected()) | ||
83 | 61 | { | ||
84 | 62 | @@ -325,7 +325,7 @@ size_t Socket::read(void* buf, size_t sz)throw(nut::IOException) | ||
85 | 63 | return (size_t) res; | ||
86 | 64 | } | ||
87 | 65 | |||
88 | 66 | -size_t Socket::write(const void* buf, size_t sz)throw(nut::IOException) | ||
89 | 67 | +size_t Socket::write(const void* buf, size_t sz) | ||
90 | 68 | { | ||
91 | 69 | if(!isConnected()) | ||
92 | 70 | { | ||
93 | 71 | @@ -352,7 +352,7 @@ size_t Socket::write(const void* buf, size_t sz)throw(nut::IOException) | ||
94 | 72 | return (size_t) res; | ||
95 | 73 | } | ||
96 | 74 | |||
97 | 75 | -std::string Socket::read()throw(nut::IOException) | ||
98 | 76 | +std::string Socket::read() | ||
99 | 77 | { | ||
100 | 78 | std::string res; | ||
101 | 79 | char buff[256]; | ||
102 | 80 | @@ -383,7 +383,7 @@ std::string Socket::read()throw(nut::IOException) | ||
103 | 81 | } | ||
104 | 82 | } | ||
105 | 83 | |||
106 | 84 | -void Socket::write(const std::string& str)throw(nut::IOException) | ||
107 | 85 | +void Socket::write(const std::string& str) | ||
108 | 86 | { | ||
109 | 87 | // write(str.c_str(), str.size()); | ||
110 | 88 | // write("\n", 1); | ||
111 | 89 | @@ -408,13 +408,13 @@ Client::~Client() | ||
112 | 90 | { | ||
113 | 91 | } | ||
114 | 92 | |||
115 | 93 | -bool Client::hasDevice(const std::string& dev)throw(NutException) | ||
116 | 94 | +bool Client::hasDevice(const std::string& dev) | ||
117 | 95 | { | ||
118 | 96 | std::set<std::string> devs = getDeviceNames(); | ||
119 | 97 | return devs.find(dev) != devs.end(); | ||
120 | 98 | } | ||
121 | 99 | |||
122 | 100 | -Device Client::getDevice(const std::string& name)throw(NutException) | ||
123 | 101 | +Device Client::getDevice(const std::string& name) | ||
124 | 102 | { | ||
125 | 103 | if(hasDevice(name)) | ||
126 | 104 | return Device(this, name); | ||
127 | 105 | @@ -422,7 +422,7 @@ Device Client::getDevice(const std::string& name)throw(NutException) | ||
128 | 106 | return Device(NULL, ""); | ||
129 | 107 | } | ||
130 | 108 | |||
131 | 109 | -std::set<Device> Client::getDevices()throw(NutException) | ||
132 | 110 | +std::set<Device> Client::getDevices() | ||
133 | 111 | { | ||
134 | 112 | std::set<Device> res; | ||
135 | 113 | |||
136 | 114 | @@ -435,13 +435,13 @@ std::set<Device> Client::getDevices()throw(NutException) | ||
137 | 115 | return res; | ||
138 | 116 | } | ||
139 | 117 | |||
140 | 118 | -bool Client::hasDeviceVariable(const std::string& dev, const std::string& name)throw(NutException) | ||
141 | 119 | +bool Client::hasDeviceVariable(const std::string& dev, const std::string& name) | ||
142 | 120 | { | ||
143 | 121 | std::set<std::string> names = getDeviceVariableNames(dev); | ||
144 | 122 | return names.find(name) != names.end(); | ||
145 | 123 | } | ||
146 | 124 | |||
147 | 125 | -std::map<std::string,std::vector<std::string> > Client::getDeviceVariableValues(const std::string& dev)throw(NutException) | ||
148 | 126 | +std::map<std::string,std::vector<std::string> > Client::getDeviceVariableValues(const std::string& dev) | ||
149 | 127 | { | ||
150 | 128 | std::map<std::string,std::vector<std::string> > res; | ||
151 | 129 | |||
152 | 130 | @@ -455,7 +455,7 @@ std::map<std::string,std::vector<std::string> > Client::getDeviceVariableValues( | ||
153 | 131 | return res; | ||
154 | 132 | } | ||
155 | 133 | |||
156 | 134 | -bool Client::hasDeviceCommand(const std::string& dev, const std::string& name)throw(NutException) | ||
157 | 135 | +bool Client::hasDeviceCommand(const std::string& dev, const std::string& name) | ||
158 | 136 | { | ||
159 | 137 | std::set<std::string> names = getDeviceCommandNames(dev); | ||
160 | 138 | return names.find(name) != names.end(); | ||
161 | 139 | @@ -477,7 +477,7 @@ _socket(new internal::Socket) | ||
162 | 140 | // Do not connect now | ||
163 | 141 | } | ||
164 | 142 | |||
165 | 143 | -TcpClient::TcpClient(const std::string& host, int port)throw(IOException): | ||
166 | 144 | +TcpClient::TcpClient(const std::string& host, int port): | ||
167 | 145 | Client(), | ||
168 | 146 | _socket(new internal::Socket) | ||
169 | 147 | { | ||
170 | 148 | @@ -489,14 +489,14 @@ TcpClient::~TcpClient() | ||
171 | 149 | delete _socket; | ||
172 | 150 | } | ||
173 | 151 | |||
174 | 152 | -void TcpClient::connect(const std::string& host, int port)throw(IOException) | ||
175 | 153 | +void TcpClient::connect(const std::string& host, int port) | ||
176 | 154 | { | ||
177 | 155 | _host = host; | ||
178 | 156 | _port = port; | ||
179 | 157 | connect(); | ||
180 | 158 | } | ||
181 | 159 | |||
182 | 160 | -void TcpClient::connect()throw(nut::IOException) | ||
183 | 161 | +void TcpClient::connect() | ||
184 | 162 | { | ||
185 | 163 | _socket->connect(_host, _port); | ||
186 | 164 | } | ||
187 | 165 | @@ -532,19 +532,18 @@ long TcpClient::getTimeout()const | ||
188 | 166 | } | ||
189 | 167 | |||
190 | 168 | void TcpClient::authenticate(const std::string& user, const std::string& passwd) | ||
191 | 169 | - throw(NutException) | ||
192 | 170 | { | ||
193 | 171 | detectError(sendQuery("USERNAME " + user)); | ||
194 | 172 | detectError(sendQuery("PASSWORD " + passwd)); | ||
195 | 173 | } | ||
196 | 174 | |||
197 | 175 | -void TcpClient::logout()throw(NutException) | ||
198 | 176 | +void TcpClient::logout() | ||
199 | 177 | { | ||
200 | 178 | detectError(sendQuery("LOGOUT")); | ||
201 | 179 | _socket->disconnect(); | ||
202 | 180 | } | ||
203 | 181 | |||
204 | 182 | -Device TcpClient::getDevice(const std::string& name)throw(NutException) | ||
205 | 183 | +Device TcpClient::getDevice(const std::string& name) | ||
206 | 184 | { | ||
207 | 185 | try | ||
208 | 186 | { | ||
209 | 187 | @@ -560,7 +559,7 @@ Device TcpClient::getDevice(const std::string& name)throw(NutException) | ||
210 | 188 | return Device(this, name); | ||
211 | 189 | } | ||
212 | 190 | |||
213 | 191 | -std::set<std::string> TcpClient::getDeviceNames()throw(NutException) | ||
214 | 192 | +std::set<std::string> TcpClient::getDeviceNames() | ||
215 | 193 | { | ||
216 | 194 | std::set<std::string> res; | ||
217 | 195 | |||
218 | 196 | @@ -576,12 +575,12 @@ std::set<std::string> TcpClient::getDeviceNames()throw(NutException) | ||
219 | 197 | return res; | ||
220 | 198 | } | ||
221 | 199 | |||
222 | 200 | -std::string TcpClient::getDeviceDescription(const std::string& name)throw(NutException) | ||
223 | 201 | +std::string TcpClient::getDeviceDescription(const std::string& name) | ||
224 | 202 | { | ||
225 | 203 | return get("UPSDESC", name)[0]; | ||
226 | 204 | } | ||
227 | 205 | |||
228 | 206 | -std::set<std::string> TcpClient::getDeviceVariableNames(const std::string& dev)throw(NutException) | ||
229 | 207 | +std::set<std::string> TcpClient::getDeviceVariableNames(const std::string& dev) | ||
230 | 208 | { | ||
231 | 209 | std::set<std::string> set; | ||
232 | 210 | |||
233 | 211 | @@ -594,7 +593,7 @@ std::set<std::string> TcpClient::getDeviceVariableNames(const std::string& dev)t | ||
234 | 212 | return set; | ||
235 | 213 | } | ||
236 | 214 | |||
237 | 215 | -std::set<std::string> TcpClient::getDeviceRWVariableNames(const std::string& dev)throw(NutException) | ||
238 | 216 | +std::set<std::string> TcpClient::getDeviceRWVariableNames(const std::string& dev) | ||
239 | 217 | { | ||
240 | 218 | std::set<std::string> set; | ||
241 | 219 | |||
242 | 220 | @@ -607,17 +606,17 @@ std::set<std::string> TcpClient::getDeviceRWVariableNames(const std::string& dev | ||
243 | 221 | return set; | ||
244 | 222 | } | ||
245 | 223 | |||
246 | 224 | -std::string TcpClient::getDeviceVariableDescription(const std::string& dev, const std::string& name)throw(NutException) | ||
247 | 225 | +std::string TcpClient::getDeviceVariableDescription(const std::string& dev, const std::string& name) | ||
248 | 226 | { | ||
249 | 227 | return get("DESC", dev + " " + name)[0]; | ||
250 | 228 | } | ||
251 | 229 | |||
252 | 230 | -std::vector<std::string> TcpClient::getDeviceVariableValue(const std::string& dev, const std::string& name)throw(NutException) | ||
253 | 231 | +std::vector<std::string> TcpClient::getDeviceVariableValue(const std::string& dev, const std::string& name) | ||
254 | 232 | { | ||
255 | 233 | return get("VAR", dev + " " + name); | ||
256 | 234 | } | ||
257 | 235 | |||
258 | 236 | -std::map<std::string,std::vector<std::string> > TcpClient::getDeviceVariableValues(const std::string& dev)throw(NutException) | ||
259 | 237 | +std::map<std::string,std::vector<std::string> > TcpClient::getDeviceVariableValues(const std::string& dev) | ||
260 | 238 | { | ||
261 | 239 | |||
262 | 240 | std::map<std::string,std::vector<std::string> > map; | ||
263 | 241 | @@ -634,13 +633,13 @@ std::map<std::string,std::vector<std::string> > TcpClient::getDeviceVariableValu | ||
264 | 242 | return map; | ||
265 | 243 | } | ||
266 | 244 | |||
267 | 245 | -void TcpClient::setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value)throw(NutException) | ||
268 | 246 | +void TcpClient::setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value) | ||
269 | 247 | { | ||
270 | 248 | std::string query = "SET VAR " + dev + " " + name + " " + escape(value); | ||
271 | 249 | detectError(sendQuery(query)); | ||
272 | 250 | } | ||
273 | 251 | |||
274 | 252 | -void TcpClient::setDeviceVariable(const std::string& dev, const std::string& name, const std::vector<std::string>& values)throw(NutException) | ||
275 | 253 | +void TcpClient::setDeviceVariable(const std::string& dev, const std::string& name, const std::vector<std::string>& values) | ||
276 | 254 | { | ||
277 | 255 | std::string query = "SET VAR " + dev + " " + name; | ||
278 | 256 | for(size_t n=0; n<values.size(); ++n) | ||
279 | 257 | @@ -650,7 +649,7 @@ void TcpClient::setDeviceVariable(const std::string& dev, const std::string& nam | ||
280 | 258 | detectError(sendQuery(query)); | ||
281 | 259 | } | ||
282 | 260 | |||
283 | 261 | -std::set<std::string> TcpClient::getDeviceCommandNames(const std::string& dev)throw(NutException) | ||
284 | 262 | +std::set<std::string> TcpClient::getDeviceCommandNames(const std::string& dev) | ||
285 | 263 | { | ||
286 | 264 | std::set<std::string> cmds; | ||
287 | 265 | |||
288 | 266 | @@ -663,32 +662,32 @@ std::set<std::string> TcpClient::getDeviceCommandNames(const std::string& dev)th | ||
289 | 267 | return cmds; | ||
290 | 268 | } | ||
291 | 269 | |||
292 | 270 | -std::string TcpClient::getDeviceCommandDescription(const std::string& dev, const std::string& name)throw(NutException) | ||
293 | 271 | +std::string TcpClient::getDeviceCommandDescription(const std::string& dev, const std::string& name) | ||
294 | 272 | { | ||
295 | 273 | return get("CMDDESC", dev + " " + name)[0]; | ||
296 | 274 | } | ||
297 | 275 | |||
298 | 276 | -void TcpClient::executeDeviceCommand(const std::string& dev, const std::string& name)throw(NutException) | ||
299 | 277 | +void TcpClient::executeDeviceCommand(const std::string& dev, const std::string& name) | ||
300 | 278 | { | ||
301 | 279 | detectError(sendQuery("INSTCMD " + dev + " " + name)); | ||
302 | 280 | } | ||
303 | 281 | |||
304 | 282 | -void TcpClient::deviceLogin(const std::string& dev)throw(NutException) | ||
305 | 283 | +void TcpClient::deviceLogin(const std::string& dev) | ||
306 | 284 | { | ||
307 | 285 | detectError(sendQuery("LOGIN " + dev)); | ||
308 | 286 | } | ||
309 | 287 | |||
310 | 288 | -void TcpClient::deviceMaster(const std::string& dev)throw(NutException) | ||
311 | 289 | +void TcpClient::deviceMaster(const std::string& dev) | ||
312 | 290 | { | ||
313 | 291 | detectError(sendQuery("MASTER " + dev)); | ||
314 | 292 | } | ||
315 | 293 | |||
316 | 294 | -void TcpClient::deviceForcedShutdown(const std::string& dev)throw(NutException) | ||
317 | 295 | +void TcpClient::deviceForcedShutdown(const std::string& dev) | ||
318 | 296 | { | ||
319 | 297 | detectError(sendQuery("FSD " + dev)); | ||
320 | 298 | } | ||
321 | 299 | |||
322 | 300 | -int TcpClient::deviceGetNumLogins(const std::string& dev)throw(NutException) | ||
323 | 301 | +int TcpClient::deviceGetNumLogins(const std::string& dev) | ||
324 | 302 | { | ||
325 | 303 | std::string num = get("NUMLOGINS", dev)[0]; | ||
326 | 304 | return atoi(num.c_str()); | ||
327 | 305 | @@ -696,7 +695,7 @@ int TcpClient::deviceGetNumLogins(const std::string& dev)throw(NutException) | ||
328 | 306 | |||
329 | 307 | |||
330 | 308 | std::vector<std::string> TcpClient::get | ||
331 | 309 | - (const std::string& subcmd, const std::string& params) throw(NutException) | ||
332 | 310 | + (const std::string& subcmd, const std::string& params) | ||
333 | 311 | { | ||
334 | 312 | std::string req = subcmd; | ||
335 | 313 | if(!params.empty()) | ||
336 | 314 | @@ -714,7 +713,7 @@ std::vector<std::string> TcpClient::get | ||
337 | 315 | } | ||
338 | 316 | |||
339 | 317 | std::vector<std::vector<std::string> > TcpClient::list | ||
340 | 318 | - (const std::string& subcmd, const std::string& params) throw(NutException) | ||
341 | 319 | + (const std::string& subcmd, const std::string& params) | ||
342 | 320 | { | ||
343 | 321 | std::string req = subcmd; | ||
344 | 322 | if(!params.empty()) | ||
345 | 323 | @@ -748,13 +747,13 @@ std::vector<std::vector<std::string> > TcpClient::list | ||
346 | 324 | } | ||
347 | 325 | } | ||
348 | 326 | |||
349 | 327 | -std::string TcpClient::sendQuery(const std::string& req)throw(IOException) | ||
350 | 328 | +std::string TcpClient::sendQuery(const std::string& req) | ||
351 | 329 | { | ||
352 | 330 | _socket->write(req); | ||
353 | 331 | return _socket->read(); | ||
354 | 332 | } | ||
355 | 333 | |||
356 | 334 | -void TcpClient::detectError(const std::string& req)throw(NutException) | ||
357 | 335 | +void TcpClient::detectError(const std::string& req) | ||
358 | 336 | { | ||
359 | 337 | if(req.substr(0,3)=="ERR") | ||
360 | 338 | { | ||
361 | 339 | @@ -954,47 +953,44 @@ bool Device::operator<(const Device& dev)const | ||
362 | 340 | return getName()<dev.getName(); | ||
363 | 341 | } | ||
364 | 342 | |||
365 | 343 | -std::string Device::getDescription()throw(NutException) | ||
366 | 344 | +std::string Device::getDescription() | ||
367 | 345 | { | ||
368 | 346 | return getClient()->getDeviceDescription(getName()); | ||
369 | 347 | } | ||
370 | 348 | |||
371 | 349 | std::vector<std::string> Device::getVariableValue(const std::string& name) | ||
372 | 350 | - throw(NutException) | ||
373 | 351 | { | ||
374 | 352 | return getClient()->getDeviceVariableValue(getName(), name); | ||
375 | 353 | } | ||
376 | 354 | |||
377 | 355 | std::map<std::string,std::vector<std::string> > Device::getVariableValues() | ||
378 | 356 | - throw(NutException) | ||
379 | 357 | { | ||
380 | 358 | return getClient()->getDeviceVariableValues(getName()); | ||
381 | 359 | } | ||
382 | 360 | |||
383 | 361 | -std::set<std::string> Device::getVariableNames()throw(NutException) | ||
384 | 362 | +std::set<std::string> Device::getVariableNames() | ||
385 | 363 | { | ||
386 | 364 | return getClient()->getDeviceVariableNames(getName()); | ||
387 | 365 | } | ||
388 | 366 | |||
389 | 367 | -std::set<std::string> Device::getRWVariableNames()throw(NutException) | ||
390 | 368 | +std::set<std::string> Device::getRWVariableNames() | ||
391 | 369 | { | ||
392 | 370 | return getClient()->getDeviceRWVariableNames(getName()); | ||
393 | 371 | } | ||
394 | 372 | |||
395 | 373 | -void Device::setVariable(const std::string& name, const std::string& value)throw(NutException) | ||
396 | 374 | +void Device::setVariable(const std::string& name, const std::string& value) | ||
397 | 375 | { | ||
398 | 376 | getClient()->setDeviceVariable(getName(), name, value); | ||
399 | 377 | } | ||
400 | 378 | |||
401 | 379 | void Device::setVariable(const std::string& name, const std::vector<std::string>& values) | ||
402 | 380 | - throw(NutException) | ||
403 | 381 | { | ||
404 | 382 | getClient()->setDeviceVariable(getName(), name, values); | ||
405 | 383 | } | ||
406 | 384 | |||
407 | 385 | |||
408 | 386 | |||
409 | 387 | -Variable Device::getVariable(const std::string& name)throw(NutException) | ||
410 | 388 | +Variable Device::getVariable(const std::string& name) | ||
411 | 389 | { | ||
412 | 390 | if(getClient()->hasDeviceVariable(getName(), name)) | ||
413 | 391 | return Variable(this, name); | ||
414 | 392 | @@ -1002,7 +998,7 @@ Variable Device::getVariable(const std::string& name)throw(NutException) | ||
415 | 393 | return Variable(NULL, ""); | ||
416 | 394 | } | ||
417 | 395 | |||
418 | 396 | -std::set<Variable> Device::getVariables()throw(NutException) | ||
419 | 397 | +std::set<Variable> Device::getVariables() | ||
420 | 398 | { | ||
421 | 399 | std::set<Variable> set; | ||
422 | 400 | |||
423 | 401 | @@ -1015,7 +1011,7 @@ std::set<Variable> Device::getVariables()throw(NutException) | ||
424 | 402 | return set; | ||
425 | 403 | } | ||
426 | 404 | |||
427 | 405 | -std::set<Variable> Device::getRWVariables()throw(NutException) | ||
428 | 406 | +std::set<Variable> Device::getRWVariables() | ||
429 | 407 | { | ||
430 | 408 | std::set<Variable> set; | ||
431 | 409 | |||
432 | 410 | @@ -1028,12 +1024,12 @@ std::set<Variable> Device::getRWVariables()throw(NutException) | ||
433 | 411 | return set; | ||
434 | 412 | } | ||
435 | 413 | |||
436 | 414 | -std::set<std::string> Device::getCommandNames()throw(NutException) | ||
437 | 415 | +std::set<std::string> Device::getCommandNames() | ||
438 | 416 | { | ||
439 | 417 | return getClient()->getDeviceCommandNames(getName()); | ||
440 | 418 | } | ||
441 | 419 | |||
442 | 420 | -std::set<Command> Device::getCommands()throw(NutException) | ||
443 | 421 | +std::set<Command> Device::getCommands() | ||
444 | 422 | { | ||
445 | 423 | std::set<Command> cmds; | ||
446 | 424 | |||
447 | 425 | @@ -1046,7 +1042,7 @@ std::set<Command> Device::getCommands()throw(NutException) | ||
448 | 426 | return cmds; | ||
449 | 427 | } | ||
450 | 428 | |||
451 | 429 | -Command Device::getCommand(const std::string& name)throw(NutException) | ||
452 | 430 | +Command Device::getCommand(const std::string& name) | ||
453 | 431 | { | ||
454 | 432 | if(getClient()->hasDeviceCommand(getName(), name)) | ||
455 | 433 | return Command(this, name); | ||
456 | 434 | @@ -1054,26 +1050,26 @@ Command Device::getCommand(const std::string& name)throw(NutException) | ||
457 | 435 | return Command(NULL, ""); | ||
458 | 436 | } | ||
459 | 437 | |||
460 | 438 | -void Device::executeCommand(const std::string& name)throw(NutException) | ||
461 | 439 | +void Device::executeCommand(const std::string& name) | ||
462 | 440 | { | ||
463 | 441 | getClient()->executeDeviceCommand(getName(), name); | ||
464 | 442 | } | ||
465 | 443 | |||
466 | 444 | -void Device::login()throw(NutException) | ||
467 | 445 | +void Device::login() | ||
468 | 446 | { | ||
469 | 447 | getClient()->deviceLogin(getName()); | ||
470 | 448 | } | ||
471 | 449 | |||
472 | 450 | -void Device::master()throw(NutException) | ||
473 | 451 | +void Device::master() | ||
474 | 452 | { | ||
475 | 453 | getClient()->deviceMaster(getName()); | ||
476 | 454 | } | ||
477 | 455 | |||
478 | 456 | -void Device::forcedShutdown()throw(NutException) | ||
479 | 457 | +void Device::forcedShutdown() | ||
480 | 458 | { | ||
481 | 459 | } | ||
482 | 460 | |||
483 | 461 | -int Device::getNumLogins()throw(NutException) | ||
484 | 462 | +int Device::getNumLogins() | ||
485 | 463 | { | ||
486 | 464 | return getClient()->deviceGetNumLogins(getName()); | ||
487 | 465 | } | ||
488 | 466 | @@ -1141,22 +1137,22 @@ bool Variable::operator<(const Variable& var)const | ||
489 | 467 | return getName()<var.getName(); | ||
490 | 468 | } | ||
491 | 469 | |||
492 | 470 | -std::vector<std::string> Variable::getValue()throw(NutException) | ||
493 | 471 | +std::vector<std::string> Variable::getValue() | ||
494 | 472 | { | ||
495 | 473 | return getDevice()->getClient()->getDeviceVariableValue(getDevice()->getName(), getName()); | ||
496 | 474 | } | ||
497 | 475 | |||
498 | 476 | -std::string Variable::getDescription()throw(NutException) | ||
499 | 477 | +std::string Variable::getDescription() | ||
500 | 478 | { | ||
501 | 479 | return getDevice()->getClient()->getDeviceVariableDescription(getDevice()->getName(), getName()); | ||
502 | 480 | } | ||
503 | 481 | |||
504 | 482 | -void Variable::setValue(const std::string& value)throw(NutException) | ||
505 | 483 | +void Variable::setValue(const std::string& value) | ||
506 | 484 | { | ||
507 | 485 | getDevice()->setVariable(getName(), value); | ||
508 | 486 | } | ||
509 | 487 | |||
510 | 488 | -void Variable::setValues(const std::vector<std::string>& values)throw(NutException) | ||
511 | 489 | +void Variable::setValues(const std::vector<std::string>& values) | ||
512 | 490 | { | ||
513 | 491 | getDevice()->setVariable(getName(), values); | ||
514 | 492 | } | ||
515 | 493 | @@ -1225,12 +1221,12 @@ bool Command::operator<(const Command& cmd)const | ||
516 | 494 | return getName()<cmd.getName(); | ||
517 | 495 | } | ||
518 | 496 | |||
519 | 497 | -std::string Command::getDescription()throw(NutException) | ||
520 | 498 | +std::string Command::getDescription() | ||
521 | 499 | { | ||
522 | 500 | return getDevice()->getClient()->getDeviceCommandDescription(getDevice()->getName(), getName()); | ||
523 | 501 | } | ||
524 | 502 | |||
525 | 503 | -void Command::execute()throw(NutException) | ||
526 | 504 | +void Command::execute() | ||
527 | 505 | { | ||
528 | 506 | getDevice()->executeCommand(getName()); | ||
529 | 507 | } | ||
530 | 508 | diff --git a/clients/nutclient.h b/clients/nutclient.h | ||
531 | 509 | index ed2ea44..3d4cbcb 100644 | ||
532 | 510 | --- a/clients/nutclient.h | ||
533 | 511 | +++ b/clients/nutclient.h | ||
534 | 512 | @@ -51,9 +51,9 @@ class NutException : public std::exception | ||
535 | 513 | { | ||
536 | 514 | public: | ||
537 | 515 | NutException(const std::string& msg):_msg(msg){} | ||
538 | 516 | - virtual ~NutException() throw() {} | ||
539 | 517 | - virtual const char * what() const throw() {return this->_msg.c_str();} | ||
540 | 518 | - virtual std::string str() const throw() {return this->_msg;} | ||
541 | 519 | + virtual ~NutException() {} | ||
542 | 520 | + virtual const char * what() const noexcept {return this->_msg.c_str();} | ||
543 | 521 | + virtual std::string str() const noexcept {return this->_msg;} | ||
544 | 522 | private: | ||
545 | 523 | std::string _msg; | ||
546 | 524 | }; | ||
547 | 525 | @@ -65,7 +65,7 @@ class SystemException : public NutException | ||
548 | 526 | { | ||
549 | 527 | public: | ||
550 | 528 | SystemException(); | ||
551 | 529 | - virtual ~SystemException() throw() {} | ||
552 | 530 | + virtual ~SystemException() {} | ||
553 | 531 | private: | ||
554 | 532 | static std::string err(); | ||
555 | 533 | }; | ||
556 | 534 | @@ -78,7 +78,7 @@ class IOException : public NutException | ||
557 | 535 | { | ||
558 | 536 | public: | ||
559 | 537 | IOException(const std::string& msg):NutException(msg){} | ||
560 | 538 | - virtual ~IOException() throw() {} | ||
561 | 539 | + virtual ~IOException() {} | ||
562 | 540 | }; | ||
563 | 541 | |||
564 | 542 | /** | ||
565 | 543 | @@ -88,7 +88,7 @@ class UnknownHostException : public IOException | ||
566 | 544 | { | ||
567 | 545 | public: | ||
568 | 546 | UnknownHostException():IOException("Unknown host"){} | ||
569 | 547 | - virtual ~UnknownHostException() throw() {} | ||
570 | 548 | + virtual ~UnknownHostException() {} | ||
571 | 549 | }; | ||
572 | 550 | |||
573 | 551 | /** | ||
574 | 552 | @@ -98,7 +98,7 @@ class NotConnectedException : public IOException | ||
575 | 553 | { | ||
576 | 554 | public: | ||
577 | 555 | NotConnectedException():IOException("Not connected"){} | ||
578 | 556 | - virtual ~NotConnectedException() throw() {} | ||
579 | 557 | + virtual ~NotConnectedException() {} | ||
580 | 558 | }; | ||
581 | 559 | |||
582 | 560 | /** | ||
583 | 561 | @@ -108,7 +108,7 @@ class TimeoutException : public IOException | ||
584 | 562 | { | ||
585 | 563 | public: | ||
586 | 564 | TimeoutException():IOException("Timeout"){} | ||
587 | 565 | - virtual ~TimeoutException() throw() {} | ||
588 | 566 | + virtual ~TimeoutException() {} | ||
589 | 567 | }; | ||
590 | 568 | |||
591 | 569 | /** | ||
592 | 570 | @@ -132,13 +132,13 @@ public: | ||
593 | 571 | * \todo Is his method is global to all connection protocol or is it specific to TCP ? | ||
594 | 572 | * \note Actually, authentication fails only if already set, not if bad values are sent. | ||
595 | 573 | */ | ||
596 | 574 | - virtual void authenticate(const std::string& user, const std::string& passwd)throw(NutException)=0; | ||
597 | 575 | + virtual void authenticate(const std::string& user, const std::string& passwd)=0; | ||
598 | 576 | |||
599 | 577 | /** | ||
600 | 578 | * Disconnect from the NUTD server. | ||
601 | 579 | * \todo Is his method is global to all connection protocol or is it specific to TCP ? | ||
602 | 580 | */ | ||
603 | 581 | - virtual void logout()throw(NutException)=0; | ||
604 | 582 | + virtual void logout()=0; | ||
605 | 583 | |||
606 | 584 | /** | ||
607 | 585 | * Device manipulations. | ||
608 | 586 | @@ -151,29 +151,29 @@ public: | ||
609 | 587 | * \param name Name of the device. | ||
610 | 588 | * \return The device. | ||
611 | 589 | */ | ||
612 | 590 | - virtual Device getDevice(const std::string& name)throw(NutException); | ||
613 | 591 | + virtual Device getDevice(const std::string& name); | ||
614 | 592 | /** | ||
615 | 593 | * Retrieve the list of all devices supported by UPSD server. | ||
616 | 594 | * \return The set of supported devices. | ||
617 | 595 | */ | ||
618 | 596 | - virtual std::set<Device> getDevices()throw(NutException); | ||
619 | 597 | + virtual std::set<Device> getDevices(); | ||
620 | 598 | /** | ||
621 | 599 | * Test if a device is supported by the NUTD server. | ||
622 | 600 | * \param dev Device name. | ||
623 | 601 | * \return true if supported, false otherwise. | ||
624 | 602 | */ | ||
625 | 603 | - virtual bool hasDevice(const std::string& dev)throw(NutException); | ||
626 | 604 | + virtual bool hasDevice(const std::string& dev); | ||
627 | 605 | /** | ||
628 | 606 | * Retrieve names of devices supported by NUTD server. | ||
629 | 607 | * \return The set of names of supported devices. | ||
630 | 608 | */ | ||
631 | 609 | - virtual std::set<std::string> getDeviceNames()throw(NutException)=0; | ||
632 | 610 | + virtual std::set<std::string> getDeviceNames()=0; | ||
633 | 611 | /** | ||
634 | 612 | * Retrieve the description of a device. | ||
635 | 613 | * \param name Device name. | ||
636 | 614 | * \return Device description. | ||
637 | 615 | */ | ||
638 | 616 | - virtual std::string getDeviceDescription(const std::string& name)throw(NutException)=0; | ||
639 | 617 | + virtual std::string getDeviceDescription(const std::string& name)=0; | ||
640 | 618 | /** \} */ | ||
641 | 619 | |||
642 | 620 | /** | ||
643 | 621 | @@ -186,54 +186,54 @@ public: | ||
644 | 622 | * \param dev Device name | ||
645 | 623 | * \return Variable names | ||
646 | 624 | */ | ||
647 | 625 | - virtual std::set<std::string> getDeviceVariableNames(const std::string& dev)throw(NutException)=0; | ||
648 | 626 | + virtual std::set<std::string> getDeviceVariableNames(const std::string& dev)=0; | ||
649 | 627 | /** | ||
650 | 628 | * Retrieve names of read/write variables supported by a device. | ||
651 | 629 | * \param dev Device name | ||
652 | 630 | * \return RW variable names | ||
653 | 631 | */ | ||
654 | 632 | - virtual std::set<std::string> getDeviceRWVariableNames(const std::string& dev)throw(NutException)=0; | ||
655 | 633 | + virtual std::set<std::string> getDeviceRWVariableNames(const std::string& dev)=0; | ||
656 | 634 | /** | ||
657 | 635 | * Test if a variable is supported by a device. | ||
658 | 636 | * \param dev Device name | ||
659 | 637 | * \param name Variable name | ||
660 | 638 | * \return true if the variable is supported. | ||
661 | 639 | */ | ||
662 | 640 | - virtual bool hasDeviceVariable(const std::string& dev, const std::string& name)throw(NutException); | ||
663 | 641 | + virtual bool hasDeviceVariable(const std::string& dev, const std::string& name); | ||
664 | 642 | /** | ||
665 | 643 | * Retrieve the description of a variable. | ||
666 | 644 | * \param dev Device name | ||
667 | 645 | * \param name Variable name | ||
668 | 646 | * \return Variable description if provided. | ||
669 | 647 | */ | ||
670 | 648 | - virtual std::string getDeviceVariableDescription(const std::string& dev, const std::string& name)throw(NutException)=0; | ||
671 | 649 | + virtual std::string getDeviceVariableDescription(const std::string& dev, const std::string& name)=0; | ||
672 | 650 | /** | ||
673 | 651 | * Retrieve values of a variable. | ||
674 | 652 | * \param dev Device name | ||
675 | 653 | * \param name Variable name | ||
676 | 654 | * \return Variable values (usually one) if available. | ||
677 | 655 | */ | ||
678 | 656 | - virtual std::vector<std::string> getDeviceVariableValue(const std::string& dev, const std::string& name)throw(NutException)=0; | ||
679 | 657 | + virtual std::vector<std::string> getDeviceVariableValue(const std::string& dev, const std::string& name)=0; | ||
680 | 658 | /** | ||
681 | 659 | * Retrieve values of all variables of a device. | ||
682 | 660 | * \param dev Device name | ||
683 | 661 | * \return Variable values indexed by variable names. | ||
684 | 662 | */ | ||
685 | 663 | - virtual std::map<std::string,std::vector<std::string> > getDeviceVariableValues(const std::string& dev)throw(NutException); | ||
686 | 664 | + virtual std::map<std::string,std::vector<std::string> > getDeviceVariableValues(const std::string& dev); | ||
687 | 665 | /** | ||
688 | 666 | * Intend to set the value of a variable. | ||
689 | 667 | * \param dev Device name | ||
690 | 668 | * \param name Variable name | ||
691 | 669 | * \param value Variable value | ||
692 | 670 | */ | ||
693 | 671 | - virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value)throw(NutException)=0; | ||
694 | 672 | + virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value)=0; | ||
695 | 673 | /** | ||
696 | 674 | * Intend to set the value of a variable. | ||
697 | 675 | * \param dev Device name | ||
698 | 676 | * \param name Variable name | ||
699 | 677 | * \param value Variable value | ||
700 | 678 | */ | ||
701 | 679 | - virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::vector<std::string>& values)throw(NutException)=0; | ||
702 | 680 | + virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::vector<std::string>& values)=0; | ||
703 | 681 | /** \} */ | ||
704 | 682 | |||
705 | 683 | /** | ||
706 | 684 | @@ -246,27 +246,27 @@ public: | ||
707 | 685 | * \param dev Device name | ||
708 | 686 | * \return Command names | ||
709 | 687 | */ | ||
710 | 688 | - virtual std::set<std::string> getDeviceCommandNames(const std::string& dev)throw(NutException)=0; | ||
711 | 689 | + virtual std::set<std::string> getDeviceCommandNames(const std::string& dev)=0; | ||
712 | 690 | /** | ||
713 | 691 | * Test if a command is supported by a device. | ||
714 | 692 | * \param dev Device name | ||
715 | 693 | * \param name Command name | ||
716 | 694 | * \return true if the command is supported. | ||
717 | 695 | */ | ||
718 | 696 | - virtual bool hasDeviceCommand(const std::string& dev, const std::string& name)throw(NutException); | ||
719 | 697 | + virtual bool hasDeviceCommand(const std::string& dev, const std::string& name); | ||
720 | 698 | /** | ||
721 | 699 | * Retrieve the description of a command. | ||
722 | 700 | * \param dev Device name | ||
723 | 701 | * \param name Command name | ||
724 | 702 | * \return Command description if provided. | ||
725 | 703 | */ | ||
726 | 704 | - virtual std::string getDeviceCommandDescription(const std::string& dev, const std::string& name)throw(NutException)=0; | ||
727 | 705 | + virtual std::string getDeviceCommandDescription(const std::string& dev, const std::string& name)=0; | ||
728 | 706 | /** | ||
729 | 707 | * Intend to execute a command. | ||
730 | 708 | * \param dev Device name | ||
731 | 709 | * \param name Command name | ||
732 | 710 | */ | ||
733 | 711 | - virtual void executeDeviceCommand(const std::string& dev, const std::string& name)throw(NutException)=0; | ||
734 | 712 | + virtual void executeDeviceCommand(const std::string& dev, const std::string& name)=0; | ||
735 | 713 | /** \} */ | ||
736 | 714 | |||
737 | 715 | /** | ||
738 | 716 | @@ -277,15 +277,15 @@ public: | ||
739 | 717 | * Log the current user (if authenticated) for a device. | ||
740 | 718 | * \param dev Device name. | ||
741 | 719 | */ | ||
742 | 720 | - virtual void deviceLogin(const std::string& dev)throw(NutException)=0; | ||
743 | 721 | + virtual void deviceLogin(const std::string& dev)=0; | ||
744 | 722 | /** | ||
745 | 723 | * Retrieve the number of user longged in the specified device. | ||
746 | 724 | * \param dev Device name. | ||
747 | 725 | * \return Number of logged-in users. | ||
748 | 726 | */ | ||
749 | 727 | - virtual int deviceGetNumLogins(const std::string& dev)throw(NutException)=0; | ||
750 | 728 | - virtual void deviceMaster(const std::string& dev)throw(NutException)=0; | ||
751 | 729 | - virtual void deviceForcedShutdown(const std::string& dev)throw(NutException)=0; | ||
752 | 730 | + virtual int deviceGetNumLogins(const std::string& dev)=0; | ||
753 | 731 | + virtual void deviceMaster(const std::string& dev)=0; | ||
754 | 732 | + virtual void deviceForcedShutdown(const std::string& dev)=0; | ||
755 | 733 | |||
756 | 734 | protected: | ||
757 | 735 | Client(); | ||
758 | 736 | @@ -309,7 +309,7 @@ public: | ||
759 | 737 | * \param host Server host name. | ||
760 | 738 | * \param port Server port. | ||
761 | 739 | */ | ||
762 | 740 | - TcpClient(const std::string& host, int port = 3493)throw(nut::IOException); | ||
763 | 741 | + TcpClient(const std::string& host, int port = 3493); | ||
764 | 742 | ~TcpClient(); | ||
765 | 743 | |||
766 | 744 | /** | ||
767 | 745 | @@ -317,13 +317,13 @@ public: | ||
768 | 746 | * \param host Server host name. | ||
769 | 747 | * \param port Server port. | ||
770 | 748 | */ | ||
771 | 749 | - void connect(const std::string& host, int port = 3493)throw(nut::IOException); | ||
772 | 750 | + void connect(const std::string& host, int port = 3493); | ||
773 | 751 | |||
774 | 752 | /** | ||
775 | 753 | * Connect to the server. | ||
776 | 754 | * Host name and ports must have already set (usefull for reconnection). | ||
777 | 755 | */ | ||
778 | 756 | - void connect()throw(nut::IOException); | ||
779 | 757 | + void connect(); | ||
780 | 758 | |||
781 | 759 | /** | ||
782 | 760 | * Test if the connection is active. | ||
783 | 761 | @@ -358,39 +358,37 @@ public: | ||
784 | 762 | */ | ||
785 | 763 | int getPort()const; | ||
786 | 764 | |||
787 | 765 | - virtual void authenticate(const std::string& user, const std::string& passwd)throw(NutException); | ||
788 | 766 | - virtual void logout()throw(NutException); | ||
789 | 767 | + virtual void authenticate(const std::string& user, const std::string& passwd); | ||
790 | 768 | + virtual void logout(); | ||
791 | 769 | |||
792 | 770 | - virtual Device getDevice(const std::string& name)throw(NutException); | ||
793 | 771 | - virtual std::set<std::string> getDeviceNames()throw(NutException); | ||
794 | 772 | - virtual std::string getDeviceDescription(const std::string& name)throw(NutException); | ||
795 | 773 | - | ||
796 | 774 | - virtual std::set<std::string> getDeviceVariableNames(const std::string& dev)throw(NutException); | ||
797 | 775 | - virtual std::set<std::string> getDeviceRWVariableNames(const std::string& dev)throw(NutException); | ||
798 | 776 | - virtual std::string getDeviceVariableDescription(const std::string& dev, const std::string& name)throw(NutException); | ||
799 | 777 | - virtual std::vector<std::string> getDeviceVariableValue(const std::string& dev, const std::string& name)throw(NutException); | ||
800 | 778 | - virtual std::map<std::string,std::vector<std::string> > getDeviceVariableValues(const std::string& dev)throw(NutException); | ||
801 | 779 | - virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value)throw(NutException); | ||
802 | 780 | - virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::vector<std::string>& values)throw(NutException); | ||
803 | 781 | - | ||
804 | 782 | - virtual std::set<std::string> getDeviceCommandNames(const std::string& dev)throw(NutException); | ||
805 | 783 | - virtual std::string getDeviceCommandDescription(const std::string& dev, const std::string& name)throw(NutException); | ||
806 | 784 | - virtual void executeDeviceCommand(const std::string& dev, const std::string& name)throw(NutException); | ||
807 | 785 | - | ||
808 | 786 | - virtual void deviceLogin(const std::string& dev)throw(NutException); | ||
809 | 787 | - virtual void deviceMaster(const std::string& dev)throw(NutException); | ||
810 | 788 | - virtual void deviceForcedShutdown(const std::string& dev)throw(NutException); | ||
811 | 789 | - virtual int deviceGetNumLogins(const std::string& dev)throw(NutException); | ||
812 | 790 | + virtual Device getDevice(const std::string& name); | ||
813 | 791 | + virtual std::set<std::string> getDeviceNames(); | ||
814 | 792 | + virtual std::string getDeviceDescription(const std::string& name); | ||
815 | 793 | + | ||
816 | 794 | + virtual std::set<std::string> getDeviceVariableNames(const std::string& dev); | ||
817 | 795 | + virtual std::set<std::string> getDeviceRWVariableNames(const std::string& dev); | ||
818 | 796 | + virtual std::string getDeviceVariableDescription(const std::string& dev, const std::string& name); | ||
819 | 797 | + virtual std::vector<std::string> getDeviceVariableValue(const std::string& dev, const std::string& name); | ||
820 | 798 | + virtual std::map<std::string,std::vector<std::string> > getDeviceVariableValues(const std::string& dev); | ||
821 | 799 | + virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value); | ||
822 | 800 | + virtual void setDeviceVariable(const std::string& dev, const std::string& name, const std::vector<std::string>& values); | ||
823 | 801 | + | ||
824 | 802 | + virtual std::set<std::string> getDeviceCommandNames(const std::string& dev); | ||
825 | 803 | + virtual std::string getDeviceCommandDescription(const std::string& dev, const std::string& name); | ||
826 | 804 | + virtual void executeDeviceCommand(const std::string& dev, const std::string& name); | ||
827 | 805 | + | ||
828 | 806 | + virtual void deviceLogin(const std::string& dev); | ||
829 | 807 | + virtual void deviceMaster(const std::string& dev); | ||
830 | 808 | + virtual void deviceForcedShutdown(const std::string& dev); | ||
831 | 809 | + virtual int deviceGetNumLogins(const std::string& dev); | ||
832 | 810 | |||
833 | 811 | protected: | ||
834 | 812 | - std::string sendQuery(const std::string& req)throw(nut::IOException); | ||
835 | 813 | - static void detectError(const std::string& req)throw(nut::NutException); | ||
836 | 814 | + std::string sendQuery(const std::string& req); | ||
837 | 815 | + static void detectError(const std::string& req); | ||
838 | 816 | |||
839 | 817 | - std::vector<std::string> get(const std::string& subcmd, const std::string& params = "") | ||
840 | 818 | - throw(nut::NutException); | ||
841 | 819 | + std::vector<std::string> get(const std::string& subcmd, const std::string& params = ""); | ||
842 | 820 | |||
843 | 821 | - std::vector<std::vector<std::string> > list(const std::string& subcmd, const std::string& params = "") | ||
844 | 822 | - throw(nut::NutException); | ||
845 | 823 | + std::vector<std::vector<std::string> > list(const std::string& subcmd, const std::string& params = ""); | ||
846 | 824 | |||
847 | 825 | static std::vector<std::string> explode(const std::string& str, size_t begin=0); | ||
848 | 826 | static std::string escape(const std::string& str); | ||
849 | 827 | @@ -455,92 +453,92 @@ public: | ||
850 | 828 | /** | ||
851 | 829 | * Retrieve the description of the devce if specified. | ||
852 | 830 | */ | ||
853 | 831 | - std::string getDescription()throw(NutException); | ||
854 | 832 | + std::string getDescription(); | ||
855 | 833 | |||
856 | 834 | /** | ||
857 | 835 | * Intend to retrieve the value of a variable of the device. | ||
858 | 836 | * \param name Name of the variable to get. | ||
859 | 837 | * \return Value of the variable, if available. | ||
860 | 838 | */ | ||
861 | 839 | - std::vector<std::string> getVariableValue(const std::string& name)throw(NutException); | ||
862 | 840 | + std::vector<std::string> getVariableValue(const std::string& name); | ||
863 | 841 | /** | ||
864 | 842 | * Intend to retrieve values of all variables of the devices. | ||
865 | 843 | * \return Map of all variables values indexed by their names. | ||
866 | 844 | */ | ||
867 | 845 | - std::map<std::string,std::vector<std::string> > getVariableValues()throw(NutException); | ||
868 | 846 | + std::map<std::string,std::vector<std::string> > getVariableValues(); | ||
869 | 847 | /** | ||
870 | 848 | * Retrieve all variables names supported by the device. | ||
871 | 849 | * \return Set of available variable names. | ||
872 | 850 | */ | ||
873 | 851 | - std::set<std::string> getVariableNames()throw(NutException); | ||
874 | 852 | + std::set<std::string> getVariableNames(); | ||
875 | 853 | /** | ||
876 | 854 | * Retrieve all Read/Write variables names supported by the device. | ||
877 | 855 | * \return Set of available Read/Write variable names. | ||
878 | 856 | */ | ||
879 | 857 | - std::set<std::string> getRWVariableNames()throw(NutException); | ||
880 | 858 | + std::set<std::string> getRWVariableNames(); | ||
881 | 859 | /** | ||
882 | 860 | * Intend to set the value of a variable of the device. | ||
883 | 861 | * \param name Variable name. | ||
884 | 862 | * \param value New variable value. | ||
885 | 863 | */ | ||
886 | 864 | - void setVariable(const std::string& name, const std::string& value)throw(NutException); | ||
887 | 865 | + void setVariable(const std::string& name, const std::string& value); | ||
888 | 866 | /** | ||
889 | 867 | * Intend to set values of a variable of the device. | ||
890 | 868 | * \param name Variable name. | ||
891 | 869 | * \param value New variable values. | ||
892 | 870 | */ | ||
893 | 871 | - void setVariable(const std::string& name, const std::vector<std::string>& values)throw(NutException); | ||
894 | 872 | + void setVariable(const std::string& name, const std::vector<std::string>& values); | ||
895 | 873 | |||
896 | 874 | /** | ||
897 | 875 | * Retrieve a Variable object representing the specified variable. | ||
898 | 876 | * \param name Variable name. | ||
899 | 877 | * \return Variable object. | ||
900 | 878 | */ | ||
901 | 879 | - Variable getVariable(const std::string& name)throw(NutException); | ||
902 | 880 | + Variable getVariable(const std::string& name); | ||
903 | 881 | /** | ||
904 | 882 | * Retrieve Variable objects representing all variables available for the device. | ||
905 | 883 | * \return Set of Variable objects. | ||
906 | 884 | */ | ||
907 | 885 | - std::set<Variable> getVariables()throw(NutException); | ||
908 | 886 | + std::set<Variable> getVariables(); | ||
909 | 887 | /** | ||
910 | 888 | * Retrieve Variable objects representing all Read/Write variables available for the device. | ||
911 | 889 | * \return Set of Variable objects. | ||
912 | 890 | */ | ||
913 | 891 | - std::set<Variable> getRWVariables()throw(NutException); | ||
914 | 892 | + std::set<Variable> getRWVariables(); | ||
915 | 893 | |||
916 | 894 | /** | ||
917 | 895 | * Retrieve names of all commands supported by the device. | ||
918 | 896 | * \return Set of available command names. | ||
919 | 897 | */ | ||
920 | 898 | - std::set<std::string> getCommandNames()throw(NutException); | ||
921 | 899 | + std::set<std::string> getCommandNames(); | ||
922 | 900 | /** | ||
923 | 901 | * Retrieve objects for all commands supported by the device. | ||
924 | 902 | * \return Set of available Command objects. | ||
925 | 903 | */ | ||
926 | 904 | - std::set<Command> getCommands()throw(NutException); | ||
927 | 905 | + std::set<Command> getCommands(); | ||
928 | 906 | /** | ||
929 | 907 | * Retrieve an object representing a command of the device. | ||
930 | 908 | * \param name Command name. | ||
931 | 909 | * \return Command object. | ||
932 | 910 | */ | ||
933 | 911 | - Command getCommand(const std::string& name)throw(NutException); | ||
934 | 912 | + Command getCommand(const std::string& name); | ||
935 | 913 | /** | ||
936 | 914 | * Intend to execute a command on the device. | ||
937 | 915 | * \param name Command name. | ||
938 | 916 | */ | ||
939 | 917 | - void executeCommand(const std::string& name)throw(NutException); | ||
940 | 918 | + void executeCommand(const std::string& name); | ||
941 | 919 | |||
942 | 920 | /** | ||
943 | 921 | * Login current client's user for the device. | ||
944 | 922 | */ | ||
945 | 923 | - void login()throw(NutException); | ||
946 | 924 | - void master()throw(NutException); | ||
947 | 925 | - void forcedShutdown()throw(NutException); | ||
948 | 926 | + void login(); | ||
949 | 927 | + void master(); | ||
950 | 928 | + void forcedShutdown(); | ||
951 | 929 | /** | ||
952 | 930 | * Retrieve the number of logged user for the device. | ||
953 | 931 | * \return Number of users. | ||
954 | 932 | */ | ||
955 | 933 | - int getNumLogins()throw(NutException); | ||
956 | 934 | + int getNumLogins(); | ||
957 | 935 | |||
958 | 936 | protected: | ||
959 | 937 | Device(Client* client, const std::string& name); | ||
960 | 938 | @@ -603,23 +601,23 @@ public: | ||
961 | 939 | * Intend to retrieve variable value. | ||
962 | 940 | * \return Value of the variable. | ||
963 | 941 | */ | ||
964 | 942 | - std::vector<std::string> getValue()throw(NutException); | ||
965 | 943 | + std::vector<std::string> getValue(); | ||
966 | 944 | /** | ||
967 | 945 | * Intend to retireve variable description. | ||
968 | 946 | * \return Variable description if provided. | ||
969 | 947 | */ | ||
970 | 948 | - std::string getDescription()throw(NutException); | ||
971 | 949 | + std::string getDescription(); | ||
972 | 950 | |||
973 | 951 | /** | ||
974 | 952 | * Intend to set a value to the variable. | ||
975 | 953 | * \param value New variable value. | ||
976 | 954 | */ | ||
977 | 955 | - void setValue(const std::string& value)throw(NutException); | ||
978 | 956 | + void setValue(const std::string& value); | ||
979 | 957 | /** | ||
980 | 958 | * Intend to set (multiple) values to the variable. | ||
981 | 959 | * \param value New variable values. | ||
982 | 960 | */ | ||
983 | 961 | - void setValues(const std::vector<std::string>& values)throw(NutException); | ||
984 | 962 | + void setValues(const std::vector<std::string>& values); | ||
985 | 963 | |||
986 | 964 | protected: | ||
987 | 965 | Variable(Device* dev, const std::string& name); | ||
988 | 966 | @@ -683,13 +681,13 @@ public: | ||
989 | 967 | * Intend to retireve command description. | ||
990 | 968 | * \return Command description if provided. | ||
991 | 969 | */ | ||
992 | 970 | - std::string getDescription()throw(NutException); | ||
993 | 971 | + std::string getDescription(); | ||
994 | 972 | |||
995 | 973 | /** | ||
996 | 974 | * Intend to retrieve command description. | ||
997 | 975 | * \return Command description if provided. | ||
998 | 976 | */ | ||
999 | 977 | - void execute()throw(NutException); | ||
1000 | 978 | + void execute(); | ||
1001 | 979 | |||
1002 | 980 | protected: | ||
1003 | 981 | Command(Device* dev, const std::string& name); | ||
1004 | diff --git a/debian/patches/series b/debian/patches/series | |||
1005 | index 50dc917..b11be6b 100644 | |||
1006 | --- a/debian/patches/series | |||
1007 | +++ b/debian/patches/series | |||
1008 | @@ -11,3 +11,4 @@ | |||
1009 | 11 | 0011-use-pkgconfig-module.patch | 11 | 0011-use-pkgconfig-module.patch |
1010 | 12 | 0012-add-AEG-PROTECT-NAS-support.patch | 12 | 0012-add-AEG-PROTECT-NAS-support.patch |
1011 | 13 | 0013-fix-doc-build.patch | 13 | 0013-fix-doc-build.patch |
1012 | 14 | Remove-dynamic-exception-specifications-from-clients.patch |
Hey,
On a quick look:
-> indeed, as you say, there are lots of warnings, et al. But well, it's okay.
-> build-time tests aren't being run, why? :( ======= ======= ======= ======= ======= ======= ======= ======= ======= ====== ======= ======= ======= ======= ======= ======= ======= ======= ======= ====== ======= ======= ======= ======= ======= ======= ======= ======= ======= ======
```
=======
Testsuite summary for nut 2.7.4
=======
# TOTAL: 0
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
=======
```
-> there seem to be a symbols mismatch: libnutclient0/ DEBIAN/ symbols doesn't match completely debian/ libnutclient0. symbols libnutclient0. symbols (libnutclient0_ 2.7.4-13ubuntu5 _amd64) Xa6vj0 2021-08-12 20:05:50.329104861 +0000 "nut::Device: :setVariable( std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > const&, std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > const&)@Base" 2.7.3 "nut::Device: :setVariable( std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > const&, std::vector< std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> >, std::allocator< std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > > > const&)@Base" 2.7.3 "nut::Device: :~Device( )@Base" 2.7.3 lto)"nut: :IOException: :~IOException( )@Base" 2.7.3 lto)"nut: :NotConnectedEx ception: :NotConnectedEx ception( )@Base" 2.7.3 lto)"nut: :NotConnectedEx ception: :~NotConnectedE xception( )@Base" 2.7.3 lto)"nut: :NutException: :NutException( std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > const&)@Base" 2.7.3 lto)"nut: :NutException: :str[abi: cxx11]( ) const@Base" 2.7.3 lto)"nut: :NutException: :what() const@Base" 2.7.3 lto)"nut: :NutException: :~NutException( )@Base" 2.7.3 lto)"nut: :IOException: :~IOException( )@Base" 2.7.3 lto)"nut: :NotConnectedEx ception: :NotConnectedEx ception( )@Base" 2.7.3 lto)"nut: :NotConnectedEx ception: :~NotConnectedE xception( )@Base" 2.7.3 lto)"nut: :NutException: :NutException( std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > const&)@Base" 2.7.3 lto)"nut: :NutException: :str[abi: cxx11]( ) const@Base" 2.7.3 lto)"nut: :NutException: :what() const@Base" 2.7.3 lto)"nut: :NutException: :~NutException( )@Base" 2.7.3 "nut::SystemExc eption: :SystemExceptio n()@Base" 2.7.3 "nut::SystemExc eption: :err[abi: cxx11]( )@Base" 2.7.3 lto)"nut: :SystemExceptio n::~SystemExcep tion()@ Base" 2.7.3 lto)"nut: :SystemExceptio n::~SystemExcep tion()@ Base" 2.7.3 "nut::TcpClient ::TcpClient( )@Base" 2.7.3 "nut::TcpClient ::TcpClient( std::__ cxx11:: basic_string< char, std::c...
```
dpkg-gensymbols: warning: debian/
--- debian/
+++ dpkg-gensymbols
@@ -50,16 +50,16 @@
(c++)
(c++)
(c++)
- (c++|optional=
- (c++|optional=
- (c++|optional=
- (c++|optional=
- (c++|optional=
- (c++|optional=
- (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
(c++)
(c++)
- (c++|optional=
+#MISSING: 2.7.4-13ubuntu5# (c++|optional=
(c++)
(c++)