Guest

Untitled

By: a guest on Jun 8th, 2010  |  syntax: Perl  |  size: 0.69 KB  |  hits: 235  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. my $previous_HEAD = $ARGV[0];
  7. my $new_HEAD = $ARGV[1];
  8. my $checkout_flag = $ARGV[2];
  9. my $koha_conf = $ENV{'KOHA_CONF'};
  10. my $results = '';
  11.  
  12. my $branch_name = `git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`;
  13. $branch_name =~ s/\*\s*//; # this could/should probably be done with sed above, but I'm no sed expert
  14.  
  15. # Setup if blocks to handle various cases of db names for various branches
  16. # NOTE: You *must* fix this to match your particular installation.
  17.  
  18. if ($branch_name =~ m/3\.0\.x/) {
  19.     $results = `sed -i 's/koha_dev/3_0_x/' $koha_conf`;
  20. }
  21. else {
  22.     $results = `sed -i 's/3_0_x/koha_dev/' $koha_conf`;
  23. }
  24.  
  25. exit 1;