Merge lp:~cjwatson/launchpad/fix-database-setup-version-check into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18652
Proposed branch: lp:~cjwatson/launchpad/fix-database-setup-version-check
Merge into: lp:launchpad
Diff against target: 18 lines (+4/-2)
1 file modified
utilities/launchpad-database-setup (+4/-2)
To merge this branch: bzr merge lp:~cjwatson/launchpad/fix-database-setup-version-check
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+345471@code.launchpad.net

Commit message

Fix launchpad-database-setup to fail if a supported PostgreSQL version is not present.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'utilities/launchpad-database-setup'
--- utilities/launchpad-database-setup 2016-11-14 11:57:35 +0000
+++ utilities/launchpad-database-setup 2018-05-13 10:32:30 +0000
@@ -18,10 +18,12 @@
18# https://dev.launchpad.net/DatabaseSetup which are intended for18# https://dev.launchpad.net/DatabaseSetup which are intended for
19# initial Launchpad setup on an otherwise unconfigured postgresql instance19# initial Launchpad setup on an otherwise unconfigured postgresql instance
2020
21for pgversion in 9.3 9.5 9.621pgversion=
22for try_pgversion in 9.3 9.5 9.6
22do23do
23 sudo grep -qs "^auto" /etc/postgresql/$pgversion/main/start.conf24 sudo grep -qs "^auto" /etc/postgresql/$try_pgversion/main/start.conf
24 if [ $? -eq 0 ]; then25 if [ $? -eq 0 ]; then
26 pgversion="$try_pgversion"
25 break27 break
26 fi28 fi
27done29done