From 3790df4cf7223b40a74af8fe5d771013bbbe52ab Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 7 Sep 2011 15:18:07 -0400 Subject: [PATCH] Display warning message and prompt before PostgreSQL removal Building on the good work in LP# 801624, use the -P "prompt" flag instead of -yq for apt(itude) to ensure that the user has the ability to quit the dependency install and reevaluate whether they want to actually destroy their existing PostgreSQL databases. Note that this is specifically in the context of the removal of the database packages, rather than a global change. Also, turn the inline comment into a displayed description of what is happening and why, along with a nice big warning. Signed-off-by: Dan Scott --- Open-ILS/src/extras/Makefile.install | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 666e55645d..e97635f48f 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -52,6 +52,7 @@ PAY_ONLINE=Business-OnlinePayment-3.00_08.tar.gz PAY_ONLINE_HOST=http://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/ APT_TOOL=aptitude -yq +APT_SAFE_TOOL=aptitude -P APT_BACKPORT_TOOL=aptitude -t squeeze-backports -yq # 64 or 32 bit os? @@ -396,12 +397,17 @@ debian_sys_config: install_debs: $(APT_TOOL) install $(DEBS) -# libpq5 / libpq-dev get 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 install_pgsql_client_debs_90: - if [ `$(APT_TOOL) versions libpq-dev | grep ^i|sed 's/^i[ \t]*//'|cut -d. -f1` -eq 8 ]; then $(APT_TOOL) remove libpq5 libpq-dev ; fi + @if [ `$(APT_TOOL) versions libpq-dev | grep ^i|sed 's/^i[ \t]*//'|cut -d. -f1` -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 $(APT_BACKPORT_TOOL) install $(PGSQL_CLIENT_DEBS_90) $(APT_TOOL) install apache2-prefork-dev -- 2.11.0