Merge lp:~andreserl/maas/packaging_quantal_slangasek_backport into lp:~maas-maintainers/maas/packaging.quantal

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 166
Proposed branch: lp:~andreserl/maas/packaging_quantal_slangasek_backport
Merge into: lp:~maas-maintainers/maas/packaging.quantal
Diff against target: 461 lines (+83/-123)
15 files modified
debian/changelog (+28/-1)
debian/maas-cluster-controller.config (+4/-4)
debian/maas-cluster-controller.postinst (+4/-3)
debian/maas-cluster-controller.postrm (+2/-9)
debian/maas-cluster-controller.prerm (+0/-10)
debian/maas-common.postinst (+6/-14)
debian/maas-common.postrm (+1/-0)
debian/maas-dhcp.postinst (+6/-13)
debian/maas-dhcp.postrm (+5/-3)
debian/maas-dns.postinst (+6/-7)
debian/maas-dns.postrm (+3/-4)
debian/maas-region-controller.config (+6/-6)
debian/maas-region-controller.postinst (+11/-38)
debian/maas-region-controller.postrm (+0/-4)
debian/maas-region-controller.prerm (+1/-7)
To merge this branch: bzr merge lp:~andreserl/maas/packaging_quantal_slangasek_backport
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+154450@code.launchpad.net

Commit message

Backport slangasek fixes to packaging (rev 169)

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Approving mysql.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-03-08 23:09:22 +0000
3+++ debian/changelog 2013-03-20 17:45:26 +0000
4@@ -1,4 +1,4 @@
5-maas (1.2+bzr1372+dfsg-0ubuntu1) quantal-proposed; urgency=low
6+maas (1.2+bzr1373+dfsg-0ubuntu1) UNRELEASED; urgency=low
7
8 * MAAS Stable Release Update (LP: #1109283):
9 This SRU brings a new upstream release of MAAS that removes
10@@ -7,6 +7,33 @@
11 Board to proceed. More information can be found in:
12 https://lists.ubuntu.com/archives/ubuntu-devel-announce/2013-February/001012.html
13
14+ [ Steve Langasek ]
15+ * postinst scripts are never called with 'reconfigure' as the script
16+ argument. Remove references to this (mythical) invocation.
17+ * always call 'set -e' from maintainer scripts instead of passing 'sh -e'
18+ as the interpreter, so that scripts will behave correctly when run via
19+ 'sh -x'.
20+ * invoke-rc.d is never allowed to not exist - simplify scripts (and make
21+ them better policy-compliant) by invoking unconditionally. (The only
22+ possible exception is in the postrm, where it's *theoretically* possible
23+ for invoke-rc.d to be missing if the user has completely stripped
24+ down their system; that's a fairly unreasonable corner case, but we
25+ might as well be correct if it ever happens.)
26+ * db_get+db_set is a no-op; don't call db_set to push back a value we just
27+ got from db_get.
28+ * Omit superfluous calls to 'exit 0' at the end of each script.
29+ * Remove maas-cluster-controller prerm script, which called debconf for no
30+ reason.
31+ * Don't invoke debconf in the postrm script either, debhelper already does
32+ this for us.
33+ * Other miscellaneous maintainer script fixes
34+ * debian/maas-common.postinst: call adduser and addgroup unconditionally;
35+ the tools are already designed to DTRT, we don't need to check for the
36+ user/group existence before calling them nor should we worry about
37+ calling them only once on first install.
38+ * debian/maas-common.postrm: delete the maas group, not just the user,
39+ as the comment in the code implies we should do.
40+
41 -- Andres Rodriguez <andreserl@ubuntu.com> Thu, 07 Mar 2013 14:22:35 -0500
42
43 maas (1.2+bzr1370+dfsg-0ubuntu1) raring; urgency=low
44
45=== modified file 'debian/maas-cluster-controller.config'
46--- debian/maas-cluster-controller.config 2012-11-13 20:40:35 +0000
47+++ debian/maas-cluster-controller.config 2013-03-20 17:45:26 +0000
48@@ -1,4 +1,6 @@
49-#!/bin/sh -e
50+#!/bin/sh
51+
52+set -e
53
54 . /usr/share/debconf/confmodule
55 db_version 2.0
56@@ -8,9 +10,7 @@
57 if ([ "$1" = "configure" ] && [ -z "$2" ]); then
58
59 db_get maas-cluster-controller/maas-url || true
60- if [ -n "$RET" ]; then
61- db_set maas-cluster-controller/maas-url "$RET"
62- else
63+ if [ -z "$RET" ]; then
64 # Attempt to pre-populate if installing on the region controller.
65 if [ -e /etc/maas/maas_local_settings.py ]; then
66 url=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"\"")} END{print array[2] }' /etc/maas/maas_local_settings.py)
67
68=== modified file 'debian/maas-cluster-controller.postinst'
69--- debian/maas-cluster-controller.postinst 2012-12-13 11:00:54 +0000
70+++ debian/maas-cluster-controller.postinst 2013-03-20 17:45:26 +0000
71@@ -1,4 +1,6 @@
72-#!/bin/sh -e
73+#!/bin/sh
74+
75+set -e
76
77 . /usr/share/debconf/confmodule
78 db_version 2.0
79@@ -72,7 +74,7 @@
80 configure_maas_tgt
81 fi
82
83-if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
84+if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ -n "$DEBCONF_RECONFIGURE" ]; then
85
86 if dpkg --compare-versions "$2" lt 0.1+bzr1239+dfsg-0ubuntu1; then
87 create_log_dir
88@@ -104,4 +106,3 @@
89 fi
90
91 #DEBHELPER#
92-exit 0
93
94=== modified file 'debian/maas-cluster-controller.postrm'
95--- debian/maas-cluster-controller.postrm 2012-11-20 22:13:28 +0000
96+++ debian/maas-cluster-controller.postrm 2013-03-20 17:45:26 +0000
97@@ -2,15 +2,12 @@
98
99 set -e
100
101-. /usr/share/debconf/confmodule
102-db_version 2.0
103+#DEBHELPER#
104
105 case "$1" in
106 purge)
107 # remove log directory
108- if [ -d /var/log/maas ]; then
109- rm -rf /var/log/maas
110- fi
111+ rm -rf /var/log/maas
112 # remove var directory
113 rm -rf /var/lib/maas/celerybeat-cluster-schedule
114 DIR=/var/lib/maas
115@@ -24,7 +21,3 @@
116 fi
117
118 esac
119-
120-#DEBHELPER#
121-
122-exit 0
123
124=== removed file 'debian/maas-cluster-controller.prerm'
125--- debian/maas-cluster-controller.prerm 2012-10-08 17:16:30 +0000
126+++ debian/maas-cluster-controller.prerm 1970-01-01 00:00:00 +0000
127@@ -1,10 +0,0 @@
128-#!/bin/sh
129-
130-set -e
131-
132-. /usr/share/debconf/confmodule
133-db_version 2.0
134-
135-#DEBHELPER#
136-
137-exit 0
138
139=== modified file 'debian/maas-common.postinst'
140--- debian/maas-common.postinst 2012-10-11 18:16:28 +0000
141+++ debian/maas-common.postinst 2013-03-20 17:45:26 +0000
142@@ -1,22 +1,14 @@
143-#!/bin/sh -e
144+#!/bin/sh
145+
146+set -e
147
148 add_user_group(){
149 local user="maas"
150 local group="maas"
151- if ! getent group "$group" >/dev/null; then
152- addgroup --quiet --system "$group" || true
153- fi
154- if ! getent passwd "$user" > /dev/null 2>&1; then
155- adduser --quiet \
156- --system \
157- --group \
158- --no-create-home \
159- "$user" || true
160- fi
161+ addgroup --quiet --system "$group" || true
162+ adduser --quiet --system --group --no-create-home "$user" || true
163 }
164
165-if [ "$1" = "configure" ]; then
166- add_user_group
167-fi
168+add_user_group
169
170 #DEBHELPER#
171
172=== modified file 'debian/maas-common.postrm'
173--- debian/maas-common.postrm 2012-10-11 18:16:28 +0000
174+++ debian/maas-common.postrm 2013-03-20 17:45:26 +0000
175@@ -7,6 +7,7 @@
176 # Deleting user/group
177 if getent passwd maas >/dev/null; then
178 deluser maas || true
179+ delgroup maas || true
180 fi
181 esac
182
183
184=== modified file 'debian/maas-dhcp.postinst'
185--- debian/maas-dhcp.postinst 2012-10-02 18:42:28 +0000
186+++ debian/maas-dhcp.postinst 2013-03-20 17:45:26 +0000
187@@ -1,22 +1,15 @@
188-#!/bin/sh -e
189-
190-. /usr/share/debconf/confmodule
191-db_version 2.0
192-
193-stop_isc_dhcp_server(){
194- invoke-rc.d isc-dhcp-server stop
195-}
196-
197+#!/bin/sh
198+
199+set -e
200
201 if [ "$1" = "configure" ]; then
202- stop_isc_dhcp_server
203+ invoke-rc.d isc-dhcp-server stop
204
205 dhcpd_prof="/etc/apparmor.d/usr.sbin.dhcpd"
206- if [ -f "${dhcpd_prof}" ] &&
207- command -v apparmor_parser >/dev/null 2>&1; then
208+ if [ -f "${dhcpd_prof}" ] && command -v apparmor_parser >/dev/null 2>&1
209+ then
210 apparmor_parser --replace --write-cache --skip-read-cache "${dhcpd_prof}"
211 fi
212 fi
213
214 #DEBHELPER#
215-exit 0
216
217=== modified file 'debian/maas-dhcp.postrm'
218--- debian/maas-dhcp.postrm 2012-09-14 18:06:57 +0000
219+++ debian/maas-dhcp.postrm 2013-03-20 17:45:26 +0000
220@@ -1,6 +1,8 @@
221-#!/bin/sh -e
222-
223-if [ "$1" = "remove" -o "$1" = "purge" ]; then
224+#!/bin/sh
225+
226+set -e
227+
228+if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
229 dhcpd_prof="/etc/apparmor.d/usr.sbin.dhcpd"
230 if [ -f "${dhcpd_prof}" ] &&
231 command -v apparmor_parser >/dev/null 2>&1; then
232
233=== modified file 'debian/maas-dns.postinst'
234--- debian/maas-dns.postinst 2012-12-04 16:16:39 +0000
235+++ debian/maas-dns.postinst 2013-03-20 17:45:26 +0000
236@@ -1,6 +1,8 @@
237-#!/bin/sh -e
238-
239-if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
240+#!/bin/sh
241+
242+set -e
243+
244+if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ -n "$DEBCONF_RECONFIGURE" ]; then
245 # If /etc/bind/maas is empty, set_up_dns.
246 if [ ! "$(ls -A /etc/bind/maas)" ]; then
247 maas set_up_dns
248@@ -28,10 +30,7 @@
249
250 maas write_dns_config
251
252- if [ -x /usr/sbin/invoke-rc.d ]; then
253- invoke-rc.d bind9 restart || true
254- fi
255+ invoke-rc.d bind9 restart || true
256 fi
257
258 #DEBHELPER#
259-exit 0
260
261=== modified file 'debian/maas-dns.postrm'
262--- debian/maas-dns.postrm 2012-08-10 23:50:38 +0000
263+++ debian/maas-dns.postrm 2013-03-20 17:45:26 +0000
264@@ -1,4 +1,6 @@
265-#!/bin/sh -e
266+#!/bin/sh
267+
268+set -e
269
270 if [ "$1" = "remove" ]; then
271 if [ -f /etc/bind/named.conf.local ]; then
272@@ -19,6 +21,3 @@
273 fi
274
275 #DEBHELPER#
276-
277-exit 0
278-
279
280=== modified file 'debian/maas-region-controller.config'
281--- debian/maas-region-controller.config 2012-10-11 18:50:41 +0000
282+++ debian/maas-region-controller.config 2013-03-20 17:45:26 +0000
283@@ -1,4 +1,6 @@
284-#!/bin/sh -e
285+#!/bin/sh
286+
287+set -e
288
289 . /usr/share/debconf/confmodule
290 db_version 2.0
291@@ -21,7 +23,7 @@
292 . /usr/share/dbconfig-common/dpkg/config.pgsql
293 fi
294
295-if ([ "$1" = "configure" ] && [ -z "$2" ]); then
296+if [ "$1" = "configure" ] && [ -z "$2" ]; then
297 # Hide maas/dbconfig-install question by setting default.
298 set_question maas-region-controller/dbconfig-install true
299 set_question maas-region-controller/pgsql/app-pass ""
300@@ -32,11 +34,9 @@
301
302 dbc_go maas-region-controller $@
303
304-elif [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
305+elif [ -n "$DEBCONF_RECONFIGURE" ]; then
306 db_get maas/default-maas-url || true
307- if [ -n "$RET" ]; then
308- db_set maas/default-maas-url "$RET"
309- else
310+ if [ -z "$RET" ]; then
311 ipaddr=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"/")} END{print array[3] }' /etc/maas/maas_local_settings.py)
312 db_set maas/default-maas-url "$ipaddr"
313 fi
314
315=== modified file 'debian/maas-region-controller.postinst'
316--- debian/maas-region-controller.postinst 2012-11-20 22:13:28 +0000
317+++ debian/maas-region-controller.postinst 2013-03-20 17:45:26 +0000
318@@ -1,4 +1,6 @@
319-#!/bin/sh -e
320+#!/bin/sh
321+
322+set -e
323
324 . /usr/share/debconf/confmodule
325 db_version 2.0
326@@ -13,36 +15,16 @@
327 maas migrate metadataserver --noinput
328 }
329
330-restart_apache2(){
331- if [ -x /usr/sbin/invoke-rc.d ]; then
332- invoke-rc.d apache2 restart || true
333- else
334- /etc/init.d/apache2 restart || true
335- fi
336-}
337-
338 restart_rabbitmq(){
339- if [ -x /usr/sbin/invoke-rc.d ]; then
340- invoke-rc.d rabbitmq-server restart || true
341- else
342- /etc/init.d/rabbitmq-server restart || true
343- fi
344+ invoke-rc.d rabbitmq-server restart || true
345 }
346
347 restart_postgresql(){
348- if [ -x /usr/sbin/invoke-rc.d ]; then
349- invoke-rc.d --force postgresql restart || true
350- else
351- /etc/init.d/postgresql restart || true
352- fi
353+ invoke-rc.d --force postgresql restart || true
354 }
355
356 restart_squid_deb_proxy() {
357- if [ -x /usr/sbin/invoke-rc.d ]; then
358- invoke-rc.d squid-deb-proxy restart || true
359- else
360- /etc/init.d/squid-deb-proxy restart || true
361- fi
362+ invoke-rc.d squid-deb-proxy restart || true
363 }
364
365 configure_maas_txlongpoll_rabbitmq_user() {
366@@ -191,17 +173,13 @@
367 mkdir -p /var/log/maas/rsyslog
368 chown -R syslog:syslog /var/log/maas/rsyslog
369 # Make sure rsyslog reads our config
370- if [ -x /usr/sbin/invoke-rc.d ]; then
371- invoke-rc.d rsyslog restart
372- fi
373+ invoke-rc.d rsyslog restart
374
375 #########################################################
376 ################### Squid-deb-proxy ####################
377 #########################################################
378 # Make sure squid-deb-proxy reads our config (99-maas)
379- if [ -x /usr/sbin/invoke-rc.d ]; then
380- invoke-rc.d squid-deb-proxy restart
381- fi
382+ invoke-rc.d squid-deb-proxy restart
383
384 #########################################################
385 ########## Configure longpoll rabbitmq config ###########
386@@ -239,11 +217,10 @@
387 db_input high maas/installation-note || true
388 db_go
389
390-elif [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
391+elif [ -n "$DEBCONF_RECONFIGURE" ]; then
392 # Set the IP address of the interface with default route
393 db_get maas/default-maas-url
394 ipaddr="$RET"
395- db_set maas/default-maas-url "$ipaddr"
396 if [ -n "$ipaddr" ]; then
397 configure_maas_default_url "$ipaddr"
398 configure_maas_squid_deb_proxy "$ipaddr"
399@@ -252,9 +229,7 @@
400
401 elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
402 # If upgrading to any later package version, then upgrade db.
403- if [ -x /usr/sbin/invoke-rc.d ]; then
404- invoke-rc.d apache2 stop || true
405- fi
406+ invoke-rc.d apache2 stop || true
407
408 # make sure postgresql is running
409 restart_postgresql
410@@ -284,12 +259,10 @@
411
412 fi
413
414-restart_apache2
415+invoke-rc.d apache2 restart || true
416
417 restart_squid_deb_proxy
418
419 db_stop
420
421 #DEBHELPER#
422-
423-exit 0
424
425=== modified file 'debian/maas-region-controller.postrm'
426--- debian/maas-region-controller.postrm 2012-11-20 22:13:28 +0000
427+++ debian/maas-region-controller.postrm 2013-03-20 17:45:26 +0000
428@@ -22,8 +22,6 @@
429 # Restarting apache2
430 if [ -x /usr/sbin/invoke-rc.d ]; then
431 invoke-rc.d apache2 restart || true
432- else
433- /etc/init.d/apache2 restart || true
434 fi
435
436 # Delete symlink
437@@ -48,5 +46,3 @@
438 #DEBHELPER#
439
440 db_stop
441-
442-exit 0
443
444=== modified file 'debian/maas-region-controller.prerm'
445--- debian/maas-region-controller.prerm 2012-09-28 02:40:23 +0000
446+++ debian/maas-region-controller.prerm 2013-03-20 17:45:26 +0000
447@@ -6,13 +6,7 @@
448
449 #DEBHELPER#
450
451-if [ -x /usr/sbin/invoke-rc.d ]; then
452- invoke-rc.d apache2 stop || true
453-else
454- /etc/init.d/apache2 stop || true
455-fi
456+invoke-rc.d apache2 stop || true
457
458 . /usr/share/dbconfig-common/dpkg/prerm.pgsql
459 dbc_go maas-region-controller $@
460-
461-exit 0

Subscribers

People subscribed via source and target branches