From 22f1c07a21bc6155450de35c838855f73db35d05 Mon Sep 17 00:00:00 2001 From: Jon Robertson Date: Wed, 30 Jan 2013 20:06:37 -0800 Subject: Suppress DBIx::Class::Schema::Versioned warnings DBIx::Class::Schema::Versioned uses carp to send a few warnings that are more just informational messages. Use a local warning handler to skip the warnings we'll always get for normal upgrades. Change-Id: I4f987b290ec17b95d737150dd106e7bb0f62a264 Reviewed-on: https://gerrit.stanford.edu/730 Reviewed-by: Russ Allbery Tested-by: Russ Allbery --- perl/Wallet/Admin.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perl') diff --git a/perl/Wallet/Admin.pm b/perl/Wallet/Admin.pm index d2e8cb0..c0b1730 100644 --- a/perl/Wallet/Admin.pm +++ b/perl/Wallet/Admin.pm @@ -178,6 +178,14 @@ sub upgrade { $self->{dbh}->install ($BASE_VERSION); } + # Suppress warnings that actually are just informational messages. + local $SIG{__WARN__} = sub { + my ($warn) = @_; + return if $warn =~ m{Upgrade not necessary}; + return if $warn =~ m{Attempting upgrade}; + warn $warn; + }; + # Perform the actual upgrade. if ($self->{dbh}->get_db_version) { eval { $self->{dbh}->upgrade; }; -- cgit v1.2.3