From: Jeff Godin Date: Tue, 13 Sep 2011 16:21:56 +0000 (-0400) Subject: Fix bash test for libpq-dev version X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3e2cc44a2906ad9a543f8d31bf4a99d81207053b;p=working%2FEvergreen.git Fix bash test for libpq-dev version The libpq-dev test in install_pgsql_client_debs_90 was broken for me, testing for "8 A" -eq "8". This change corrects the sed regex, and handles the case where the libpq-dev package is not installed. --- diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 5cf9c5741d..26927f9a1e 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -387,15 +387,20 @@ install_debs: $(APT_TOOL) install $(DEBS) install_pgsql_client_debs_90: - @if [ `$(APT_TOOL) versions libpq-dev | grep ^i|sed 's/^i[ \t]*//'|cut -d. -f1` -eq 8 ]; \ + @LIBPQ=`$(APT_TOOL) versions libpq-dev 2>&1 | grep ^i|sed 's/^i .[ \t]*//'|cut -d. -f1` ; \ + if [ $$LIBPQ ] ; \ then \ - echo -e "libpq5 / libpq-dev are installed as part of OpenSRF (a dependency" \ - "of apache2-prefork-dev), but these are the 8.4 versions and they" \ - "conflict with the 9.0 versions - so remove them, install the pinned" \ - "backports of 9.0, then reinstall the apache2-prefork-dev package.\n\n" \ - "**WARNING**: Saying 'Yes' to this step will _remove_ any PostgreSQL" \ - "databases that might currently exist on this machine." && \ - $(APT_SAFE_TOOL) remove libpq5 libpq-dev ; \ + echo $$LIBPQ; \ + if [ $$LIBPQ -eq 8 ] ; \ + then \ + echo -e "libpq5 / libpq-dev are installed as part of OpenSRF (a dependency" \ + "of apache2-prefork-dev), but these are the 8.4 versions and they" \ + "conflict with the 9.0 versions - so remove them, install the pinned" \ + "backports of 9.0, then reinstall the apache2-prefork-dev package.\n\n" \ + "**WARNING**: Saying 'Yes' to this step will _remove_ any PostgreSQL" \ + "databases that might currently exist on this machine." && \ + $(APT_SAFE_TOOL) remove libpq5 libpq-dev ; \ + fi \ fi $(APT_BACKPORT_TOOL) install $(PGSQL_CLIENT_DEBS_90) $(APT_TOOL) install apache2-prefork-dev