[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] We really don't want environment variables to cause us to drop the wrong damn database



Signed-off-by: Mark Hymers <mhy@debian.org>
---
 config/debian/dinstall.functions |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions
index 34664c7..fc6ad47 100644
--- a/config/debian/dinstall.functions
+++ b/config/debian/dinstall.functions
@@ -53,11 +53,21 @@ function pgdump_post() {
 
 # Load the dak-dev projectb
 function pgdakdev() {
+    # Make sure to unset any possible psql variables so we don't drop the wrong
+    # f****** database by accident
+    local PGDATABASE
+    unset PGDATABASE
+    local PGHOST
+    unset PGHOST
+    local PGPORT
+    unset PGPORT
+    local PGUSER
+    unset PGUSER
     cd $base/backup
-    echo "drop database projectb" | psql -p 5433 template1
+    echo "drop database projectb" | psql -p 5434 template1
 	#cat currentall | psql -p 5433 template1
-    createdb -p 5433 -T template1 projectb
-    fgrep -v '\connect' current | psql -p 5433 projectb
+    createdb -p 5434 -T template1 projectb
+    fgrep -v '\connect' current | psql -p 5434 projectb
 }
 
 # Updating various files
-- 
1.5.6.5



Reply to: