Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 7661588

Browse files
authored
Merge pull request #42 from quikly/postgres-9.5
Upgrade to PG 9.5.2
2 parents a286b39 + 6363049 commit 7661588

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

files/brews/postgresql.rb

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
class Postgresql < Formula
22
desc "Object-relational database system"
33
homepage "https://www.postgresql.org/"
4-
revision 2
5-
6-
stable do
7-
url "https://ftp.postgresql.org/pub/source/v9.4.5/postgresql-9.4.5.tar.bz2"
8-
sha256 "b87c50c66b6ea42a9712b5f6284794fabad0616e6ae420cf0f10523be6d94a39"
9-
end
4+
url "https://ftp.postgresql.org/pub/source/v9.5.2/postgresql-9.5.2.tar.bz2"
5+
sha256 "f8d132e464506b551ef498719f18cfe9d777709c7a1589dc360afc0b20e47c41"
106

117
bottle do
12-
sha256 "b57a3b65cd90917273d754f2625a83e69eac78aeff5b79573f8ac9811bdf643c" => :el_capitan
13-
sha256 "6b26ad24a228620e16d7f81b4f3bd183a80e1c2f02b8505a1a6b71356eec53a4" => :yosemite
14-
sha256 "a6a49e234543bb7c4fb33b64dd14b48da5b8373fb2110d62e82d7129997f4926" => :mavericks
15-
end
16-
17-
devel do
18-
url "https://ftp.postgresql.org/pub/source/v9.5beta1/postgresql-9.5beta1.tar.bz2"
19-
sha256 "b53199e2667982de2039ad7e30467f67c5d7af678e69d6211de8ba1cac75c9f0"
20-
version "9.5beta1"
8+
revision 1
9+
sha256 "12bc2c22b06aaa82f577c14a667805a6e8aed9065a3a376e324393afdf6b62f0" => :el_capitan
10+
sha256 "5e7ee10a23edb6ee985f49a969894133939a20eaeee2f2841cb8be82c2f79c74" => :yosemite
11+
sha256 "e6673530167899750d5f2eaaebe53e7ff8b10caada449aef39d66a1af39cfe49" => :mavericks
2112
end
2213

2314
option "32-bit"
@@ -46,7 +37,7 @@ def install
4637
ENV.libxml2 if MacOS.version >= :snow_leopard
4738

4839
ENV.prepend "LDFLAGS", "-L#{Formula["openssl"].opt_lib} -L#{Formula["readline"].opt_lib}"
49-
ENV.prepend "CPPLAGS", "-I#{Formula["openssl"].opt_include} -I#{Formula["readline"].opt_include}"
40+
ENV.prepend "CPPFLAGS", "-I#{Formula["openssl"].opt_include} -I#{Formula["readline"].opt_include}"
5041

5142
args = %W[
5243
--disable-debug
@@ -93,7 +84,8 @@ def install
9384
end
9485

9586
def post_install
96-
unless File.exist? "#{var}/postgres"
87+
(var/"postgres").mkpath
88+
unless File.exist? "#{var}/postgres/PG_VERSION"
9789
system "#{bin}/initdb", "#{var}/postgres"
9890
end
9991
end
@@ -103,8 +95,14 @@ def caveats; <<-EOS.undent
10395
you may need to remove the previous version first. See:
10496
https://github.com/Homebrew/homebrew/issues/2510
10597
106-
To migrate existing data from a previous major version (pre-9.4) of PostgreSQL, see:
107-
https://www.postgresql.org/docs/9.4/static/upgrading.html
98+
To migrate existing data from a previous major version (pre-9.0) of PostgreSQL, see:
99+
https://www.postgresql.org/docs/9.5/static/upgrading.html
100+
101+
To migrate existing data from a previous minor version (9.0-9.4) of PosgresSQL, see:
102+
https://www.postgresql.org/docs/9.5/static/pgupgrade.html
103+
104+
You will need your previous PostgreSQL installation from brew to perform `pg_upgrade`.
105+
Do not run `brew cleanup postgresql` until you have performed the migration.
108106
EOS
109107
end
110108

manifests/params.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
$bindir = "${boxen::config::homebrewdir}/bin"
99
$executable = "${bindir}/postgres"
10-
$datadir = "${boxen::config::datadir}/postgresql-9.4"
11-
$logdir = "${boxen::config::logdir}/postgresql-9.4"
10+
$datadir = "${boxen::config::datadir}/postgresql-9.5"
11+
$logdir = "${boxen::config::logdir}/postgresql-9.5"
1212
$port = 15432
1313

1414
$package = 'boxen/brews/postgresql'
15-
$version = '9.4.5_2'
15+
$version = '9.5.2'
1616

1717
$service = 'dev.postgresql'
1818

spec/classes/postgresql__config_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
it do
77
should include_class('boxen::config')
88

9-
%w(data/postgresql-9.4 log/postgresql-9.4).each do |d|
9+
%w(data/postgresql-9.5 log/postgresql-9.5).each do |d|
1010
should contain_file("/test/boxen/#{d}").with_ensure(:directory)
1111
end
1212

spec/classes/postgresql__service_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
it do
77
should contain_service("com.boxen.postgresql").with_ensure(:stopped)
88

9-
should contain_exec("init-postgresql-db").with_creates("/test/boxen/data/postgresql-9.4/PG_VERSION")
9+
should contain_exec("init-postgresql-db").with_creates("/test/boxen/data/postgresql-9.5/PG_VERSION")
1010
should contain_service("dev.postgresql").with_ensure(:running)
1111
should contain_exec("wait-for-postgresql").with_unless("nc -z 127.0.0.1 15432")
1212
end

0 commit comments

Comments
 (0)