
Untitled
By: a guest on Jun 8th, 2010 | syntax:
Perl | size: 0.69 KB | hits: 235 | expires: Never
#!/usr/bin/perl
use strict;
use warnings;
my $previous_HEAD = $ARGV[0];
my $new_HEAD = $ARGV[1];
my $checkout_flag = $ARGV[2];
my $koha_conf = $ENV{'KOHA_CONF'};
my $results = '';
my $branch_name = `git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`;
$branch_name =~ s/\*\s*//; # this could/should probably be done with sed above, but I'm no sed expert
# Setup if blocks to handle various cases of db names for various branches
# NOTE: You *must* fix this to match your particular installation.
if ($branch_name =~ m/3\.0\.x/) {
$results = `sed -i 's/koha_dev/3_0_x/' $koha_conf`;
}
else {
$results = `sed -i 's/3_0_x/koha_dev/' $koha_conf`;
}
exit 1;