Steve Singer,,, ssinger at lists.slony.info
Wed Jun 30 07:04:59 PDT 2010
Update of /home/cvsd/slony1/slony1-engine/tools/altperl
In directory main.slony.info:/tmp/cvs-serv25676/tools/altperl

Modified Files:
	slonik_drop_set.pl slonik_execute_script.pl 
	slonik_merge_sets.pl slonik_move_set.pl 
	slonik_subscribe_set.pl slonik_unsubscribe_set.pl 
Log Message:
Fix for bug #43
Use get_set more consistently in the perl tools.
Patch by Peter Eisentraut.

Merged from 2.0



Index: slonik_subscribe_set.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/altperl/slonik_subscribe_set.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** slonik_subscribe_set.pl	17 Aug 2009 17:25:50 -0000	1.4
--- slonik_subscribe_set.pl	30 Jun 2010 14:04:57 -0000	1.5
***************
*** 37,48 ****
  }
  
! if ($set =~ /^(?:set)?(\d+)$/) {
!   $set = $1;
! } else {
!   print "Need to specify set!\n";
!   die $USAGE;
! }
! 
! get_set($set) or die "Non-existent set specified.\n";
  
  my $slonik = '';
--- 37,42 ----
  }
  
! die $USAGE unless $set;
! $set = get_set($set) or die "Non-existent set specified.\n";
  
  my $slonik = '';

Index: slonik_unsubscribe_set.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/altperl/slonik_unsubscribe_set.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** slonik_unsubscribe_set.pl	17 Aug 2009 17:25:50 -0000	1.4
--- slonik_unsubscribe_set.pl	30 Jun 2010 14:04:57 -0000	1.5
***************
*** 37,46 ****
  }
  
! if ($set =~ /^(?:set)?(\d+)$/) {
!   $set = $1;
! } else {
!   print "Need to specify set!\n\n";
!   die $USAGE;
! }
  
  my $slonik = '';
--- 37,42 ----
  }
  
! die $USAGE unless $set;
! $set = get_set($set) or die "Non-existent set specified.\n";
  
  my $slonik = '';

Index: slonik_execute_script.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/altperl/slonik_execute_script.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C 2 -d -r1.5 -r1.6
*** slonik_execute_script.pl	17 Aug 2009 17:25:50 -0000	1.5
--- slonik_execute_script.pl	30 Jun 2010 14:04:57 -0000	1.6
***************
*** 55,66 ****
  
  my ($set, $file) = @ARGV;
! if ($set =~ /^(?:set)?(\d+)$/) {
!   $set = $1;
! } else {
!   print "Invalid set identifier\n\n";
!   die $USAGE;
! }
! 
! get_set($set) or die "Non-existent set specified.\n";
  $node = $SET_ORIGIN unless $node;
  
--- 55,60 ----
  
  my ($set, $file) = @ARGV;
! die $USAGE unless $set;
! $set = get_set($set) or die "Non-existent set specified.\n";
  $node = $SET_ORIGIN unless $node;
  

Index: slonik_drop_set.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/altperl/slonik_drop_set.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C 2 -d -r1.5 -r1.6
*** slonik_drop_set.pl	17 Aug 2009 17:25:50 -0000	1.5
--- slonik_drop_set.pl	30 Jun 2010 14:04:57 -0000	1.6
***************
*** 42,53 ****
  
  my ($set) = @ARGV;
! if ($set =~ /^(?:set)?(\d+)$/) {
!   $set = $1;
! } else {
!   print "Need set identifier\n";
!   die $USAGE;
! }
! 
! get_set($set) or die "Non-existent set specified.\n";
  
  my $slonik = '';
--- 42,47 ----
  
  my ($set) = @ARGV;
! die $USAGE unless $set;
! $set = get_set($set) or die "Non-existent set specified.\n";
  
  my $slonik = '';

Index: slonik_merge_sets.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/altperl/slonik_merge_sets.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** slonik_merge_sets.pl	17 Aug 2009 17:25:50 -0000	1.6
--- slonik_merge_sets.pl	30 Jun 2010 14:04:57 -0000	1.7
***************
*** 39,55 ****
  }
  
! if ($set1 =~ /^(?:set)?(\d+)$/) {
!   $set1 = $1;
! } else {
!   print "Valid set names are set1, set2, ...\n\n";
!   die $USAGE;
! }
! 
! if ($set2 =~ /^(?:set)?(\d+)$/) {
!   $set2 = $1;
! } else {
!   print "Valid set names are set1, set2, ...\n\n";
!   die $USAGE;
! }
  
  my ($dbname, $dbhost) = ($DBNAME[$MASTERNODE], $HOST[$MASTERNODE]);
--- 39,46 ----
  }
  
! die $USAGE unless $set1;
! $set1 = get_set($set1) or die "Non-existent set specified.\n";
! die $USAGE unless $set2;
! $set2 = get_set($set2) or die "Non-existent set specified.\n";
  
  my ($dbname, $dbhost) = ($DBNAME[$MASTERNODE], $HOST[$MASTERNODE]);

Index: slonik_move_set.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/altperl/slonik_move_set.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** slonik_move_set.pl	21 Oct 2009 13:32:08 -0000	1.6
--- slonik_move_set.pl	30 Jun 2010 14:04:57 -0000	1.7
***************
*** 30,40 ****
  
  my ($set, $node1, $node2) = @ARGV;
! if ($set =~ /^(?:set)?(\d+)$/) {
!   # Node name is in proper form
!   $set = $1;
! } else {
!   print "Valid set names are set1, set2, ...\n\n";
!   die $USAGE;
! }
  
  if ($node1 =~ /^(?:node)?(\d+)$/) {
--- 30,36 ----
  
  my ($set, $node1, $node2) = @ARGV;
! 
! die $USAGE unless $set;
! $set = get_set($set) or die "Non-existent set specified.\n";
  
  if ($node1 =~ /^(?:node)?(\d+)$/) {



More information about the Slony1-commit mailing list