Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support jessie/xenial in install scripts. #255

Merged
merged 1 commit into from
Aug 22, 2016
Merged

Conversation

dracos
Copy link
Member

@dracos dracos commented Aug 19, 2016

The script hardcoded a check for trusty as a proxy for PostGIS 2.
Instead, look up the postgis package version installed and use that.

@@ -68,11 +68,13 @@ fi
echo -n "Setting up database... "
if ! psql -l | egrep "^ *$DB_NAME *\|" > /dev/null
then
if [ trusty = "$(lsb_release -s -c)" ]
VERSION_POSTGIS=$(dpkg-query -W -f '${Version}\n' postgresql-*-postgis*|sort -rV|head -1)
POSTGIS_TWO=$(echo -e '2.0\n'$VERSION_POSTGIS | sort -V | head -1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is neat :) However I'd probably either:

  • Add a comment to explain that POSTGIS_TWO will be '2.0' if the PostGIS version is >= 2.0, and the actual version otherwise.
  • Or set POSTGIS_TWO to Yes or No, e.g. with:
if [ 2.0 = "$(echo -e '2.0\n'$VERSION_POSTGIS | sort -V | head -1)" ]
then POSTGIS_TWO=Yes
else POSTGIS_TWO=No
fi

@mhl
Copy link
Contributor

mhl commented Aug 22, 2016

A small optional comment, otherwise looks good 👍

The script hardcoded a check for trusty as a proxy for PostGIS 2.
Instead, look up the postgis package version installed and use that.
@dracos
Copy link
Member Author

dracos commented Aug 22, 2016

Discovered this was running somewhere where -e didn't work, switched to printf.

@dracos dracos deleted the jessie-support branch September 30, 2016 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants