Skip to content

Commit 3a0d5a7

Browse files
committed
.travis.yml: Simplify DIST setting
1 parent 372bd27 commit 3a0d5a7

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

.travis.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,20 @@ env:
66
- PG_SUPPORTED_VERSIONS=9.6
77
- PG_SUPPORTED_VERSIONS=10
88
- PG_SUPPORTED_VERSIONS=11
9-
- PG_SUPPORTED_VERSIONS=12
9+
- PG_SUPPORTED_VERSIONS=12 DIST=xenial-pgdg-testing
1010

1111
language: C
1212
dist: xenial
1313
sudo: required
1414

1515
before_install:
1616
# apt.postgresql.org is already configured, we just need to add devel
17-
- |
18-
case $PG_SUPPORTED_VERSIONS in
19-
12)
20-
# update pgdg-source.list
21-
sudo sed -i -e "s/pgdg.*/pgdg-testing main $PG_SUPPORTED_VERSIONS/" /etc/apt/sources.list.d/pgdg*.list
22-
DIST=xenial-pgdg-testing ;;
23-
*) DIST=xenial-pgdg ;;
24-
esac
17+
- [ "$DIST" ] && sudo sed -i -e "s/pgdg.*/pgdg-testing main $PG_SUPPORTED_VERSIONS/" /etc/apt/sources.list.d/pgdg*.list
2518
- sudo apt-get -qq update
2619

2720
install:
2821
- export DEBIAN_FRONTEND=noninteractive # suppress warnings about deprecated PostgreSQL versions
29-
- sudo apt-get install bison debhelper fakeroot flex postgresql-server-dev-$PG_SUPPORTED_VERSIONS postgresql-server-dev-all/$DIST
22+
- sudo apt-get install bison debhelper fakeroot flex postgresql-server-dev-$PG_SUPPORTED_VERSIONS postgresql-server-dev-all/${DIST:=xenial-pgdg}
3023
# install PostgreSQL $PG_SUPPORTED_VERSIONS if not there yet
3124
- |
3225
if [ ! -x /usr/lib/postgresql/$PG_SUPPORTED_VERSIONS/bin/postgres ]; then

0 commit comments

Comments
 (0)