diff -Nru postgresql-common-169/debian/changelog postgresql-common-169git1/debian/changelog --- postgresql-common-169/debian/changelog 2015-06-04 10:10:02.000000000 +0000 +++ postgresql-common-169git1/debian/changelog 2015-06-06 10:16:23.000000000 +0000 @@ -1,3 +1,16 @@ +postgresql-common (169git1) wily; urgency=medium + + Upload current git head to fix autopkgtest regression. + + [ Christoph Berg ] + * t/025_logging.t: Improve syslog detection in the test environment. + * pg_upgradecluster, t/030_errors.t: Unbreak after we changed the old=new + error message. + * PgCommon.pm: make read_cluster_conf_file read postgresql.auto.conf as well + (Closes: #787154) + + -- Martin Pitt Sat, 06 Jun 2015 12:16:06 +0200 + postgresql-common (169) unstable; urgency=medium * t/022_recovery.t: New recovery tests to catch regression in 9.4.2 and diff -Nru postgresql-common-169/PgCommon.pm postgresql-common-169git1/PgCommon.pm --- postgresql-common-169/PgCommon.pm 2015-05-06 21:25:15.000000000 +0000 +++ postgresql-common-169git1/PgCommon.pm 2015-06-06 10:14:48.000000000 +0000 @@ -171,9 +171,20 @@ # Arguments: # Returns: hash (empty if the file does not exist) sub read_cluster_conf_file { - my $fname = "$confroot/$_[0]/$_[1]/$_[2]"; - -e $fname or $fname = "$common_confdir/$_[2]"; - return read_conf_file $fname; + my $fname = "$confroot/$_[0]/$_[1]/$_[2]"; + -e $fname or $fname = "$common_confdir/$_[2]"; + my %conf = read_conf_file $fname; + + if ($_[0] >= 9.4 and $_[2] eq 'postgresql.conf') { # merge settings changed by ALTER SYSTEM + # data_directory cannot be changed by ALTER SYSTEM + my $data_directory = $conf{data_directory} || "/var/lib/postgresql/$_[0]/$_[1]"; + my %auto_conf = read_conf_file "$data_directory/postgresql.auto.conf"; + foreach my $guc (keys %auto_conf) { + $conf{$guc} = $auto_conf{$guc}; + } + } + + return %conf; } # Return parameter from a PostgreSQL configuration file, or undef if the parameter diff -Nru postgresql-common-169/pg_upgradecluster postgresql-common-169git1/pg_upgradecluster --- postgresql-common-169/pg_upgradecluster 2015-06-04 10:09:44.000000000 +0000 +++ postgresql-common-169git1/pg_upgradecluster 2015-06-06 10:14:48.000000000 +0000 @@ -293,14 +293,14 @@ my $datadir; ($datadir) = $ARGV[2] =~ /(.*)/ if defined $ARGV[2]; -error "cluster $version/$cluster is already on version $newversion. " . - "(The newest version installed on this system is $newest_version.)" - if ($version eq $newversion and $cluster eq $newcluster); - error 'specified cluster does not exist' unless cluster_exists $version, $cluster; %info = cluster_info ($version, $cluster); error 'cluster is disabled' if $info{'start'} eq 'disabled'; +error "cluster $version/$cluster is already on version $newversion. " . + "(The newest version installed on this system is $newest_version.)" + if ($version eq $newversion and $cluster eq $newcluster); + if (cluster_exists $newversion, $newcluster) { error "target cluster $newversion/$newcluster already exists"; } diff -Nru postgresql-common-169/t/025_logging.t postgresql-common-169git1/t/025_logging.t --- postgresql-common-169/t/025_logging.t 2015-05-06 21:25:15.000000000 +0000 +++ postgresql-common-169git1/t/025_logging.t 2015-06-06 10:14:48.000000000 +0000 @@ -8,6 +8,8 @@ use Test::More tests => 57 * ($#MAJORS+1); +my $syslog_works = 0; + sub check_logging ($$) { my ($text, $msg) = @_; @@ -38,7 +40,7 @@ is_program_out 'postgres', "psql -Atc \"show log_destination\"", 0, "syslog\n", 'log_destination is syslog'; check_logging qr($v main 5432 online postgres $pgdata syslog), "pg_lscluster reports syslog"; SKIP: { - skip "/var/log/syslog not readable", 2 unless (-r '/var/log/syslog'); + skip "/var/log/syslog not available", 2 unless ($syslog_works); like_program_out 0, "grep 'postgres.*parameter \"log_destination\" changed to \"syslog\"' /var/log/syslog", 0, qr/log_destination/, 'error appears in /var/log/syslog'; } @@ -60,7 +62,7 @@ like_program_out 'postgres', "psql -qc \"moo$$\"", 1, qr/syntax error.*moo$$/, 'log an error'; like_program_out 'postgres', "grep moo$$ $pgdata/pg_log/*.log", 0, qr/syntax error.*moo$$/, 'error appears in pg_log/*.log'; SKIP: { - skip "/var/log/syslog not readable", 2 unless (-r '/var/log/syslog'); + skip "/var/log/syslog not available", 2 unless ($syslog_works); like_program_out 0, "grep 'postgres.*moo$$' /var/log/syslog", 0, qr/moo$$/, 'error appears in /var/log/syslog'; } like_program_out 'postgres', "grep moo$$ $pgdata/pg_log/*.csv", 0, qr/syntax error.*moo$$/, 'error appears in pg_log/*.csv'; @@ -71,6 +73,14 @@ check_clean; } +system "logger -t '$0' 'test$$'"; +if (system ("grep -q 'test$$' /var/log/syslog") == 0) { + note 'Logging to /var/log/syslog works'; + $syslog_works = 1; +} else { + note 'Logging to /var/log/syslog does not work, skipping some syslog tests'; +} + foreach (@MAJORS) { check_major $_; } diff -Nru postgresql-common-169/t/030_errors.t postgresql-common-169git1/t/030_errors.t --- postgresql-common-169/t/030_errors.t 2015-05-06 21:25:15.000000000 +0000 +++ postgresql-common-169git1/t/030_errors.t 2015-06-06 10:14:48.000000000 +0000 @@ -29,7 +29,7 @@ my $outref; my $result = exec_as 0, $_[0], $outref; is $result, 1, "'$_[0]' fails"; - like $$outref, qr/(invalid version|does not exist|cannot upgrade)/i, "$_[0] gives error message about nonexisting cluster"; + like $$outref, qr/(invalid version|does not exist)/i, "$_[0] gives error message about nonexisting cluster"; unlike $$outref, qr/invalid symbolic link/i, "$_[0] does not print 'invalid symbolic link' gibberish"; }