Merge ~lucaskanashiro/ubuntu/+source/smartmontools:bionic-update-smart-drivedb into ubuntu/+source/smartmontools:ubuntu/bionic-devel
- Git
- lp:~lucaskanashiro/ubuntu/+source/smartmontools
- bionic-update-smart-drivedb
- Merge into ubuntu/bionic-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 58becd08cc0b7fd5764b91d1f45d3230f1442cd0 | ||||
Proposed branch: | ~lucaskanashiro/ubuntu/+source/smartmontools:bionic-update-smart-drivedb | ||||
Merge into: | ubuntu/+source/smartmontools:ubuntu/bionic-devel | ||||
Diff against target: |
886 lines (+827/-2) 6 files modified
debian/changelog (+10/-0) debian/control (+4/-1) debian/patches/series (+2/-0) debian/patches/update-smart-drivedb.8.in-add-gpg-verification-support.patch (+255/-0) debian/patches/update-smart-drivedb.in-add-gpg-verification-support.patch (+556/-0) debian/rules (+0/-1) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christian Ehrhardt (community) | Approve | ||
Canonical Server | Pending | ||
Review via email: mp+389609@code.launchpad.net |
Commit message
Description of the change
Fix LP #1874362. The update-
Here is a PPA with the proposed package in case you want to test it:
https:/
Christian Ehrhardt (paelzer) wrote : | # |
Christian Ehrhardt (paelzer) wrote : | # |
+1 based on the checks and comments on the xenial MP (I did them on both)
Lucas Kanashiro (lucaskanashiro) wrote : | # |
Uploaded:
$ git push pkg upload/
Enumerating objects: 31, done.
Counting objects: 100% (31/31), done.
Delta compression using up to 8 threads
Compressing objects: 100% (24/24), done.
Writing objects: 100% (24/24), 14.93 KiB | 1.66 MiB/s, done.
Total 24 (delta 16), reused 0 (delta 0)
To ssh://git.
* [new tag] upload/
$ dput ubuntu smartmontools_
Checking signature on .changes
gpg: /home/kanashiro
Checking signature on .dsc
gpg: /home/kanashiro
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading smartmontools_
Uploading smartmontools_
Uploading smartmontools_
Successfully uploaded packages.
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index d0c8530..47899a5 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,3 +1,13 @@ |
6 | +smartmontools (6.5+svn4324-1ubuntu0.1) bionic; urgency=medium |
7 | + |
8 | + * Add GPG verification support to update-smart-drivedb (LP: #1874362) |
9 | + - d/p/update-smart-drivedb{,.8}.in-add-gpg-verification-support.patch: |
10 | + created. |
11 | + - d/rules: do not remove update-smart-drivedb during installation |
12 | + - d/control: add update-smart-drivedb dependencies as Suggests |
13 | + |
14 | + -- Lucas Kanashiro <kanashiro@ubuntu.com> Thu, 20 Aug 2020 11:17:35 -0300 |
15 | + |
16 | smartmontools (6.5+svn4324-1) unstable; urgency=low |
17 | |
18 | * [a86ec89] Imported Upstream version 6.5+svn43204 (Closes: #831504) |
19 | diff --git a/debian/control b/debian/control |
20 | index bbe9cad..a57674e 100644 |
21 | --- a/debian/control |
22 | +++ b/debian/control |
23 | @@ -1,7 +1,8 @@ |
24 | Source: smartmontools |
25 | Section: utils |
26 | Priority: optional |
27 | -Maintainer: Giuseppe Iuculano <iuculano@debian.org> |
28 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
29 | +XSBC-Original-Maintainer: Giuseppe Iuculano <iuculano@debian.org> |
30 | Uploaders: Florian Maier <contact@marsmenschen.com>, |
31 | Jonathan Dowland <jmtd@debian.org> |
32 | Build-Depends: autoconf, |
33 | @@ -27,6 +28,8 @@ Depends: debianutils (>= 2.2), |
34 | ${shlibs:Depends} |
35 | Recommends: mailx | mailutils |
36 | Suggests: gsmartcontrol, smart-notifier |
37 | +# update-smart-drivedb |
38 | + ,curl | wget | lynx, gpg |
39 | Description: control and monitor storage systems using S.M.A.R.T. |
40 | The smartmontools package contains two utility programs (smartctl and smartd) |
41 | to control and monitor storage systems using the Self-Monitoring, Analysis and |
42 | diff --git a/debian/patches/series b/debian/patches/series |
43 | index 6775064..428c89a 100644 |
44 | --- a/debian/patches/series |
45 | +++ b/debian/patches/series |
46 | @@ -7,3 +7,5 @@ |
47 | manpage.diff |
48 | kfreebsd.patch |
49 | removesyslogtarget.patch |
50 | +update-smart-drivedb.in-add-gpg-verification-support.patch |
51 | +update-smart-drivedb.8.in-add-gpg-verification-support.patch |
52 | diff --git a/debian/patches/update-smart-drivedb.8.in-add-gpg-verification-support.patch b/debian/patches/update-smart-drivedb.8.in-add-gpg-verification-support.patch |
53 | new file mode 100644 |
54 | index 0000000..6e79d65 |
55 | --- /dev/null |
56 | +++ b/debian/patches/update-smart-drivedb.8.in-add-gpg-verification-support.patch |
57 | @@ -0,0 +1,255 @@ |
58 | +From: Lucas Kanashiro <lucas.kanashiro@canonical.com> |
59 | +Date: Thu, 20 Aug 2020 11:12:52 -0300 |
60 | +Subject: Backport update-smart-drivedb.8.in with GPG verification support |
61 | + |
62 | +The paths (most of things were pointing users to /usr/local and not the |
63 | +properly path where files are installed via Debian package), and the GPG |
64 | +public key ID were updated on top of the upstream version. |
65 | + |
66 | +Origin: upstream, https://github.com/smartmontools/smartmontools/blob/RELEASE_7_1/smartmontools/update-smart-drivedb.8.in |
67 | +Bug-Ubuntu: #1874362 |
68 | +Last-Updated: 2020-08-20 |
69 | +--- |
70 | + update-smart-drivedb.8.in | 133 +++++++++++++++++++++++++++++----------------- |
71 | + 1 file changed, 85 insertions(+), 48 deletions(-) |
72 | + |
73 | +diff --git a/update-smart-drivedb.8.in b/update-smart-drivedb.8.in |
74 | +index 1517be5..df2b634 100644 |
75 | +--- a/update-smart-drivedb.8.in |
76 | ++++ b/update-smart-drivedb.8.in |
77 | +@@ -1,27 +1,38 @@ |
78 | + .ig |
79 | + Copyright (C) 2013 Hannes von Haugwitz <hannes@vonhaugwitz.com> |
80 | +-Copyright (C) 2014-16 Christian Franke |
81 | ++Copyright (C) 2014-19 Christian Franke |
82 | + |
83 | +-$Id: update-smart-drivedb.8.in 4223 2016-02-26 20:18:40Z chrfranke $ |
84 | ++SPDX-License-Identifier: GPL-2.0-or-later |
85 | + |
86 | +-This program is free software; you can redistribute it and/or modify |
87 | +-it under the terms of the GNU General Public License as published by |
88 | +-the Free Software Foundation; either version 2, or (at your option) |
89 | +-any later version. |
90 | +- |
91 | +-You should have received a copy of the GNU General Public License |
92 | +-(for example COPYING); If not, see <http://www.gnu.org/licenses/>. |
93 | ++$Id$ |
94 | + |
95 | + .. |
96 | ++.\" Macros borrowed from pages generated with Pod::Man |
97 | ++.de Sp \" Vertical space (when we can't use .PP) |
98 | ++.if t .sp 0.4v |
99 | ++.if n .sp |
100 | ++.. |
101 | ++.de Vb \" Begin verbatim text |
102 | ++.ft CW |
103 | ++.nf |
104 | ++.ne \\$1 |
105 | ++.. |
106 | ++.de Ve \" End verbatim text |
107 | ++.ft R |
108 | ++.fi |
109 | ++.. |
110 | ++.\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible |
111 | ++.ie \n(.g .ds Aq \(aq |
112 | ++.el .ds Aq ' |
113 | + .TH UPDATE-SMART-DRIVEDB 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools" |
114 | + .SH NAME |
115 | + update-smart-drivedb \- update smartmontools drive database |
116 | +- |
117 | ++.Sp |
118 | + .SH "SYNOPSIS" |
119 | + .B update-smart-drivedb |
120 | + .RI [ OPTIONS ] |
121 | + .RI [ DESTFILE ] |
122 | +- |
123 | ++.Sp |
124 | + .SH "DESCRIPTION" |
125 | + .\" %IF NOT OS ALL |
126 | + .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools. |
127 | +@@ -30,13 +41,12 @@ update-smart-drivedb \- update smartmontools drive database |
128 | + .\" %ENDIF NOT OS ALL |
129 | + .B update-smart-drivedb |
130 | + updates |
131 | +-.B /usr/local/share/smartmontools/drivedb.h |
132 | ++.B /var/lib/smartmontools/drivedb/drivedb.h |
133 | + or |
134 | + .I DESTFILE |
135 | +-from smartmontools SVN repository. |
136 | +- |
137 | +-It tries to download first from the current branch and then from |
138 | +-trunk. The tools used for downloading are either |
139 | ++from branches/RELEASE_6_0_DRIVEDB of smartmontools SVN repository. |
140 | ++.PP |
141 | ++The tools used for downloading are either |
142 | + .BR curl (1), |
143 | + .BR wget (1), |
144 | + .BR lynx (1), |
145 | +@@ -50,20 +60,23 @@ trunk. The tools used for downloading are either |
146 | + .\" %ENDIF OS OpenBSD |
147 | + or |
148 | + .BR svn (1). |
149 | +- |
150 | ++.PP |
151 | ++The downloaded file is verified with OpenPGP/GPG key ID DFD22559. |
152 | ++The public key block is included in the script. |
153 | ++.PP |
154 | + The old file is kept if the downloaded file is identical (ignoring |
155 | + the differences in Id string) otherwise it is moved to |
156 | + .BR drivedb.h.old . |
157 | +- |
158 | ++.Sp |
159 | + .SH "OPTIONS" |
160 | + .TP |
161 | + .B \-s SMARTCTL |
162 | + Use the |
163 | + .BR smartctl (8) |
164 | + executable at path SMARTCTL for drive database syntax check. |
165 | +-The form \'\-s \-\' disables the syntax check. |
166 | ++The form \*(Aq\-s \-\*(Aq disables the syntax check. |
167 | + The default is |
168 | +-.BR /usr/local/sbin/smartctl . |
169 | ++.BR /usr/sbin/smartctl . |
170 | + .TP |
171 | + .B \-t TOOL |
172 | + Use TOOL for download. |
173 | +@@ -79,23 +92,32 @@ TOOL is one of: |
174 | + The default is the first one found in PATH. |
175 | + .TP |
176 | + .B \-u LOCATION |
177 | +-Use URL of LOCATION for download. LOCATION is one of: |
178 | ++Use URL of LOCATION for download. |
179 | ++LOCATION is one of: |
180 | ++.br |
181 | ++.I github |
182 | ++(GitHub mirror of SVN repository), |
183 | + .br |
184 | + .I sf |
185 | +-(Sourceforge code browser via HTTPS), |
186 | ++(Sourceforge code browser), |
187 | + .br |
188 | + .I svn |
189 | +-(SVN repository via HTTPS), |
190 | ++(SVN repository), |
191 | + .br |
192 | + .I svni |
193 | +-(SVN repository via HTTP), |
194 | ++(SVN repository via HTTP instead of HTTPS), |
195 | + .br |
196 | + .I trac |
197 | +-(Trac code browser via HTTPS). |
198 | ++(Trac code browser). |
199 | + .br |
200 | + The default is |
201 | + .IR svn . |
202 | + .TP |
203 | ++.B \-\-trunk |
204 | ++Download from SVN trunk. |
205 | ++This requires \*(Aq\-\-no\-verify\*(Aq unless the trunk version is still |
206 | ++identical to branches/RELEASE_6_0_DRIVEDB. |
207 | ++.TP |
208 | + .B \-\-cacert FILE |
209 | + Use CA certificates from FILE to verify the peer. |
210 | + .TP |
211 | +@@ -104,63 +126,78 @@ Use CA certificate files from DIR to verify the peer. |
212 | + .TP |
213 | + .B \-\-insecure |
214 | + Don't abort download if certificate verification fails. |
215 | +-This option is also required if a HTTP URL is selected with \'-u\' option. |
216 | ++This option is also required if a HTTP URL is selected with \*(Aq\-u\*(Aq |
217 | ++option. |
218 | ++.TP |
219 | ++.B \-\-no\-verify |
220 | ++Don't verify signature with GnuPG. |
221 | ++.TP |
222 | ++.B \-\-export\-key |
223 | ++Print the OpenPGP/GPG public key block. |
224 | + .TP |
225 | + .B \-\-dryrun |
226 | + Print download commands only. |
227 | + .TP |
228 | + .B \-v |
229 | + Verbose output. |
230 | +- |
231 | ++.Sp |
232 | + .SH "EXAMPLES" |
233 | +-.nf |
234 | ++.Vb 2 |
235 | + # update-smart-drivedb |
236 | +-/usr/local/share/smartmontools/drivedb.h updated from branches/RELEASE_6_0_DRIVEDB |
237 | +-.fi |
238 | +- |
239 | ++/var/lib/smartmontools/drivedb/drivedb.h updated from \e |
240 | ++branches/RELEASE_6_0_DRIVEDB |
241 | ++.Ve |
242 | ++.Sp |
243 | + .SH "EXIT STATUS" |
244 | + The exit status is 0 if the database has been successfully |
245 | +-updated. If an error occurs the exit status is 1. |
246 | +- |
247 | ++updated. |
248 | ++If an error occurs the exit status is 1. |
249 | ++.Sp |
250 | + .SH FILES |
251 | + .TP |
252 | +-.B /usr/local/sbin/update-smart-drivedb |
253 | ++.B /usr/sbin/update-smart-drivedb |
254 | + full path of this script. |
255 | + .TP |
256 | +-.B /usr/local/sbin/smartctl |
257 | ++.B /usr/sbin/smartctl |
258 | + used to check syntax of new drive database. |
259 | + .TP |
260 | +-.B /usr/local/share/smartmontools/drivedb.h |
261 | ++.B /var/lib/smartmontools/drivedb/drivedb.h |
262 | + current drive database. |
263 | + .TP |
264 | +-.B /usr/local/share/smartmontools/drivedb.h.old |
265 | +-previous drive database. |
266 | ++.B /var/lib/smartmontools/drivedb/drivedb.h.raw |
267 | ++current drive database with unexpanded SVN Id string. |
268 | + .TP |
269 | +-.B /usr/local/share/smartmontools/drivedb.h.error |
270 | +-new drive database if rejected due to syntax errors. |
271 | ++.B /var/lib/smartmontools/drivedb/drivedb.h.raw.asc |
272 | ++signature file. |
273 | + .TP |
274 | +-.B /usr/local/share/smartmontools/drivedb.h.lastcheck |
275 | ++.B /var/lib/smartmontools/drivedb/drivedb.h.*old* |
276 | ++previous files. |
277 | ++.TP |
278 | ++.B /var/lib/smartmontools/drivedb/drivedb.h.*error* |
279 | ++new files if rejected due to errors. |
280 | ++.TP |
281 | ++.B /var/lib/smartmontools/drivedb/drivedb.h.lastcheck |
282 | + empty file created if downloaded file was identical. |
283 | +- |
284 | ++.Sp |
285 | + .SH AUTHORS |
286 | + \fBChristian Franke\fP. |
287 | + .br |
288 | + This manual page was originally written by |
289 | + .BR "Hannes von Haugwitz <hannes@vonhaugwitz.com>" . |
290 | +- |
291 | ++.Sp |
292 | + .SH REPORTING BUGS |
293 | + To submit a bug report, create a ticket in smartmontools wiki: |
294 | + .br |
295 | +-<\fBhttp://www.smartmontools.org/\fP>. |
296 | ++<\fBhttps://www.smartmontools.org/\fP>. |
297 | + .br |
298 | + Alternatively send the info to the smartmontools support mailing list: |
299 | + .br |
300 | +-<\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>. |
301 | +- |
302 | ++<\fBhttps://listi.jpberlin.de/mailman/listinfo/smartmontools-support\fB>. |
303 | ++.Sp |
304 | + .SH SEE ALSO |
305 | + \fBsmartctl\fP(8), \fBsmartd\fP(8). |
306 | +- |
307 | ++.Sp |
308 | + .SH PACKAGE VERSION |
309 | + CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV |
310 | + .br |
311 | +-$Id: update-smart-drivedb.8.in 4223 2016-02-26 20:18:40Z chrfranke $ |
312 | ++$Id$ |
313 | diff --git a/debian/patches/update-smart-drivedb.in-add-gpg-verification-support.patch b/debian/patches/update-smart-drivedb.in-add-gpg-verification-support.patch |
314 | new file mode 100644 |
315 | index 0000000..3a705e1 |
316 | --- /dev/null |
317 | +++ b/debian/patches/update-smart-drivedb.in-add-gpg-verification-support.patch |
318 | @@ -0,0 +1,556 @@ |
319 | +From: Lucas Kanashiro <lucas.kanashiro@canonical.com> |
320 | +Date: Thu, 20 Aug 2020 11:07:38 -0300 |
321 | +Subject: Backport update-smart-drivedb.in with GPG verification support |
322 | + |
323 | +In order to make it work on this old version I needed to make some |
324 | +changes on top of the upstream version: |
325 | + |
326 | +- Updated the GPG public key, now the key with ID DFD22559 was included. |
327 | +This is the key used to sign the drivedb.h backported to this release. |
328 | +- Set some variables with default values used in Focal since they are not |
329 | +configurable in this old release. |
330 | + |
331 | +Origin: upstream, https://github.com/smartmontools/smartmontools/blob/RELEASE_7_1/smartmontools/update-smart-drivedb.in |
332 | +Bug-Ubuntu: #1874362 |
333 | +Last-Updated: 2020-08-20 |
334 | +--- |
335 | + update-smart-drivedb.in | 406 +++++++++++++++++++++++++++++++++++++----------- |
336 | + 1 file changed, 318 insertions(+), 88 deletions(-) |
337 | + |
338 | +diff --git a/update-smart-drivedb.in b/update-smart-drivedb.in |
339 | +index 9843444..c677d9d 100644 |
340 | +--- a/update-smart-drivedb.in |
341 | ++++ b/update-smart-drivedb.in |
342 | +@@ -2,21 +2,20 @@ |
343 | + # |
344 | + # smartmontools drive database update script |
345 | + # |
346 | +-# Copyright (C) 2010-16 Christian Franke |
347 | ++# Home page of code is: http://www.smartmontools.org |
348 | + # |
349 | +-# This program is free software; you can redistribute it and/or modify |
350 | +-# it under the terms of the GNU General Public License as published by |
351 | +-# the Free Software Foundation; either version 2, or (at your option) |
352 | +-# any later version. |
353 | ++# Copyright (C) 2010-19 Christian Franke |
354 | + # |
355 | +-# You should have received a copy of the GNU General Public License |
356 | +-# (for example COPYING); If not, see <http://www.gnu.org/licenses/>. |
357 | ++# SPDX-License-Identifier: GPL-2.0-or-later |
358 | + # |
359 | +-# $Id: update-smart-drivedb.in 4224 2016-02-26 20:29:24Z chrfranke $ |
360 | ++# $Id$ |
361 | + # |
362 | + |
363 | + set -e |
364 | + |
365 | ++# Set the same value used in Focal |
366 | ++export PATH="/usr/local/bin:/usr/bin:/bin" |
367 | ++ |
368 | + # Set by config.status |
369 | + PACKAGE="@PACKAGE@" |
370 | + VERSION="@VERSION@" |
371 | +@@ -36,13 +35,24 @@ BRANCH="@DRIVEDB_BRANCH@" |
372 | + # Default drivedb location |
373 | + DRIVEDB="$drivedbdir/drivedb.h" |
374 | + |
375 | ++# GnuPG used to verify signature (disabled if empty) |
376 | ++# Set the same value used in Focal |
377 | ++GPG="gpg" |
378 | ++ |
379 | + # Smartctl used for syntax check |
380 | + SMARTCTL="$sbindir/smartctl" |
381 | + |
382 | ++# PATH information for help and error messages |
383 | ++# Set the same value used in Focal |
384 | ++pathinfo="'$PATH'" |
385 | ++ |
386 | + myname=$0 |
387 | + |
388 | + usage() |
389 | + { |
390 | ++ # Set the same value used in Focal |
391 | ++ pathinfo=" |
392 | ++ $pathinfo" |
393 | + cat <<EOF |
394 | + smartmontools $VERSION drive database update script |
395 | + |
396 | +@@ -51,22 +61,25 @@ Usage: $myname [OPTIONS] [DESTFILE] |
397 | + -s SMARTCTL Use SMARTCTL for syntax check ('-s -' to disable) |
398 | + [default: $SMARTCTL] |
399 | + -t TOOL Use TOOL for download: $os_dltools |
400 | +- [default: first one found in PATH] |
401 | ++ [default: first one found in $pathinfo] |
402 | + -u LOCATION Use URL of LOCATION for download: |
403 | +- sf (Sourceforge code browser via HTTPS) |
404 | +- svn (SVN repository via HTTPS) [default] |
405 | +- svni (SVN repository via HTTP) |
406 | +- trac (Trac code browser via HTTPS) |
407 | ++ github (GitHub mirror of SVN repository) |
408 | ++ sf (Sourceforge code browser) |
409 | ++ svn (SVN repository) [default] |
410 | ++ svni (SVN repository via HTTP instead of HTTPS) |
411 | ++ trac (Trac code browser) |
412 | ++ --trunk Download from SVN trunk (may require '--no-verify') |
413 | + --cacert FILE Use CA certificates from FILE to verify the peer |
414 | + --capath DIR Use CA certificate files from DIR to verify the peer |
415 | + --insecure Don't abort download if certificate verification fails |
416 | ++ --no-verify Don't verify signature |
417 | ++ --export-key Print the OpenPGP/GPG public key block |
418 | + --dryrun Print download commands only |
419 | + -v Verbose output |
420 | + |
421 | + Updates $DRIVEDB |
422 | +-or DESTFILE from smartmontools SVN repository. |
423 | +-Tries to download first from branch $BRANCH |
424 | +-and then from trunk. |
425 | ++or DESTFILE from branches/$BRANCH of smartmontools |
426 | ++SVN repository. |
427 | + EOF |
428 | + exit 1 |
429 | + } |
430 | +@@ -77,6 +90,14 @@ error() |
431 | + exit 1 |
432 | + } |
433 | + |
434 | ++err_notfound() |
435 | ++{ |
436 | ++ case $1 in |
437 | ++ */*) error "$1: not found $2" ;; |
438 | ++ *) error "$1: not found in $pathinfo $2" ;; |
439 | ++ esac |
440 | ++} |
441 | ++ |
442 | + warning() |
443 | + { |
444 | + echo "$myname: (Warning) $*" >&2 |
445 | +@@ -85,6 +106,10 @@ warning() |
446 | + selecturl() |
447 | + { |
448 | + case $1 in |
449 | ++ github) # https://github.com/smartmontools/smartmontools/raw/origin/$BRANCH/smartmontools/drivedb.h |
450 | ++ # https://github.com/smartmontools/smartmontools/raw/master/smartmontools/drivedb.h |
451 | ++ # redirected to: |
452 | ++ url='https://raw.githubusercontent.com/smartmontools/smartmontools/master/smartmontools/drivedb.h' ;; |
453 | + sf) url='https://sourceforge.net/p/smartmontools/code/HEAD/tree/trunk/smartmontools/drivedb.h?format=raw' ;; |
454 | + svn) url='https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools/drivedb.h' ;; |
455 | + svni) url='http://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools/drivedb.h' ;; |
456 | +@@ -149,7 +174,7 @@ vrun2() |
457 | + # download URL FILE |
458 | + download() |
459 | + { |
460 | +- local f u se rc |
461 | ++ local f u rc |
462 | + u=$1; f=$2 |
463 | + rc=0 |
464 | + |
465 | +@@ -207,15 +232,198 @@ download() |
466 | + return $rc |
467 | + } |
468 | + |
469 | ++# check_file FILE FIRST_CHAR MIN_SIZE MAX_SIZE |
470 | ++check_file() |
471 | ++{ |
472 | ++ local firstchar f maxsize minsize size |
473 | ++ test -z "$dryrun" || return 0 |
474 | ++ f=$1; firstchar=$2; minsize=$3; maxsize=$4 |
475 | ++ |
476 | ++ # Check first chars |
477 | ++ case `dd if="$f" bs=1 count=1 2>/dev/null` in |
478 | ++ $firstchar) ;; |
479 | ++ \<) echo "HTML error message"; return 1 ;; |
480 | ++ *) echo "unknown file contents"; return 1 ;; |
481 | ++ esac |
482 | ++ |
483 | ++ # Check file size |
484 | ++ size=`wc -c < "$f"` |
485 | ++ if test "$size" -lt $minsize; then |
486 | ++ echo "too small file size $size bytes" |
487 | ++ return 1 |
488 | ++ fi |
489 | ++ if test "$size" -gt $maxsize; then |
490 | ++ echo "too large file size $size bytes" |
491 | ++ return 1 |
492 | ++ fi |
493 | ++ return 0 |
494 | ++} |
495 | ++ |
496 | ++# unexpand_svn_id < INFILE > OUTFILE |
497 | ++unexpand_svn_id() |
498 | ++{ |
499 | ++ sed 's,\$''Id'': drivedb\.h [0-9][0-9]* 2[-0-9]* [012][:0-9]*Z [a-z][a-z0-9]* \$,$''Id''$,' |
500 | ++} |
501 | ++ |
502 | ++# Smartmontools Signing Key (through 2024) |
503 | ++# <smartmontools-database@listi.jpberlin.de> |
504 | ++# Key ID DFD22559 |
505 | ++public_key="\ |
506 | ++-----BEGIN PGP PUBLIC KEY BLOCK----- |
507 | ++ |
508 | ++mQENBFgOYoEBCAC93841SlFmpp6640hKUvZ8PbZR6OGnZnMXD6QRVzpibXGZXUDB |
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 |
524 | ++KutcM2gjKETW+ZwW76qHJD52mYihPPLXu2pRAG2WyH5GDnqNMj5iQ1inoPdZOTpi |
525 | ++evBMTv1YHJML6SiF6t/HoKorl5ffvHBE/1onBfUzLwQ/ct14sZ2UXHzyxdHo73vm |
526 | ++XWgcjQ1TQhCSdLqucQbwR78EyUa9tYxk/NWBqfc5YHt7t+KTVTLlp7Buk1wscLkj |
527 | ++NTlxl+IjAxRwsWc6PWnyRdAgXxtt2q6llYgFahWM21OyJVLVjbMGVF+oBtFumqq3 |
528 | ++lQy6H6tp/1uJAhwEEwECAAYFAl4XiyMACgkQvwsznGS8qosSiw//QjbWDldB2gHf |
529 | ++3Tfs+LaFdzkDbioWdnj96DiCynTSwZF8d5ISqwA+QTL/43Y0msU26WBMvIRBg2Xm |
530 | +++r4TMMfWF4a1Yjq6cisKEaUsbjV9ztzH/XB2ydo8HgnxZuVKQoIuh1sSrE7p6mpQ |
531 | ++YUrV5eWRpqc79AI9ZzRBM5nhbBejqLVw2F8dyz6c3lfGM9IOenp+Y8N43SdNpBcp |
532 | ++DuHnzbQIMtkyoX7tTKDDv5gnoRNCsdBsCduTyNWYOIEdhRiCfo5Ce7kufIoo4ZqV |
533 | ++BM8dzwm1RrcYa0kMKPZAucJDRjwevEYDbOg7vmEYsuGPRbVmOFdx4uMx4gX8vF5+ |
534 | ++AG3rTSA805zkwD+WQXyYQohVZxNjeK7P/ukr6NCZx226gwAiw1ms7PYOo8snjK8e |
535 | ++nRlMTLKiGiMIH7xJu55JliVlcEvn3G7WO0n4qQOJj3Msh+xflBSfZmzBDAzPgxwC |
536 | ++m/RSmonGV0uZVJFDHCpqus35E6bzFF6yO3yXvpngAMTBrpX6Nzgea1SzlK2Iquls |
537 | ++te1GYAx/IXaY7cVYo4iEv/m346SINzLGHpXZkbbcenSgljBfHLCz7vF33IotfEWh |
538 | ++C7Kb4iKbEjERa+zzqR+vK+nDj6YG9Mvguj1EqnM47oDwgMaqWY6oPfefLCD8Tg51 |
539 | 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F5lmlhKUY5bLkO |
599 | ++TwaxQ7A/TfiJAT4EEwECACgFAlgOYoECGwMFCQQcDQAGCwkIBwMCBhUIAgkKCwQW |
600 | ++AgMBAh4BAheAAAoJEPOHY87f0iVZXTEH/jMRNzzO9JpyK/w3K7m7fAANyXjJE4TV |
601 | ++dsRXvUXZJeLSdaIFPE+TwoDKieBnovZlJm4kLtQii0n/ZP6MQUXC2SvBWr/gTI9P |
602 | ++uGBEX2ceyUM6Lt39EV/Lt6XP/qUVyxOpR/y7pOOdzc6jN7QhcloMPPXRMxZcGKVs |
603 | ++ewH8YhcLx0oRDzSmXRKfmgQLvKFvZUiosCzRbHpm0hlYfuft8jIiitNqDnQvzTyk |
604 | ++58cQ4L85eFJZt3TYyN7rgbRTRb7OqipPAl1fQHzNvfd0MWgrUTKYf8pql+M13HnL |
605 | ++yWKZ977pRWwMw084Hu01YZJmrqcwzS3hPCEubIFI0jjNcd/tkpAYlUk= |
606 | ++=a+Ts |
607 | ++-----END PGP PUBLIC KEY BLOCK----- |
608 | ++" |
609 | ++ |
610 | ++# gpg_verify FILE.asc FILE |
611 | ++gpg_verify() |
612 | ++{ |
613 | ++ local gnupgtmp opts out rc |
614 | ++ opts="--quiet ${q:+--no-secmem-warnin} --batch --no-tty" |
615 | ++ |
616 | ++ # Create temp home dir |
617 | ++ gnupgtmp="$tmpdir/.gnupg.$$.tmp" |
618 | ++ rm -f -r "$gnupgtmp" |
619 | ++ mkdir "$gnupgtmp" || exit 1 |
620 | ++ chmod 0700 "$gnupgtmp" |
621 | ++ |
622 | ++ # Import public key |
623 | ++ "$GPG" $opts --homedir="$gnupgtmp" --import <<EOF |
624 | ++$public_key |
625 | ++EOF |
626 | ++ test $? = 0 || exit 1 |
627 | ++ |
628 | ++ # Verify |
629 | ++ rc=0 |
630 | ++ out=`"$GPG" $opts --homedir="$gnupgtmp" --verify "$1" "$2" </dev/null 2>&1` || rc=1 |
631 | ++ if [ $rc = 0 ]; then |
632 | ++ vecho "$out" |
633 | ++ else |
634 | ++ # print gpg error always |
635 | ++ echo "$out" >&2 |
636 | ++ fi |
637 | ++ |
638 | ++ rm -f -r "$gnupgtmp" |
639 | ++ return $rc |
640 | ++} |
641 | ++ |
642 | ++# mv_all PREFIX OLD NEW |
643 | ++mv_all() |
644 | ++{ |
645 | ++ mv "${1}${2}" "${1}${3}" |
646 | ++ mv "${1}${2}.raw" "${1}${3}.raw" |
647 | ++ mv "${1}${2}.raw.asc" "${1}${3}.raw.asc" |
648 | ++} |
649 | ++ |
650 | + # Parse options |
651 | + smtctl=$SMARTCTL |
652 | + tool= |
653 | + url= |
654 | + q="-q" |
655 | + dryrun= |
656 | ++trunk= |
657 | + cacert= |
658 | + capath= |
659 | + insecure= |
660 | ++no_verify= |
661 | + |
662 | + while true; do case $1 in |
663 | + -s) |
664 | +@@ -237,6 +445,9 @@ while true; do case $1 in |
665 | + --dryrun) |
666 | + dryrun=t ;; |
667 | + |
668 | ++ --trunk) |
669 | ++ trunk=trunk ;; |
670 | ++ |
671 | + --cacert) |
672 | + shift; test -n "$1" || usage |
673 | + cacert=$1 ;; |
674 | +@@ -248,6 +459,15 @@ while true; do case $1 in |
675 | + --insecure) |
676 | + insecure=t ;; |
677 | + |
678 | ++ --no-verify) |
679 | ++ no_verify=t ;; |
680 | ++ |
681 | ++ --export-key) |
682 | ++ cat <<EOF |
683 | ++$public_key |
684 | ++EOF |
685 | ++ exit 0 ;; |
686 | ++ |
687 | + -*) |
688 | + usage ;; |
689 | + |
690 | +@@ -269,7 +489,7 @@ if [ -z "$tool" ]; then |
691 | + break |
692 | + fi |
693 | + done |
694 | +- test -n "$tool" || error "found none of: $os_dltools" |
695 | ++ test -n "$tool" || error "found none of '$os_dltools' in $pathinfo" |
696 | + fi |
697 | + |
698 | + test -n "$url" || selecturl "svn" |
699 | +@@ -291,95 +511,105 @@ case "$tool:$insecure" in |
700 | + lynx:t) warning "'--insecure' is ignored if '-t lynx' is used" ;; |
701 | + esac |
702 | + |
703 | +-# Try possible branch first, then trunk |
704 | +-errmsg= |
705 | +-errmsg2= |
706 | +-for location in "branches/$BRANCH" "trunk"; do |
707 | +- test -z "$errmsg" || errmsg2=$errmsg |
708 | +- vecho "Download from $location with $tool" |
709 | +- |
710 | +- # Adjust URL |
711 | +- case $location in |
712 | +- trunk) src=$url ;; |
713 | +- *) src=`echo "$url" | sed "s,/trunk/,/$location/,"` ;; |
714 | +- esac |
715 | +- |
716 | +- # Download |
717 | +- test -n "$dryrun" || rm -f "$DEST.new" || exit 1 |
718 | +- rc=0 |
719 | +- download "$src" "$DEST.new" || rc=$? |
720 | +- test -z "$dryrun" || continue |
721 | ++# Check for smartctl |
722 | ++if [ "$smtctl" != "-" ]; then |
723 | ++ "$smtctl" -V >/dev/null 2>&1 \ |
724 | ++ || err_notfound "$smtctl" "('-s -' to ignore)" |
725 | ++fi |
726 | + |
727 | +- errmsg= |
728 | +- if [ $rc != 0 ]; then |
729 | +- errmsg="download from $location failed ($tool: exit $rc)" |
730 | +- continue |
731 | +- fi |
732 | ++# Check for GnuPG |
733 | ++if [ -z "$no_verify" ]; then |
734 | ++ test -n "$GPG" \ |
735 | ++ || error "GnuPG is not available ('--no-verify' to ignore)" |
736 | ++ "$GPG" --version >/dev/null 2>&1 \ |
737 | ++ || err_notfound "$GPG" "('--no-verify' to ignore)" |
738 | ++fi |
739 | + |
740 | +- # Check file contents |
741 | +- case `sed 1q "$DEST.new"` in |
742 | +- /*) ;; |
743 | +- \<*) |
744 | +- errmsg="download from $location failed (HTML error message)" |
745 | +- continue ;; |
746 | +- *) |
747 | +- errmsg="download from $location failed (Unknown file contents)" |
748 | +- continue ;; |
749 | +- esac |
750 | ++# Use destination directory as temp directory for gpg |
751 | ++tmpdir=`dirname "$DEST"` |
752 | + |
753 | +- # Check file size |
754 | +- size=`wc -c < "$DEST.new"` |
755 | +- if [ "$size" -lt 10000 ]; then |
756 | +- errmsg="download from $location failed (too small file size $size bytes)" |
757 | +- continue |
758 | +- fi |
759 | +- if [ "$size" -gt 1000000 ]; then |
760 | +- errmsg="download from $location failed (too large file size $size bytes)" |
761 | +- break |
762 | +- fi |
763 | ++# Adjust URLs |
764 | ++src=`echo "$url" | sed -e "s,/trunk/,/branches/$BRANCH/," \ |
765 | ++ -e "s,/master/,/origin/$BRANCH/,"` |
766 | ++src_asc=`echo "$src" | sed "s,/drivedb\.h,/drivedb.h.raw.asc,"` |
767 | ++test -z "$trunk" || src=$url |
768 | + |
769 | +- break |
770 | +-done |
771 | ++# Download |
772 | ++test -n "$dryrun" || rm -f "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc" |
773 | + |
774 | +-test -z "$dryrun" || exit 0 |
775 | ++vecho "Download ${trunk:-branches/$BRANCH}/drivedb.h with $tool" |
776 | ++rc=0 |
777 | ++download "$src" "$DEST.new" || rc=$? |
778 | ++if [ $rc != 0 ]; then |
779 | ++ rm -f "$DEST.new" |
780 | ++ error "${trunk:-$BRANCH}/drivedb.h: download failed ($tool: exit $rc)" |
781 | ++fi |
782 | ++if ! errmsg=`check_file "$DEST.new" '/' 10000 1000000`; then |
783 | ++ mv "$DEST.new" "$DEST.error" |
784 | ++ error "$DEST.error: $errmsg" |
785 | ++fi |
786 | + |
787 | +-if [ -n "$errmsg" ]; then |
788 | ++vecho "Download branches/$BRANCH/drivedb.h.raw.asc with $tool" |
789 | ++rc=0 |
790 | ++download "$src_asc" "$DEST.new.raw.asc" || rc=$? |
791 | ++if [ $rc != 0 ]; then |
792 | ++ rm -f "$DEST.new" "$DEST.new.raw.asc" |
793 | ++ error "$BRANCH/drivedb.h.raw.asc: download failed ($tool: exit $rc)" |
794 | ++fi |
795 | ++if ! errmsg=`check_file "$DEST.new.raw.asc" '-' 200 2000`; then |
796 | + rm -f "$DEST.new" |
797 | +- test -z "$errmsg2" || echo "$myname: $errmsg2" >&2 |
798 | +- error "$errmsg" |
799 | ++ mv "$DEST.new.raw.asc" "$DEST.error.raw.asc" |
800 | ++ error "$DEST.error.raw.asc: $errmsg" |
801 | + fi |
802 | + |
803 | +-# Adjust timestamp and permissions |
804 | +-touch "$DEST.new" |
805 | +-chmod 0644 "$DEST.new" |
806 | ++test -z "$dryrun" || exit 0 |
807 | ++ |
808 | ++# Create raw file with unexpanded SVN Id |
809 | ++# (This assumes newlines are LF and not CR/LF) |
810 | ++unexpand_svn_id < "$DEST.new" > "$DEST.new.raw" |
811 | ++ |
812 | ++# Adjust timestamps and permissions |
813 | ++touch "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc" |
814 | ++chmod 0644 "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc" |
815 | ++ |
816 | ++if [ -z "$no_verify" ]; then |
817 | ++ # Verify raw file |
818 | ++ if ! gpg_verify "$DEST.new.raw.asc" "$DEST.new.raw"; then |
819 | ++ mv_all "$DEST" ".new" ".error" |
820 | ++ test -n "$trunk" || error "$DEST.error.raw: *** BAD signature or outdated key ***" |
821 | ++ error "$DEST.error.raw: signature from branch no longer valid ('--no-verify' to ignore)" |
822 | ++ fi |
823 | ++fi |
824 | + |
825 | + if [ "$smtctl" != "-" ]; then |
826 | + # Check syntax |
827 | +- rm -f "$DEST.error" |
828 | +- if "$smtctl" -B "$DEST.new" -P showall >/dev/null; then |
829 | +- test -n "$q" || echo "$smtctl: syntax OK" |
830 | +- else |
831 | +- mv "$DEST.new" "$DEST.error" |
832 | +- echo "$DEST.error: rejected by $smtctl, probably no longer compatible" >&2 |
833 | +- exit 1 |
834 | ++ if ! "$smtctl" -B "$DEST.new" -P showall >/dev/null; then |
835 | ++ mv_all "$DEST" ".new" ".error" |
836 | ++ error "$DEST.error: rejected by $smtctl, probably no longer compatible" |
837 | + fi |
838 | ++ vecho "$smtctl: syntax OK" |
839 | + fi |
840 | + |
841 | + # Keep old file if identical, ignore missing Id keyword expansion in new file |
842 | + rm -f "$DEST.lastcheck" |
843 | + if [ -f "$DEST" ]; then |
844 | +- if cmp "$DEST" "$DEST.new" >/dev/null 2>/dev/null \ |
845 | +- || cat "$DEST" | sed 's|\$''Id''[^$]*\$|$''Id''$|' \ |
846 | +- | cmp - "$DEST.new" >/dev/null 2>/dev/null; then |
847 | +- rm -f "$DEST.new" |
848 | +- touch "$DEST.lastcheck" |
849 | +- echo "$DEST is already up to date" |
850 | +- exit 0 |
851 | ++ if [ -f "$DEST.raw" ] && [ -f "$DEST.raw.asc" ]; then |
852 | ++ if cmp "$DEST.raw" "$DEST.new.raw" >/dev/null 2>&1 \ |
853 | ++ && cmp "$DEST.raw.asc" "$DEST.new.raw.asc" >/dev/null 2>&1 \ |
854 | ++ && { cmp "$DEST" "$DEST.new" >/dev/null 2>&1 \ |
855 | ++ || cmp "$DEST.raw" "$DEST.new" >/dev/null 2>&1; } |
856 | ++ then |
857 | ++ rm -f "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc" |
858 | ++ touch "$DEST.lastcheck" |
859 | ++ echo "$DEST is already up to date" |
860 | ++ exit 0 |
861 | ++ fi |
862 | ++ mv_all "$DEST" "" ".old" |
863 | ++ else |
864 | ++ mv "$DEST" "$DEST.old" |
865 | + fi |
866 | +- mv "$DEST" "$DEST.old" |
867 | + fi |
868 | + |
869 | +-mv "$DEST.new" "$DEST" |
870 | +- |
871 | +-echo "$DEST updated from $location" |
872 | ++mv_all "$DEST" ".new" "" |
873 | + |
874 | ++echo "$DEST updated from ${trunk:-branches/$BRANCH}${no_verify:+ (NOT VERIFIED)}" |
875 | diff --git a/debian/rules b/debian/rules |
876 | index f3e0d99..fe5da10 100755 |
877 | --- a/debian/rules |
878 | +++ b/debian/rules |
879 | @@ -97,7 +97,6 @@ install: build |
880 | dh_prep |
881 | dh_installdirs |
882 | $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools install |
883 | - rm -f debian/smartmontools/usr/sbin/update-smart-drivedb |
884 | |
885 | # Build architecture-independent files here. |
886 | binary-indep: |
looking at this and the xenial sibling