Skip to content

Commit

Permalink
Address remaining version-testing problems
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmp85 committed Aug 30, 2017
1 parent cc40609 commit f4c47a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions travis/install_custom_pg
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ cd ~
if [ "$(ls -A postgresql)" ]; then
git -C postgresql pull
else
if [ "${PGVERSION}" == '11' ]; then
pgmajornum="${PGVERSION%%.*}"
if [ "${pgmajornum}" -gt '10' ]; then
# ten is highest stable build; use master for higher
gitref="master"
elif [ "${PGVERSION}" == '9.6' ]; then
gitref="REL9_6_STABLE"
else
elif [ "${pgmajornum}" -gt '9' ]; then
gitref="REL_${PGVERSION}_STABLE"
else
gitref="REL${PGVERSION//./_}_STABLE"
fi

git clone -b "${gitref}" --depth 1 git://git.postgresql.org/git/postgresql.git
Expand Down
12 changes: 7 additions & 5 deletions travis/setup_apt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8
# wtf, Google?
sudo rm /etc/apt/sources.list.d/google-chrome*

# add the PostgreSQL 9.5 repository
# add the PostgreSQL 9.5 and 10 repositories
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main 9.5" >> /etc/apt/sources.list.d/postgresql.list'
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main 10" >> /etc/apt/sources.list.d/postgresql.list'

if [ "${PGVERSION}" == "10" ]; then
# add the PostgreSQL 10 testing repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg-testing main 10" >> /etc/apt/sources.list.d/postgresql.list'
# need testing repository after version 10
if [ "${PGVERSION%%.*}" -gt '10' ]; then
# add a PostgreSQL testing repository
sudo sh -Ec 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg-testing main ${PGVERSION}" >> /etc/apt/sources.list.d/postgresql.list'

sudo sh -c 'echo "Package: *\nPin: release n=trusty-pgdg-testing\nPin-Priority: 600" >> /etc/apt/preferences.d/postgresql.pref'
sudo sh -c 'echo "Package: *\nPin: release n=$(lsb_release -cs)-pgdg-testing\nPin-Priority: 600" >> /etc/apt/preferences.d/postgresql.pref'
fi

# update package index files from sources
Expand Down

0 comments on commit f4c47a2

Please sign in to comment.