From 2ff0b27599ac1606a33765aa8fa44bbd0358b63e Mon Sep 17 00:00:00 2001
From: unknown <martin@piware.de>
Date: Fri, 30 Dec 2005 20:49:27 +0100
Subject: [PATCH] improve error message in pg_wrapper, adapt test suite

---
 postgresql-common/pg_wrapper           | 3 +--
 postgresql-common/t/090_multicluster.t | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/postgresql-common/pg_wrapper b/postgresql-common/pg_wrapper
index 50714bfe..1b173abd 100755
--- a/postgresql-common/pg_wrapper
+++ b/postgresql-common/pg_wrapper
@@ -16,7 +16,7 @@ my ($version, $cluster, $db, $port);
 if (defined $ENV{PGCLUSTER}) {
     ($version, $cluster) = split ('/', $ENV{PGCLUSTER}, 2);
     error 'Invalid version specified with $PGCLUSTER' unless version_exists $version;
-    error 'Invalid cluster specified with $PGCLUSTER' unless $cluster;
+    error 'No cluster specified with $PGCLUSTER' unless $cluster;
     error 'Cluster specified with $PGCLUSTER does not exist' unless cluster_exists $version, $cluster;
 }
 
@@ -28,7 +28,6 @@ for (my $i = 0; $i <= $#ARGV; ++$i) {
         ($version, $cluster) = split ('/', $ARGV[$i+1], 2);
         error 'Invalid version specified with --cluster' unless version_exists $version;
         error 'No cluster specified with --cluster' unless $cluster;
-
 	error 'Cluster does not exist' unless cluster_exists $version, $cluster;
 
         splice @ARGV, $i, 2;
diff --git a/postgresql-common/t/090_multicluster.t b/postgresql-common/t/090_multicluster.t
index 65c83ef9..5a8149e3 100644
--- a/postgresql-common/t/090_multicluster.t
+++ b/postgresql-common/t/090_multicluster.t
@@ -48,7 +48,7 @@ unlike_program_out 'postgres', "psql -Atl", 0, qr/test\|postgres\|/,
     'PGCLUSTER selection (2)';
 $ENV{'PGCLUSTER'} = 'foo';
 like_program_out 'postgres', "psql -l", 1, 
-    qr/Invalid cluster specified with \$PGCLUSTER/, 
+    qr/Invalid version specified with \$PGCLUSTER/, 
     'invalid PGCLUSTER value';
 delete $ENV{'PGCLUSTER'};
 
-- 
GitLab