Skip Menu |

This queue is for tickets about the ORLite-Migrate CPAN distribution.

Report information
The Basics
Id: 46999
Status: resolved
Priority: 0/
Queue: ORLite-Migrate

People
Owner: Nobody in particular
Requestors: tlb [...] rapanden.dk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: (no value)



Subject: Missing exit code check when running migrate-* scripts.
You should also check exit code as noted in the IPC::Run3 man page. "Note that a true return value from run3 doesn't mean that the command had a successful exit code. Hence you should always check $?." +++ /usr/local/share/perl/5.10.0/ORLite/Migrate.pm 2009-06-16 14:21:04.000000000 +0200 @@ -112,7 +112,7 @@ print STDERR "Applying schema patch $patch...\n"; } my $ok = IPC::Run3::run3( [ $perl, $patch ], \$stdin, \undef, $DEBUG ? undef : \undef ); - unless ( $ok ) { + if ( !$ok or $? != 0 ) { Carp::croak("Migration patch $patch failed, database in unknown state"); } }
Subject: Re: [rt.cpan.org #46999] Missing exit code check when running migrate-* scripts.
Date: Wed, 17 Jun 2009 03:06:15 +1000
To: bug-ORLite-Migrate [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
The same problem occurred in the commercial code from which it was originally derived :( I'll steal the relevant patch and merge it in. Adam K 2009/6/16 Troels Liebe Bentsen via RT <bug-ORLite-Migrate@rt.cpan.org> Show quoted text
> Tue Jun 16 08:31:07 2009: Request 46999 was acted upon. > Transaction: Ticket created by TLBDK > Queue: ORLite-Migrate > Subject: Missing exit code check when running migrate-* scripts. > Broken in: 0.03 > Severity: Important > Owner: Nobody > Requestors: tlb@rapanden.dk > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46999 > > > > You should also check exit code as noted in the IPC::Run3 man page. > > "Note that a true return value from run3 doesn't mean that the command > had a successful exit code. Hence you should always check $?." > > > +++ /usr/local/share/perl/5.10.0/ORLite/Migrate.pm 2009-06-16 > 14:21:04.000000000 +0200 > @@ -112,7 +112,7 @@ > print STDERR "Applying schema patch > $patch...\n"; > } > my $ok = IPC::Run3::run3( [ $perl, $patch ], > \$stdin, \undef, > $DEBUG ? undef : \undef ); > - unless ( $ok ) { > + if ( !$ok or $? != 0 ) { > Carp::croak("Migration patch $patch failed, > database in unknown > state"); > } > } > >
Fixed and released in 1.07