Merge ~chad.smith/ubuntu/+source/pollinate:ubuntu/trusty-devel into ubuntu/+source/pollinate:ubuntu/trusty-devel
- Git
- lp:~chad.smith/ubuntu/+source/pollinate
- ubuntu/trusty-devel
- Merge into ubuntu/trusty-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Scott Moser | ||||
Approved revision: | fea72054afecce6ded3f6a307a6c58322b8d080b | ||||
Merge reported by: | Scott Moser | ||||
Merged at revision: | fea72054afecce6ded3f6a307a6c58322b8d080b | ||||
Proposed branch: | ~chad.smith/ubuntu/+source/pollinate:ubuntu/trusty-devel | ||||
Merge into: | ubuntu/+source/pollinate:ubuntu/trusty-devel | ||||
Diff against target: |
303 lines (+219/-14) 4 files modified
ChangeLog (+84/-2) debian/changelog (+13/-0) pollinate (+119/-12) pollinate.1 (+3/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Moser (community) | Approve | ||
Review via email: mp+347073@code.launchpad.net |
Commit message
Upstream snapshot of pollinate 4.33 into trusty devel. No packaging behavior changes made.
Description of the change
Scott Moser (smoser) wrote : | # |
Scott Moser (smoser) wrote : | # |
Filed and fixed bug 1774043.
I'm OK with either option here:
a.) new upstream release of 4.33 and upload to cosmic, then SRU that
b.) cherry-pick the patch to debian/patches/ for trusty.
Chad Smith (chad.smith) : | # |
Chad Smith (chad.smith) : | # |
Scott Moser (smoser) wrote : | # |
I always kind of struggle for what a SRU changelog
should look like. If someone is using trusty and is reading changelogs
then they're interested in changes that they see. So the
'include img/build_
as it is covered by 'Add cloud image build info'.
The same is true of 'fix bug on xen....' that never existed in trusty.
Obviously writing such a changelog means different changelogs for
each release we're doing an SRU to, and is generally more complex for
you. But does seem to me at least to provide more value to the user.
An example of a trusty and xenial changelog might be.
* New upstream release (LP: #1761240):
- Add hypervisor to useragent string
- Add cloud image build info and data in /etc/pollinate/
to useragent string.
- Add '--print-
- Speedups when collecting information for user-agent.
- Get logger version via logger -V rather than dpkg query.
- Perform safe read of /proc/uptime
Artful would be the same except for the 'Perform safe read..'
and bionic would have:
- Use systemd-detect-virt if available.
- Fix bug on xen when not booted with systemd.
- Include img/build_
- fea7205... by Chad Smith
-
Import version 4.33-0ubuntu1~
14.04.1 to ubuntu/ trusty- proposed New changelog entries:
* New upstream release (LP: #1761240):
- Add '--print-user-agent' flag.
- Speedups when collecting information for user-agent.
- Add hypervisor to useragent string
- Get logger version via logger -V rather than dpkg query.
- Add cloud image build info and data in /etc/pollinate/add-user- agent
to user-agent string.
- Perform as safe read of /proc/uptime
Scott Moser (smoser) wrote : | # |
I made a small change here, to the changelog, just to clean up english:
- - Perform as safe read of /proc/uptime
+ - Perform a safe read of /proc/uptime
And then uploaded and changed trusty-updates to just trusty.
Scott Moser (smoser) wrote : | # |
marking merged as uploaded to queue.
Preview Diff
1 | diff --git a/ChangeLog b/ChangeLog | |||
2 | index b0fe4c3..40a1039 100644 | |||
3 | --- a/ChangeLog | |||
4 | +++ b/ChangeLog | |||
5 | @@ -1,4 +1,86 @@ | |||
7 | 1 | pollinate (4.25) released; urgency=medium | 1 | pollinate (4.33) released; urgency=medium |
8 | 2 | |||
9 | 3 | * pollinate: fix bug on xen when not booted with systemd. user-agent | ||
10 | 4 | would contain virt/virt/xen rather than virt/xen. (LP: #1774043) | ||
11 | 5 | * pollinate: use systemd-detect-virt if available rather than detecting | ||
12 | 6 | its availability based on /run/systemd. | ||
13 | 7 | |||
14 | 8 | -- Scott Moser <smoser@ubuntu.com> Fri, 25 May 2018 12:30:15 -0400 | ||
15 | 9 | |||
16 | 10 | pollinate (4.32-0ubuntu1) cosmic; urgency=medium | ||
17 | 11 | |||
18 | 12 | * pollinate: include img/build_name/server in user-agent. | ||
19 | 13 | |||
20 | 14 | -- Scott Moser <smoser@ubuntu.com> Fri, 25 May 2018 12:30:06 -0400 | ||
21 | 15 | |||
22 | 16 | pollinate (4.31-0ubuntu1) bionic; urgency=medium | ||
23 | 17 | |||
24 | 18 | [ Scott Moser ] | ||
25 | 19 | * pollinate: add '--print-user-agent' flag. | ||
26 | 20 | * pollinate: Speedups when collecting information for user-agent. | ||
27 | 21 | |||
28 | 22 | -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 14 Feb 2018 11:01:18 -0600 | ||
29 | 23 | |||
30 | 24 | pollinate (4.30-0ubuntu1) bionic; urgency=medium | ||
31 | 25 | |||
32 | 26 | * debian/pollinate.postinst: | ||
33 | 27 | - don't try to chown a dir to the user, potentially before the user exists | ||
34 | 28 | |||
35 | 29 | -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 31 Jan 2018 07:24:33 -0600 | ||
36 | 30 | |||
37 | 31 | pollinate (4.29-0ubuntu1) bionic; urgency=medium | ||
38 | 32 | |||
39 | 33 | * No change rebuild, release error in 4.28 | ||
40 | 34 | |||
41 | 35 | -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 30 Jan 2018 16:41:13 -0600 | ||
42 | 36 | |||
43 | 37 | pollinate (4.28-0ubuntu1) bionic; urgency=medium | ||
44 | 38 | |||
45 | 39 | [ Dustin Kirkland ] | ||
46 | 40 | * pollinate: | ||
47 | 41 | - add hypervisor to useragent string | ||
48 | 42 | * debian/pollinate.postinst: | ||
49 | 43 | - ensure that the pollinate user owns /var/cache/pollinate; | ||
50 | 44 | to be safe, we're going to do this just after the mkdir, and | ||
51 | 45 | after the adduser; | ||
52 | 46 | this avoids the warning: | ||
53 | 47 | + adduser: Warning: The home directory /var/cache/pollinate | ||
54 | 48 | does not belong to the user you are currently creating. | ||
55 | 49 | |||
56 | 50 | [ Steve Langasek ] | ||
57 | 51 | * Minor enhancements to pollinate runtime: | ||
58 | 52 | - dpkg | awk is unnecessary, dpkg-query --showformat does this | ||
59 | 53 | * dpkg -l is a fairly heavyweight operation (.1s); ask logger directly | ||
60 | 54 | what its version number is (.01s) | ||
61 | 55 | |||
62 | 56 | [ Scott Moser ] | ||
63 | 57 | * pollinate: | ||
64 | 58 | - Add cloud image build info and data in /etc/pollinate/add-user-agent. | ||
65 | 59 | - Use systemd-detect-virt and namespace virt/<type> in useragent | ||
66 | 60 | |||
67 | 61 | -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 30 Jan 2018 16:31:24 -0600 | ||
68 | 62 | |||
69 | 63 | pollinate (4.27-0ubuntu1) artful; urgency=medium | ||
70 | 64 | |||
71 | 65 | * Fixup maintscript & version missmatch from the previous upload. | ||
72 | 66 | |||
73 | 67 | -- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 18 Aug 2017 13:13:16 +0100 | ||
74 | 68 | |||
75 | 69 | pollinate (4.26-0ubuntu1) artful; urgency=medium | ||
76 | 70 | |||
77 | 71 | [ Scott Moser ] | ||
78 | 72 | * Perform as safe read of /proc/uptime LP: #1708461 | ||
79 | 73 | |||
80 | 74 | [ Dimitri John Ledkov ] | ||
81 | 75 | * Drop upstart system job | ||
82 | 76 | * Drop no longer needed build-deps, and redundantly specified essential | ||
83 | 77 | bsdutils | ||
84 | 78 | * Fix spelling typo in the description | ||
85 | 79 | * Bump debhelper compat to 9, previous levels are deprecated | ||
86 | 80 | |||
87 | 81 | -- Dustin Kirkland <kirkland@ubuntu.com> Sat, 14 Jan 2017 08:45:46 +0100 | ||
88 | 82 | |||
89 | 83 | pollinate (4.25-0ubuntu1) zesty; urgency=medium | ||
90 | 2 | 84 | ||
91 | 3 | [ Stefano Rivera ] | 85 | [ Stefano Rivera ] |
92 | 4 | * debian/control: Add missing dependency on xxd. (LP: #1656484) | 86 | * debian/control: Add missing dependency on xxd. (LP: #1656484) |
93 | @@ -6,7 +88,7 @@ pollinate (4.25) released; urgency=medium | |||
94 | 6 | [ Dustin Kirkland ] | 88 | [ Dustin Kirkland ] |
95 | 7 | * debian/control: xxd is provided by vim-common in older Ubuntu releases | 89 | * debian/control: xxd is provided by vim-common in older Ubuntu releases |
96 | 8 | 90 | ||
98 | 9 | -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 02 Nov 2016 14:47:01 +0200 | 91 | -- Dustin Kirkland <kirkland@ubuntu.com> Sat, 14 Jan 2017 08:45:44 +0100 |
99 | 10 | 92 | ||
100 | 11 | pollinate (4.24-0ubuntu1) zesty; urgency=medium | 93 | pollinate (4.24-0ubuntu1) zesty; urgency=medium |
101 | 12 | 94 | ||
102 | diff --git a/debian/changelog b/debian/changelog | |||
103 | index 48eb078..0220678 100644 | |||
104 | --- a/debian/changelog | |||
105 | +++ b/debian/changelog | |||
106 | @@ -1,3 +1,16 @@ | |||
107 | 1 | pollinate (4.33-0ubuntu1~14.04.1) trusty-updates; urgency=medium | ||
108 | 2 | |||
109 | 3 | * New upstream release (LP: #1761240): | ||
110 | 4 | - Add '--print-user-agent' flag. | ||
111 | 5 | - Speedups when collecting information for user-agent. | ||
112 | 6 | - Add hypervisor to useragent string | ||
113 | 7 | - Get logger version via logger -V rather than dpkg query. | ||
114 | 8 | - Add cloud image build info and data in /etc/pollinate/add-user-agent | ||
115 | 9 | to user-agent string. | ||
116 | 10 | - Perform as safe read of /proc/uptime | ||
117 | 11 | |||
118 | 12 | -- Chad Smith <chad.smith@canonical.com> Wed, 30 May 2018 10:22:11 -0600 | ||
119 | 13 | |||
120 | 1 | pollinate (4.25-0ubuntu1~14.04.1) trusty; urgency=medium | 14 | pollinate (4.25-0ubuntu1~14.04.1) trusty; urgency=medium |
121 | 2 | 15 | ||
122 | 3 | * New upstream release (LP: #1708192): | 16 | * New upstream release (LP: #1708192): |
123 | diff --git a/pollinate b/pollinate | |||
124 | index a69cd9f..4a4cbbd 100755 | |||
125 | --- a/pollinate | |||
126 | +++ b/pollinate | |||
127 | @@ -17,6 +17,7 @@ | |||
128 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
129 | 18 | 18 | ||
130 | 19 | set -e | 19 | set -e |
131 | 20 | set -f | ||
132 | 20 | 21 | ||
133 | 21 | PKG="pollinate" | 22 | PKG="pollinate" |
134 | 22 | TMPDIR=$(mktemp -d -t "${PKG}.XXXXXXXXXXXX") | 23 | TMPDIR=$(mktemp -d -t "${PKG}.XXXXXXXXXXXX") |
135 | @@ -28,8 +29,8 @@ HOSTNAME=$(hostname) | |||
136 | 28 | STRICT=0 | 29 | STRICT=0 |
137 | 29 | 30 | ||
138 | 30 | # Only recent logger version supports --id=[ID] | 31 | # Only recent logger version supports --id=[ID] |
141 | 31 | logger_ver=$(dpkg -l bsdutils | tail -n1 | awk '{print $3}') | 32 | logger_ver=$(logger -V 2>&1 | awk '{print $4}') |
142 | 32 | dpkg --compare-versions $logger_ver ge 1:2.26.2 && LOGGER="logger --id=$$" || LOGGER="logger" | 33 | dpkg --compare-versions $logger_ver ge 2.26.2 && LOGGER="logger --id=$$" || LOGGER="logger" |
143 | 33 | # Log to both syslog, and stderr, if we're on an interactive terminal | 34 | # Log to both syslog, and stderr, if we're on an interactive terminal |
144 | 34 | [ -t 0 ] && LOGGER="$LOGGER -s" | 35 | [ -t 0 ] && LOGGER="$LOGGER -s" |
145 | 35 | 36 | ||
146 | @@ -88,20 +89,121 @@ hash_and_write() { | |||
147 | 88 | log "client hashed response from [${1}]" | 89 | log "client hashed response from [${1}]" |
148 | 89 | } | 90 | } |
149 | 90 | 91 | ||
150 | 92 | read_build_info() { | ||
151 | 93 | # ubuntu images place build information in /etc/cloud/build.info | ||
152 | 94 | # format of file is '<key>: <value>' put these under img/<key>/<value> | ||
153 | 95 | local bifile="${1:-/etc/cloud/build.info}" ret="" | ||
154 | 96 | _RET="" | ||
155 | 97 | [ -s "$bifile" ] || return 0 | ||
156 | 98 | ret=$(awk '{ | ||
157 | 99 | gsub(/#.*/, ""); gsub(/\s+$/, ""); | ||
158 | 100 | if ($0 == "" || $0 !~ /:/) next; | ||
159 | 101 | gsub(/:\s*/, "/"); | ||
160 | 102 | printf("img/%s ", $0) }' "$bifile") || return | ||
161 | 103 | _RET="${ret% }" | ||
162 | 104 | } | ||
163 | 105 | |||
164 | 106 | read_addl_info() { | ||
165 | 107 | # allow additinal info file to contain entries one per line. lines must | ||
166 | 108 | # have a '/' in them. remove trailing space and '#' as comment. example: | ||
167 | 109 | # key/value | ||
168 | 110 | # fookey/foovalue # written by foo | ||
169 | 111 | local aifile="${1:-/etc/pollinate/add-user-agent}" ret="" | ||
170 | 112 | _RET="" | ||
171 | 113 | [ -s "$aifile" ] || return 0 | ||
172 | 114 | ret=$(awk '{ | ||
173 | 115 | gsub(/#.*/, ""); gsub(/\s+$/, ""); | ||
174 | 116 | if ($0 == "" || $0 !~ /\//) next; | ||
175 | 117 | printf("%s ", $0); }' "$aifile") || return | ||
176 | 118 | _RET=${ret% } | ||
177 | 119 | } | ||
178 | 120 | |||
179 | 121 | read_virt() { | ||
180 | 122 | # return virt/<value> where value is the virtualization platform the | ||
181 | 123 | # system is running on. | ||
182 | 124 | local ret="" | ||
183 | 125 | _RET="" | ||
184 | 126 | if command -v systemd-detect-virt >/dev/null; then | ||
185 | 127 | ret=$(systemd-detect-virt) | ||
186 | 128 | # systemd-detect-virt returns 1 for 'none' | ||
187 | 129 | [ $? -eq 0 -o "$ret" = "none" ] || ret="" | ||
188 | 130 | else | ||
189 | 131 | # trusty would take this path. | ||
190 | 132 | if [ -d /dev/xen ]; then | ||
191 | 133 | ret="xen" | ||
192 | 134 | elif [ -d /dev/lxd ]; then | ||
193 | 135 | # call this 'lxc' for consistency with systemd-detect-virt. | ||
194 | 136 | ret="lxc" | ||
195 | 137 | elif dmesg | grep --quiet " kvm-clock:"; then | ||
196 | 138 | ret="kvm" | ||
197 | 139 | fi | ||
198 | 140 | fi | ||
199 | 141 | [ -n "$ret" ] || return | ||
200 | 142 | _RET="virt/$ret" | ||
201 | 143 | } | ||
202 | 144 | |||
203 | 145 | read_package_versions() { | ||
204 | 146 | local pkgs="pollinate curl cloud-init" data="" p="" | ||
205 | 147 | data=$(dpkg-query \ | ||
206 | 148 | -W --showformat='${Package}/${Version} ' $pkgs 2>/dev/null) || : | ||
207 | 149 | # fill in 'package/' for any package not installed. | ||
208 | 150 | for p in ${pkgs}; do | ||
209 | 151 | [ "${data#*$p/}" = "$data" ] && data="${data} $p/" | ||
210 | 152 | done | ||
211 | 153 | if [ -n "$TESTING" ]; then | ||
212 | 154 | p="pollinate" | ||
213 | 155 | data="${data%%$p/*}$p${TESTING}/${data#*$p/}" | ||
214 | 156 | fi | ||
215 | 157 | set -- $data | ||
216 | 158 | _RET="$*" | ||
217 | 159 | } | ||
218 | 160 | |||
219 | 161 | read_uname_info() { | ||
220 | 162 | # taken from cloud-init ds-identify. | ||
221 | 163 | # run uname, and parse output. | ||
222 | 164 | # uname is tricky to parse as it outputs always in a given order | ||
223 | 165 | # independent of option order. kernel-version is known to have spaces. | ||
224 | 166 | # 1 -s kernel-name | ||
225 | 167 | # 2 -n nodename | ||
226 | 168 | # 3 -r kernel-release | ||
227 | 169 | # 4.. -v kernel-version(whitespace) | ||
228 | 170 | # N-2 -m machine | ||
229 | 171 | # N-1 -o operating-system | ||
230 | 172 | local out="" krel="" machine="" os="" | ||
231 | 173 | out=$(uname -snrvmo) || { _RET=""; return; } | ||
232 | 174 | set -- $out | ||
233 | 175 | krel="$3" | ||
234 | 176 | shift 3 | ||
235 | 177 | while [ $# -gt 2 ]; do | ||
236 | 178 | shift | ||
237 | 179 | done | ||
238 | 180 | machine=$1 | ||
239 | 181 | os=$2 | ||
240 | 182 | _RET="$os/$krel/$machine" | ||
241 | 183 | return 0 | ||
242 | 184 | } | ||
243 | 185 | |||
244 | 91 | user_agent() { | 186 | user_agent() { |
245 | 92 | # Construct a user agent, with useful debug information | 187 | # Construct a user agent, with useful debug information |
246 | 93 | # Very similar to Firefox and Chrome | 188 | # Very similar to Firefox and Chrome |
250 | 94 | local pollinate_ver="$(dpkg -l pollinate | awk '$1 == "ii" { print($3); exit(0); }')" | 189 | |
248 | 95 | local curl_ver="$(dpkg -l curl | awk '$1 == "ii" { print($3); exit(0); }')" | ||
249 | 96 | local cloud_init_ver="$(dpkg -l cloud-init 2>/dev/null | awk '$1 == "ii" { print($3); exit(0); }')" | ||
251 | 97 | . /etc/lsb-release | 190 | . /etc/lsb-release |
259 | 98 | local lsb=$(echo "${DISTRIB_DESCRIPTION}" | sed -e "s/ /\//g") | 191 | |
260 | 99 | local platform="$(uname -o)/$(uname -r)/$(uname -m)" | 192 | local pkg_info="" lsb="" platform="" cpu="" up="NA" idle="NA" uptime |
261 | 100 | local cpu="$(grep -m1 "^model name" /proc/cpuinfo | sed -e "s/.*: //" -e "s:\s\+:/:g")" | 193 | read_package_versions && pkg_info="$_RET" |
262 | 101 | local up idle | 194 | read_uname_info && platform="$_RET" |
263 | 102 | read up idle < /proc/uptime | 195 | |
264 | 103 | local uptime="uptime/$up/$idle" | 196 | lsb=$(echo "${DISTRIB_DESCRIPTION}" | sed -e "s/ /\//g") |
265 | 104 | USER_AGENT="pollinate${TESTING}/${pollinate_ver} curl/${curl_ver} cloud-init/${cloud_init_ver} ${lsb} ${platform} ${cpu} ${uptime}" | 197 | cpu="$(grep -m1 "^model name" /proc/cpuinfo | sed -e "s/.*: //" -e "s:\s\+:/:g")" |
266 | 198 | { read up idle < /proc/uptime ; } >/dev/null 2>&1 || : | ||
267 | 199 | uptime="uptime/$up/$idle" | ||
268 | 200 | |||
269 | 201 | local addl_data="" build_info="" virt="" | ||
270 | 202 | read_build_info && build_info="${_RET}" | ||
271 | 203 | read_addl_info && addl_data="${_RET}" | ||
272 | 204 | read_virt && virt="${_RET}" | ||
273 | 205 | |||
274 | 206 | USER_AGENT="${pkg_info} ${lsb} ${platform} ${cpu} ${uptime}${virt:+ ${virt}}${build_info:+ ${build_info}}${addl_data:+ ${addl_data}}" | ||
275 | 105 | } | 207 | } |
276 | 106 | 208 | ||
277 | 107 | exchange() { | 209 | exchange() { |
278 | @@ -203,6 +305,11 @@ while [ ! -z "$1" ]; do | |||
279 | 203 | WAIT="$2" | 305 | WAIT="$2" |
280 | 204 | shift 2 | 306 | shift 2 |
281 | 205 | ;; | 307 | ;; |
282 | 308 | --print-user-agent) | ||
283 | 309 | user_agent || error "Failed to get user-agent." | ||
284 | 310 | echo "${USER_AGENT}" | ||
285 | 311 | exit | ||
286 | 312 | ;; | ||
287 | 206 | *) | 313 | *) |
288 | 207 | error "Unknown options [$1]" | 314 | error "Unknown options [$1]" |
289 | 208 | ;; | 315 | ;; |
290 | diff --git a/pollinate.1 b/pollinate.1 | |||
291 | index f7890ee..8e2b9ce 100644 | |||
292 | --- a/pollinate.1 | |||
293 | +++ b/pollinate.1 | |||
294 | @@ -45,6 +45,9 @@ silence any log messages | |||
295 | 45 | .TP | 45 | .TP |
296 | 46 | \fB-w|--wait\fP WAIT | 46 | \fB-w|--wait\fP WAIT |
297 | 47 | time in seconds you're willing to wait for a response from the server, uses \fBtimeout\fP(1) | 47 | time in seconds you're willing to wait for a response from the server, uses \fBtimeout\fP(1) |
298 | 48 | .TP | ||
299 | 49 | \fB --print-user-agent\fP | ||
300 | 50 | Print the user-agent that is used and exit immediately. | ||
301 | 48 | 51 | ||
302 | 49 | .SH SEE ALSO | 52 | .SH SEE ALSO |
303 | 50 | \fBpollen\fP(8), \fBtimeout\fP(1) | 53 | \fBpollen\fP(8), \fBtimeout\fP(1) |
We're missing the ChangeLog changes that came from upstream.
Then, for the debian/changelog new entries i had a comment below. Yours is fine for sure.