From c326d4f6d56081d17b48fac917be4ee48324602a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 23 Mar 2015 09:19:03 -0400 Subject: [PATCH] Bug 13893 - Add ability to execute perl scripts in atomicupdates Bug 13068 adds the ability to execute sql files from atomicupdates for in process developments to reduce merge conflicts. We need to extend this ability further to be able to handle perl code. Test Plan: 1) Apply this patch set 2) Run updatedatabase.pl 3) You should see the output "Upgrade to XXX done (Bug 13893 - Add ability to execute perl scripts in atomicupdates)" --- installer/data/mysql/updatedatabase.pl | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7207f82..04aff47 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9916,10 +9916,13 @@ if(CheckVersion($DBversion)) { my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; opendir( my $dirh, $update_dir ); while ( my $file = readdir $dirh ) { - next unless $file =~ /\.sql$/; # skip non SQL files - print "DEV atomic update : $file \n"; - my $installer = C4::Installer->new(); - my $rv = $installer->load_sql( $update_dir . $file ) ? 0 : 1; + if ( $file =~ /\.sql$/ ) { # skip non SQL files + print "DEV atomic update : $file \n"; + my $installer = C4::Installer->new(); + my $rv = $installer->load_sql( $update_dir . $file ) ? 0 : 1; + } elsif ( $file =~ /\.perl$/ ) { + do $update_dir . $file; + } } -- 1.7.2.5