Uses dpkg-query to find the version of postgresql currently
installed and then installs that version of pgtap.
Signed-off-by: Jason Boyer <jboyer@equinoxOLI.org>
echo Return Value = $?
echo Installing pgtap
- PG_TAP_VER="1.2.0"
- wget -N http://api.pgxn.org/dist/pgtap/$PG_TAP_VER/pgtap-$PG_TAP_VER.zip \
- && unzip pgtap-$PG_TAP_VER.zip \
- && cd pgtap-$PG_TAP_VER \
- && make \
- && make installcheck \
- && make install
+
+ # output the name of the currently installed pg server dev package, then
+ # throw away everything up to and including the last '-' to get the correct pg version
+ PGVERS=`dpkg-query --showformat="\\${binary:Package}" --show 'postgresql-server-dev-*'`
+ apt-get install postgresql-${PGVERS##*-}-pgtap
+
echo 'CREATE EXTENSION pgtap;' | su - postgres -c "psql evergreen"
echo End of Create Evergreen Database =~-._